1   /*
2    * Check.java
3    * Created on 16 Август 2006 г., 15:29
4    */
5   
6   package org.weda.domain;
7   
8   import javax.persistence.Entity;
9   import javax.persistence.GeneratedValue;
10  import javax.persistence.GenerationType;
11  import javax.persistence.Id;
12  import javax.persistence.ManyToOne;
13  import javax.persistence.Table;
14  import org.weda.property.annotations.ConstraintId;
15  import org.weda.property.annotations.Constraints;
16  import org.weda.property.annotations.Description;
17  
18  /**
19   *
20   * @author Mikhail Titov
21   */
22  @Entity()
23  @Table(name="check_")
24  public class Check {
25      private Long id;
26      private Company company;
27      private Contract contract;
28      private Double amount;
29  
30      @Id @GeneratedValue(strategy=GenerationType.AUTO)
31      @Description(displayName="s/n")
32      public Long getId() {
33          return id;
34      }
35  
36      public void setId(Long id) {
37          this.id = id;
38      }
39  
40      @Description(displayName="Контрагент")
41      @ManyToOne()
42      @Constraints({
43          @ConstraintId("company"),  
44          @ConstraintId("notNull")
45      })
46      public Company getCompany() {
47          return company;
48      }
49  
50      public void setCompany(Company company) {
51          this.company = company;
52      }
53  
54      @Description(displayName="Контракт")
55      @ManyToOne()
56      @Constraints({
57          @ConstraintId("contract"),
58          @ConstraintId("notNull")
59      })
60      public Contract getContract() {
61          return contract;
62      }
63  
64      public void setContract(Contract contract) {
65          this.contract = contract;
66      }
67  
68      @Description(displayName="Сумма", pattern="0.00")
69      @Constraints({
70          @ConstraintId("notNull")
71      })
72      public Double getAmount() {
73          return amount;
74      }
75  
76      public void setAmount(Double amount) {
77          this.amount = amount;
78      }
79  }