1 7 8 package org.jboss.tutorial.clusteredentity.bean; 9 10 import java.io.Serializable ; 11 import javax.persistence.Entity; 12 import javax.persistence.GeneratorType; 13 import javax.persistence.Id; 14 import javax.persistence.JoinColumn; 15 import javax.persistence.ManyToOne; 16 17 import org.hibernate.annotations.Cache; 18 import org.hibernate.annotations.CacheConcurrencyStrategy; 19 20 25 @Entity 26 @Cache (usage=CacheConcurrencyStrategy.TRANSACTIONAL) 27 public class Contact implements Serializable 28 { 29 Long id; 30 String name; 31 String tlf; 32 Customer customer; 33 34 public Contact() 35 { 36 37 } 38 39 @Id(generate = GeneratorType.IDENTITY) 40 public Long getId() 41 { 42 return id; 43 } 44 45 public void setId(Long long1) 46 { 47 id = long1; 48 } 49 50 public String getName() 51 { 52 return name; 53 } 54 55 public void setName(String name) 56 { 57 this.name = name; 58 } 59 60 public String getTlf() 61 { 62 return tlf; 63 } 64 65 public void setTlf(String tlf) 66 { 67 this.tlf = tlf; 68 } 69 70 @ManyToOne 71 @JoinColumn(name="CUST_ID") 72 public Customer getCustomer() 73 { 74 return customer; 75 } 76 77 public void setCustomer(Customer customer) 78 { 79 this.customer = customer; 80 } 81 82 } 83 | Popular Tags |