View Javadoc
1   package ejava.examples.orm.core.mapped;
2   
3   import java.util.Date;
4   
5   import ejava.examples.orm.core.ColorType;
6   
7   /**
8    * This class provides an example of mapping various types to the database,
9    * like dates, enums, etc.
10   */
11  public class Vase {
12      private long id;
13      private Date aDate;
14      private Date aTime;
15      private Date aTimestamp;
16      private ColorType colorId;
17      private ColorType colorName;
18  
19      public Vase() {}
20      public Vase(long id) { this.id = id; }
21  
22      public long getId() { return id; }
23      
24      public Date getADate() { return aDate; }
25      public void setADate(Date date) {
26          aDate = date;
27      }
28      
29      public Date getATime() { return aTime; }
30      public void setATime(Date time) {
31          aTime = time;
32      }
33      
34      public Date getATimestamp() { return aTimestamp; }
35      public void setATimestamp(Date timestamp) {
36          aTimestamp = timestamp;
37      }
38      
39      public ColorType getColorId() { return colorId; }
40      public void setColorId(ColorType colorId) {
41          this.colorId = colorId;
42      }
43  
44      public ColorType getColorName() { return colorName; }
45      public void setColorName(ColorType colorName) {
46          this.colorName = colorName;
47      }
48      
49      public String toString() {
50          return super.toString() +
51              ", id=" + id +
52              ", aDate=" + aDate +
53              ", aTime=" + aTime +
54              ", aTimestamp=" + aTimestamp +            
55              ", colorId=" + colorId +
56              ", colorName=" + colorName;        
57      }
58  }
59