View Javadoc
1   package tutorial.domain;
2   
3   import jakarta.persistence.Column;
4   import jakarta.persistence.Entity;
5   import jakarta.persistence.GeneratedValue;
6   import jakarta.persistence.Id;
7   
8   import java.math.BigDecimal;
9   
10  @Entity
11  public class EntityX {
12      @Id
13      @GeneratedValue
14      private int id;
15      @Column(length = 20, nullable = false)
16      private String someProperty;
17      @Column(length = 100)
18      private String customerEmail;
19      @Column(precision = 15, scale = 2)
20      private BigDecimal total;
21  
22      public EntityX() {
23      }
24  
25      public EntityX(int type, String code, String customerEmail) {
26          this.customerEmail = customerEmail;
27          someProperty = "abc";
28      }
29  
30      public int getId() {
31          return id;
32      }
33  
34      public String getSomeProperty() {
35          return someProperty;
36      }
37  
38      public void setSomeProperty(String someProperty) {
39          this.someProperty = someProperty;
40      }
41  
42      public String getCustomerEmail() {
43          return customerEmail;
44      }
45  
46      public void setCustomerEmail(String customerEmail) {
47          this.customerEmail = customerEmail;
48      }
49  
50      public BigDecimal getTotal() {
51          return total;
52      }
53  
54      public void setTotal(BigDecimal total) {
55          this.total = total;
56      }
57  }