001: /*
002: * JBoss, Home of Professional Open Source.
003: * Copyright 2006, Red Hat Middleware LLC, and individual contributors
004: * as indicated by the @author tags. See the copyright.txt file in the
005: * distribution for a full listing of individual contributors.
006: *
007: * This is free software; you can redistribute it and/or modify it
008: * under the terms of the GNU Lesser General Public License as
009: * published by the Free Software Foundation; either version 2.1 of
010: * the License, or (at your option) any later version.
011: *
012: * This software is distributed in the hope that it will be useful,
013: * but WITHOUT ANY WARRANTY; without even the implied warranty of
014: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
015: * Lesser General Public License for more details.
016: *
017: * You should have received a copy of the GNU Lesser General Public
018: * License along with this software; if not, write to the Free
019: * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
020: * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
021: */
022: package org.jboss.ejb3.test.pkg;
023:
024: import javax.persistence.Column;
025: import javax.persistence.Entity;
026: import javax.persistence.GeneratedValue;
027: import javax.persistence.GenerationType;
028: import javax.persistence.Id;
029: import javax.persistence.NamedQuery;
030: import javax.persistence.SecondaryTable;
031:
032: /**
033: * Company customer
034: *
035: * @author Emmanuel Bernard
036: */
037: @Entity
038: @SecondaryTable(name="EMBEDDED_ADDRESS")
039: @NamedQuery(name="customerById",query="from Customer c where c.id = :id")
040: public class Customer implements java.io.Serializable {
041: Long id;
042: String name;
043: String street;
044: String city;
045: String state;
046: String zip;
047:
048: public Customer() {
049: }
050:
051: @Id
052: @GeneratedValue(strategy=GenerationType.IDENTITY)
053: public Long getId() {
054: return id;
055: }
056:
057: public String getName() {
058: return name;
059: }
060:
061: public void setId(Long long1) {
062: id = long1;
063: }
064:
065: public void setName(String string) {
066: name = string;
067: }
068:
069: @Column(name="street",table="EMBEDDED_ADDRESS")
070: public String getStreet() {
071: return street;
072: }
073:
074: public void setStreet(String street) {
075: this .street = street;
076: }
077:
078: @Column(name="city",table="EMBEDDED_ADDRESS")
079: public String getCity() {
080: return city;
081: }
082:
083: public void setCity(String city) {
084: this .city = city;
085: }
086:
087: @Column(name="state",table="EMBEDDED_ADDRESS")
088: public String getState() {
089: return state;
090: }
091:
092: public void setState(String state) {
093: this .state = state;
094: }
095:
096: @Column(name="zip",table="EMBEDDED_ADDRESS")
097: public String getZip() {
098: return zip;
099: }
100:
101: public void setZip(String zip) {
102: this.zip = zip;
103: }
104:
105: }
|