| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172 |
- package pl.sudra.domain;
- import jakarta.persistence.Entity;
- import jakarta.persistence.GeneratedValue;
- import jakarta.persistence.GenerationType;
- import jakarta.persistence.Id;
- import jakarta.validation.constraints.NotNull;
- @Entity
- public class Boat {
- @Id
- @GeneratedValue(strategy = GenerationType.AUTO)
- private Long id;
- @NotNull
- private String name;
- @NotNull
- private Integer capacity;
- @NotNull
- private Float cost;
- public Boat() {
- }
- public Long getId() {
- return id;
- }
- public void setId(Long id) {
- this.id = id;
- }
- public String getName() {
- return name;
- }
- public void setName(String name) {
- this.name = name;
- }
- public Integer getCapacity() {
- return capacity;
- }
- public void setCapacity(Integer capacity) {
- this.capacity = capacity;
- }
- public Float getCost() {
- return cost;
- }
- public void setCost(Float cost) {
- this.cost = cost;
- }
- @Override
- public String toString() {
- return "Boat{" +
- "name='" + name + '\'' +
- ", capacity=" + capacity +
- ", cost=" + cost +
- '}';
- }
- public Boat(Long id, String name, Integer capacity, Float cost) {
- this.id = id;
- this.name = name;
- this.capacity = capacity;
- this.cost = cost;
- }
- }
|