1 22 package org.jboss.ejb3.test.composite; 23 24 import java.util.Set ; 25 import javax.persistence.CascadeType; 26 import javax.persistence.EmbeddedId; 27 import javax.persistence.Entity; 28 import javax.persistence.FetchType; 29 import javax.persistence.ManyToMany; 30 import javax.persistence.OneToMany; 31 32 35 @Entity 36 public class FieldCustomer implements java.io.Serializable 37 { 38 @EmbeddedId 39 FieldCustomerPK pk; 40 41 @OneToMany(cascade = CascadeType.ALL, fetch = FetchType.EAGER, mappedBy="customer") 42 Set <FieldTicket> tickets; 43 44 @ManyToMany(cascade = {CascadeType.PERSIST, CascadeType.MERGE}, fetch = FetchType.EAGER, mappedBy="customers") 45 Set <FieldFlight> flights; 46 47 public FieldCustomer() 48 { 49 } 50 51 public FieldCustomerPK getPk() 52 { 53 return pk; 54 } 55 56 public void setPk(FieldCustomerPK pk) 57 { 58 this.pk = pk; 59 } 60 61 public String getName() 62 { 63 return pk.name; 64 } 65 66 public Set <FieldTicket> getTickets() 67 { 68 return tickets; 69 } 70 71 public void setTickets(Set <FieldTicket> tickets) 72 { 73 this.tickets = tickets; 74 } 75 76 public Set <FieldFlight> getFlights() 77 { 78 return flights; 79 } 80 81 public void setFlights(Set <FieldFlight> flights) 82 { 83 this.flights = flights; 84 } 85 86 87 } 88 89 | Popular Tags |