KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > jboss > tutorial > clusteredentity > bean > Contact


1 /*
2  * JBoss, the OpenSource J2EE webOS
3  *
4  * Distributable under LGPL license.
5  * See terms of license at gnu.org.
6  */

7
8 package org.jboss.tutorial.clusteredentity.bean;
9
10 import java.io.Serializable JavaDoc;
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 /**
21  *
22  * @author <a HREF="mailto:kabir.khan@jboss.org">Kabir Khan</a>
23  * @version $Revision$
24  */

25 @Entity
26 @Cache (usage=CacheConcurrencyStrategy.TRANSACTIONAL)
27 public class Contact implements Serializable JavaDoc
28 {
29    Long JavaDoc id;
30    String JavaDoc name;
31    String JavaDoc tlf;
32    Customer customer;
33    
34    public Contact()
35    {
36       
37    }
38    
39    @Id(generate = GeneratorType.IDENTITY)
40    public Long JavaDoc getId()
41    {
42       return id;
43    }
44
45    public void setId(Long JavaDoc long1)
46    {
47       id = long1;
48    }
49
50    public String JavaDoc getName()
51    {
52       return name;
53    }
54    
55    public void setName(String JavaDoc name)
56    {
57       this.name = name;
58    }
59    
60    public String JavaDoc getTlf()
61    {
62       return tlf;
63    }
64    
65    public void setTlf(String JavaDoc 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