View Javadoc
1   package myorg.relex.one2one;
2   
3   import java.util.Date;
4   
5   import javax.persistence.*;
6   
7   /**
8    * This class represents the passive side of a one-to-one
9    * uni-directional relationship where the parent uses
10   * a composite primary key that must be represented in 
11   * the dependent entity's relationship.
12   */
13  @Entity
14  @Table(name="RELATIONEX_SHOWEVENT")
15  @IdClass(ShowEventPK.class)
16  public class ShowEvent {
17  	@Id
18  	@Temporal(TemporalType.DATE)
19  	private Date date;
20  	@Id
21  	@Temporal(TemporalType.TIME)
22  	private Date time;
23  	@Column(length=20)
24  	private String name;
25  	
26  	public ShowEvent() {}
27  	public ShowEvent(Date date, Date time) {
28  		this.date = date;
29  		this.time = time;
30  	}
31  	public Date getDate() { return date; }
32  	public Date getTime() { return time; }
33  
34  	public String getName() { return name; }
35  	public void setName(String name) {
36  		this.name = name;
37  	}
38  }