Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- @Entity
- public class Product {
- @Id
- @GeneratedValue
- private long Id;
- @NotBlank
- private String name;
- @NotNull
- private int price;
- public long getId() {
- return Id;
- }
- public String getName() {
- return name;
- }
- public int getPrice() {
- return price;
- }
- public void setId(long id) {
- Id = id;
- }
- public void setName(String name) {
- this.name = name;
- }
- public void setPrice(int price) {
- this.price = price;
- }
- @Override
- public String toString() {
- return "Product{" +
- "Id=" + Id +
- ", name='" + name + '\'' +
- ", price=" + price +
- '}';
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment