1 22 package org.jboss.ejb3.test.clusteredentity; 23 24 import java.io.Serializable ; 25 import javax.persistence.Entity; 26 import javax.persistence.Id; 27 import javax.persistence.JoinColumn; 28 import javax.persistence.ManyToOne; 29 30 import org.hibernate.annotations.Cache; 31 import org.hibernate.annotations.CacheConcurrencyStrategy; 32 33 38 @Entity 39 @Cache (usage=CacheConcurrencyStrategy.TRANSACTIONAL) 40 public class Contact implements Serializable 41 { 42 Integer id; 43 String name; 44 String tlf; 45 Customer customer; 46 47 public Contact() 48 { 49 50 } 51 52 @Id 53 public Integer getId() 54 { 55 return id; 56 } 57 58 public void setId(Integer id) 59 { 60 this.id = id; 61 } 62 63 public String getName() 64 { 65 return name; 66 } 67 68 public void setName(String name) 69 { 70 this.name = name; 71 } 72 73 public String getTlf() 74 { 75 return tlf; 76 } 77 78 public void setTlf(String tlf) 79 { 80 this.tlf = tlf; 81 } 82 83 @ManyToOne 84 @JoinColumn(name="CUST_ID") 85 public Customer getCustomer() 86 { 87 return customer; 88 } 89 90 public void setCustomer(Customer customer) 91 { 92 this.customer = customer; 93 } 94 95 } 96 | Popular Tags |