1 22 package org.jboss.ejb3.test.entity; 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.ManyToMany; 33 import javax.persistence.ManyToOne; 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 48 @Column(updatable = false, name = "flight_name", nullable = false, length = 50) 49 String name; 50 51 @Basic(fetch = FetchType.LAZY) 52 long duration; 53 54 @Transient 55 long durationInSec; 56 57 @Version 58 @Column(name = "OPTLOCK") 59 Integer version; 60 61 @ManyToOne(cascade = {CascadeType.PERSIST, CascadeType.MERGE}) 62 @JoinColumn(name = "COMP_ID") 63 FieldCompany company; 64 65 @ManyToMany(cascade = {CascadeType.PERSIST, CascadeType.MERGE}, fetch = FetchType.EAGER) 66 Set <FieldCustomer> customers; 67 68 public Long getId() 69 { 70 return id; 71 } 72 73 public void setId(Long long1) 74 { 75 id = long1; 76 } 77 78 public String getName() 79 { 80 return name; 81 } 82 83 public void setName(String string) 84 { 85 name = string; 86 } 87 88 public long getDuration() 89 { 90 return duration; 91 } 92 93 public void setDuration(long l) 94 { 95 duration = l; 96 } 97 98 public long getDurationInSec() 99 { 100 return durationInSec; 101 } 102 103 public void setDurationInSec(long l) 104 { 105 durationInSec = l; 106 } 107 108 public Integer getVersion() 109 { 110 return version; 111 } 112 113 public void setVersion(Integer i) 114 { 115 version = i; 116 } 117 118 public FieldCompany getCompany() 119 { 120 return company; 121 } 122 123 public void setCompany(FieldCompany company) 124 { 125 this.company = company; 126 } 127 128 public Set <FieldCustomer> getCustomers() 129 { 130 return customers; 131 } 132 133 public void setCustomers(Set <FieldCustomer> customers) 134 { 135 this.customers = customers; 136 } 137 } 138 | Popular Tags |