1 22 package org.jboss.ejb3.test.hbm; 23 24 import javax.persistence.Entity; 25 import javax.persistence.Id; 26 import javax.persistence.GeneratedValue; import javax.persistence.GenerationType; 27 import javax.persistence.OneToOne; 28 import javax.persistence.CascadeType; 29 import javax.persistence.JoinColumn; 30 import javax.persistence.FetchType; 31 import java.io.Serializable ; 32 33 38 @Entity 39 public class Annotated implements Serializable 40 { 41 private long id; 42 private String name; 43 private HBM hbm; 44 45 @Id @GeneratedValue(strategy=GenerationType.AUTO) 46 public long getId() 47 { 48 return id; 49 } 50 51 public void setId(long id) 52 { 53 this.id = id; 54 } 55 56 public String getName() 57 { 58 return name; 59 } 60 61 public void setName(String name) 62 { 63 this.name = name; 64 } 65 66 @OneToOne(cascade={CascadeType.ALL}, fetch=FetchType.EAGER) 67 @JoinColumn(name="HBM_ID") 68 public HBM getHbm() 69 { 70 return hbm; 71 } 72 73 public void setHbm(HBM hbm) 74 { 75 this.hbm = hbm; 76 } 77 78 79 } 80 | Popular Tags |