1 22 package org.jboss.ejb3.test.composite2; 23 24 import java.io.Serializable ; 25 import javax.persistence.EmbeddedId; 26 import javax.persistence.Entity; 27 import javax.persistence.FetchType; 28 import javax.persistence.JoinColumn; 29 import javax.persistence.ManyToOne; 30 31 36 @Entity 37 public class Composite implements Serializable 38 { 39 private CompositePK pk; 40 private CompositeContainer container; 41 42 @EmbeddedId 43 public CompositePK getPk() 44 { 45 return pk; 46 } 47 48 public void setPk(CompositePK pk) 49 { 50 this.pk = pk; 51 } 52 53 @ManyToOne(fetch=FetchType.EAGER) 54 @JoinColumn(name="id2", insertable=false, updatable=false) 55 public CompositeContainer getContainer() 56 { 57 return container; 58 } 59 60 public void setContainer(CompositeContainer container) 61 { 62 this.container = container; 63 } 64 } 65 | Popular Tags |