1 22 package org.jboss.ejb3.test.composite; 23 24 import java.util.Set ; 25 import javax.persistence.Basic; 26 import javax.persistence.CascadeType; 27 import javax.persistence.Column; 28 import javax.persistence.Entity; 29 import javax.persistence.FetchType; 30 import javax.persistence.Id; 31 import javax.persistence.JoinColumn; 32 import javax.persistence.JoinTable; 33 import javax.persistence.ManyToMany; 34 import javax.persistence.Transient; 35 import javax.persistence.Version; 36 37 42 @Entity 43 public class FieldFlight implements java.io.Serializable 44 { 45 @Id 46 Long id; 47 @Column(updatable = false, name = "flight_name", nullable = false, length = 50) 48 String name; 49 50 @Basic(fetch = FetchType.LAZY) 51 long duration; 52 53 @Transient 54 long durationInSec; 55 56 @Version 57 @Column(name = "OPTLOCK") 58 Integer version; 59 60 @ManyToMany(cascade = {CascadeType.PERSIST, CascadeType.MERGE}, fetch = FetchType.EAGER) 61 @JoinTable(name = "field_flight_customer_table", 62 joinColumns = {@JoinColumn(name = "FLIGHT_ID")}, 63 inverseJoinColumns = {@JoinColumn(name = "CUSTOMER_ID"), @JoinColumn(name = "CUSTOMER_NAME")}) 64 Set <FieldCustomer> customers; 65 66 public Long getId() 67 { 68 return id; 69 } 70 71 public void setId(Long long1) 72 { 73 id = long1; 74 } 75 76 public String getName() 77 { 78 return name; 79 } 80 81 public void setName(String string) 82 { 83 name = string; 84 } 85 86 public long getDuration() 87 { 88 return duration; 89 } 90 91 public void setDuration(long l) 92 { 93 duration = l; 94 } 96 97 public long getDurationInSec() 98 { 99 return durationInSec; 100 } 101 102 public void setDurationInSec(long l) 103 { 104 durationInSec = l; 105 } 106 107 public Integer getVersion() 108 { 109 return version; 110 } 111 112 public void setVersion(Integer i) 113 { 114 version = i; 115 } 116 117 public Set <FieldCustomer> getCustomers() 118 { 119 return customers; 120 } 121 122 public void setCustomers(Set <FieldCustomer> customers) 123 { 124 this.customers = customers; 125 } 126 } 127 | Popular Tags |