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.secondary;
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.JoinColumn;
030: import javax.persistence.SecondaryTable;
031:
032: /**
033: * Company customer
034: *
035: * @author Emmanuel Bernard
036: */
037: @Entity
038: @SecondaryTable(name="EMBEDDED_ADDRESS")
039: public class Customer implements java.io.Serializable {
040: Long id;
041: String name;
042: String street;
043: String city;
044: String state;
045: String zip;
046:
047: public Customer() {
048: }
049:
050: @Id
051: @GeneratedValue(strategy=GenerationType.IDENTITY)
052: public Long getId() {
053: return id;
054: }
055:
056: public String getName() {
057: return name;
058: }
059:
060: public void setId(Long long1) {
061: id = long1;
062: }
063:
064: public void setName(String string) {
065: name = string;
066: }
067:
068: @Column(name="street",table="EMBEDDED_ADDRESS")
069: public String getStreet() {
070: return street;
071: }
072:
073: public void setStreet(String street) {
074: this .street = street;
075: }
076:
077: @Column(name="city",table="EMBEDDED_ADDRESS")
078: public String getCity() {
079: return city;
080: }
081:
082: public void setCity(String city) {
083: this .city = city;
084: }
085:
086: @Column(name="state",table="EMBEDDED_ADDRESS")
087: public String getState() {
088: return state;
089: }
090:
091: public void setState(String state) {
092: this .state = state;
093: }
094:
095: @Column(name="zip",table="EMBEDDED_ADDRESS")
096: public String getZip() {
097: return zip;
098: }
099:
100: public void setZip(String zip) {
101: this.zip = zip;
102: }
103:
104: }
|