1 package ejava.examples.blpurchase.bo;
2
3 import javax.persistence.Column;
4 import javax.persistence.Entity;
5 import javax.persistence.GeneratedValue;
6 import javax.persistence.Id;
7 import javax.persistence.Table;
8
9 @Entity
10 @Table(name="BLPURCHASE_PRODUCT")
11 public class Product {
12 @Id @GeneratedValue
13 private int id;
14 @Column(nullable=false)
15 private String name;
16 @Column(nullable=false)
17 private double price;
18 @Column(nullable=false)
19 private int count;
20
21 public Product(){}
22 public Product(String name, double price, int count) {
23 this.name = name;
24 this.price = price;
25 this.count=count;
26 }
27 public int getId() {
28 return id;
29 }
30 protected void setId(int id) {
31 this.id = id;
32 }
33 public String getName() {
34 return name;
35 }
36 public void setName(String name) {
37 this.name = name;
38 }
39 public double getPrice() {
40 return price;
41 }
42 public void setPrice(double price) {
43 this.price = price;
44 }
45 public int getCount() {
46 return count;
47 }
48 public void setCount(int count) {
49 this.count = count;
50 }
51 }