KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > jboss > ejb3 > test > xmlcfg > Customer


1 /*
2   * JBoss, Home of Professional Open Source
3   * Copyright 2005, JBoss Inc., and individual contributors as indicated
4   * by the @authors tag. See the copyright.txt in the distribution for a
5   * full listing of individual contributors.
6   *
7   * This is free software; you can redistribute it and/or modify it
8   * under the terms of the GNU Lesser General Public License as
9   * published by the Free Software Foundation; either version 2.1 of
10   * the License, or (at your option) any later version.
11   *
12   * This software is distributed in the hope that it will be useful,
13   * but WITHOUT ANY WARRANTY; without even the implied warranty of
14   * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15   * Lesser General Public License for more details.
16   *
17   * You should have received a copy of the GNU Lesser General Public
18   * License along with this software; if not, write to the Free
19   * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
20   * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
21   */

22 package org.jboss.ejb3.test.xmlcfg;
23
24 import javax.persistence.Column;
25 import javax.persistence.Entity;
26 import javax.persistence.GeneratedValue; import javax.persistence.GenerationType;
27 import javax.persistence.Id;
28 import javax.persistence.JoinColumn;
29 import javax.persistence.SecondaryTable;
30
31 /**
32  * Company customer
33  *
34  * @author Emmanuel Bernard
35  */

36 @Entity
37 @SecondaryTable(name = "EMBEDDED_ADDRESS")
38 public class Customer implements java.io.Serializable JavaDoc
39 {
40    Long JavaDoc id;
41    String JavaDoc name;
42    String JavaDoc street;
43    String JavaDoc city;
44    String JavaDoc state;
45    String JavaDoc zip;
46
47    public
48    Customer()
49    {
50    }
51
52    @Id @GeneratedValue(strategy=GenerationType.IDENTITY)
53    public
54    Long JavaDoc getId()
55    {
56       return id;
57    }
58
59    public
60    String JavaDoc getName()
61    {
62       return name;
63    }
64
65    public
66    void setId(Long JavaDoc long1)
67    {
68       id = long1;
69    }
70
71    public
72    void setName(String JavaDoc string)
73    {
74       name = string;
75    }
76
77    @Column(name = "street", table = "EMBEDDED_ADDRESS")
78    public String JavaDoc getStreet()
79    {
80       return street;
81    }
82
83    public void setStreet(String JavaDoc street)
84    {
85       this.street = street;
86    }
87
88    @Column(name = "city", table = "EMBEDDED_ADDRESS")
89    public String JavaDoc getCity()
90    {
91       return city;
92    }
93
94    public void setCity(String JavaDoc city)
95    {
96       this.city = city;
97    }
98
99    @Column(name = "state", table = "EMBEDDED_ADDRESS")
100    public String JavaDoc getState()
101    {
102       return state;
103    }
104
105    public void setState(String JavaDoc state)
106    {
107       this.state = state;
108    }
109
110    @Column(name = "zip", table = "EMBEDDED_ADDRESS")
111    public String JavaDoc getZip()
112    {
113       return zip;
114    }
115
116    public void setZip(String JavaDoc zip)
117    {
118       this.zip = zip;
119    }
120
121 }
122
123
Popular Tags