1 25 package org.objectweb.easybeans.tests.common.ejbs.entity.customer; 26 27 import java.io.Serializable ; 28 import java.util.List ; 29 30 import javax.persistence.CascadeType; 31 import javax.persistence.Entity; 32 import javax.persistence.Id; 33 import javax.persistence.OneToMany; 34 import javax.persistence.OneToOne; 35 36 42 @Entity 43 public class Customer implements Serializable { 44 45 48 private static final long serialVersionUID = -5935600735100590395L; 49 50 53 private long id; 54 55 58 private String name; 59 60 63 private List <ProductOrder> orders; 64 65 68 private Address address; 69 70 74 @OneToOne(cascade = CascadeType.PERSIST) 75 public Address getAddress() { 76 return address; 77 } 78 79 83 public void setAddress(final Address address) { 84 this.address = address; 85 } 86 87 91 @Id 92 public long getId() { 93 return id; 94 } 95 96 100 public void setId(final long id) { 101 this.id = id; 102 } 103 104 108 public String getName() { 109 return name; 110 } 111 112 116 public void setName(final String name) { 117 this.name = name; 118 } 119 120 124 @OneToMany(cascade = CascadeType.MERGE) 125 public List <ProductOrder> getOrders() { 126 return orders; 127 } 128 129 133 public void setOrders(final List <ProductOrder> orders) { 134 this.orders = orders; 135 } 136 137 } 138 | Popular Tags |