View Javadoc
1   package myorg.entityex.annotated;
2   
3   import java.util.Calendar;
4   import java.util.Date;
5   import javax.persistence.*;
6   
7   @Entity
8   @Table(name="ENTITYEX_SHARK")
9   public class Shark {
10  	@Id @GeneratedValue
11  	private int id;
12  	//@Temporal(TemporalType.DATE)
13  	private Calendar aDate;
14  	//@Temporal(TemporalType.TIME)
15  	private Date aTime;
16  	//@Temporal(TemporalType.TIMESTAMP)
17  	private Date aTimestamp;
18  	
19  	public int getId() { return id; }
20  	public Shark setId(int id) {
21  		this.id = id; return this;
22  	}
23  	
24  	public Calendar getDate() { return aDate; }
25  	public Shark setDate(Calendar date) {
26  		this.aDate = date; return this;
27  	}
28  	
29  	public Date getTime() { return aTime; }
30  	public Shark setTime(Date time) {
31  		this.aTime = time; return this;
32  	}
33  	
34  	public Date getTimestamp() { return aTimestamp; }
35  	public Shark setTimestamp(Date timestamp) {
36  		this.aTimestamp = timestamp; return this;
37  	}
38  	
39  	@Override
40  	public String toString() {
41  		return new StringBuilder()
42  			.append("aDate=").append(aDate.getTime())
43  			.append(", aTime=").append(aTime)
44  			.append(", aTimestamp=").append(aTimestamp)
45  			.toString();
46  	}
47  }