Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package mandacaru3.entities;
- import jakarta.persistence.Column;
- import jakarta.persistence.Entity;
- import jakarta.persistence.GeneratedValue;
- import jakarta.persistence.Id;
- @Entity(name = "products")
- public class Product {
- @Id
- @GeneratedValue
- @Column(name = "id")
- private int id;
- @Column(name = "name")
- private String name;
- @Column(name = "price")
- private double price;
- public int getId() {
- return id;
- }
- public void setId(int id) {
- this.id = id;
- }
- public String getName() {
- return name;
- }
- public void setName(String name) {
- this.name = name;
- }
- public double getPrice() {
- return price;
- }
- public void setPrice(double price) {
- this.price = price;
- }
- @Override
- public String toString() {
- return "Product [id=" + id + ", name=" + name + ", price=" + price + "]";
- }
- public Product(int id, String name, double price) {
- super();
- this.id = id;
- this.name = name;
- this.price = price;
- }
- public Product() {
- super();
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement