KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > jboss > ejb3 > test > pkg > 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.pkg;
23
24 import javax.persistence.Column;
25 import javax.persistence.Entity;
26 import javax.persistence.GeneratedValue;
27 import javax.persistence.GenerationType;
28 import javax.persistence.Id;
29 import javax.persistence.NamedQuery;
30 import javax.persistence.SecondaryTable;
31
32 /**
33  * Company customer
34  *
35  * @author Emmanuel Bernard
36  */

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