001: /**
002: * EasyBeans
003: * Copyright (C) 2006 Bull S.A.S.
004: * Contact: easybeans@ow2.org
005: *
006: * This library is free software; you can redistribute it and/or
007: * modify it under the terms of the GNU Lesser General Public
008: * License as published by the Free Software Foundation; either
009: * version 2.1 of the License, or any later version.
010: *
011: * This library is distributed in the hope that it will be useful,
012: * but WITHOUT ANY WARRANTY; without even the implied warranty of
013: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
014: * Lesser General Public License for more details.
015: *
016: * You should have received a copy of the GNU Lesser General Public
017: * License along with this library; if not, write to the Free Software
018: * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
019: * USA
020: *
021: * --------------------------------------------------------------------------
022: * $Id: Person.java 1970 2007-10-16 11:49:25Z benoitf $
023: * --------------------------------------------------------------------------
024: */package org.ow2.easybeans.tests.common.ejbs.entity.entitytest00;
025:
026: import java.io.Serializable;
027: import java.util.Date;
028:
029: import javax.persistence.DiscriminatorColumn;
030: import javax.persistence.DiscriminatorValue;
031: import javax.persistence.Entity;
032: import javax.persistence.GeneratedValue;
033: import javax.persistence.GenerationType;
034: import javax.persistence.Id;
035: import javax.persistence.Inheritance;
036: import javax.persistence.InheritanceType;
037: import javax.persistence.Lob;
038: import javax.persistence.Table;
039: import javax.persistence.TableGenerator;
040: import javax.persistence.Temporal;
041: import javax.persistence.TemporalType;
042:
043: /**
044: * Represents the common data among the diffent possitions.
045: * @author Gisele Pinheiro Souza
046: * @author Eduardo Studzinski Estima de Castro
047: *
048: */
049: @Entity
050: @Table(name="PERSON")
051: @DiscriminatorColumn(name="PersonType")
052: @DiscriminatorValue("Person")
053: @Inheritance(strategy=InheritanceType.SINGLE_TABLE)
054: @TableGenerator(name="PERSON_SEQ",allocationSize=2)
055: public class Person implements Serializable {
056:
057: /**
058: * Serial version.
059: */
060: private static final long serialVersionUID = -2588575691131751927L;
061:
062: /**
063: * The person identifier.
064: */
065: private Long id;
066:
067: /**
068: * The family name.
069: */
070: private String familyName;
071:
072: /**
073: * The first name.
074: */
075: private String firstName;
076:
077: /**
078: * The date fo admission.
079: */
080: private Date startDate;
081:
082: /**
083: * The date of depart.
084: */
085: private Date endDate;
086:
087: /**
088: * The picture.
089: */
090: private byte[] picture;
091:
092: /**
093: * Returns the depart date.
094: * @return the date.
095: */
096: @Temporal(TemporalType.DATE)
097: public Date getEndDate() {
098: return endDate;
099: }
100:
101: /**
102: * Sets the depart date.
103: * @param endDate the date.
104: */
105: public void setEndDate(final Date endDate) {
106: this .endDate = endDate;
107: }
108:
109: /**
110: * Returns the family name.
111: * @return the name.
112: */
113: public String getFamilyName() {
114: return familyName;
115: }
116:
117: /**
118: * Sets the family name.
119: * @param familyName the name.
120: */
121: public void setFamilyName(final String familyName) {
122: this .familyName = familyName;
123: }
124:
125: /**
126: * Returns the first name.
127: * @return the name.
128: */
129: public String getFirstName() {
130: return firstName;
131: }
132:
133: /**
134: * Sets the first name.
135: * @param firstName the name.
136: */
137: public void setFirstName(final String firstName) {
138: this .firstName = firstName;
139: }
140:
141: /**
142: * Returns the person identifier.
143: * @return the identifier.
144: */
145:
146: @Id
147: @GeneratedValue(strategy=GenerationType.TABLE,generator="PERSON_SEQ")
148: public Long getId() {
149: return id;
150: }
151:
152: /**
153: * Returns the admission date.
154: * @return the date.
155: */
156: @Temporal(TemporalType.DATE)
157: public Date getStartDate() {
158: return startDate;
159: }
160:
161: /**
162: * Sets the admission date.
163: * @param startDate the date.
164: */
165: public void setStartDate(final Date startDate) {
166: this .startDate = startDate;
167: }
168:
169: /**
170: * Returns the person picture.
171: * @return the picture.
172: */
173: @Lob
174: public byte[] getPicture() {
175: return picture;
176: }
177:
178: /**
179: * Sets the person picture.
180: * @param picture the picture.
181: */
182: public void setPicture(final byte[] picture) {
183: this .picture = picture;
184: }
185:
186: /**
187: * Sets the identifier.
188: * @param id the identifier.
189: */
190: public void setId(final Long id) {
191: this.id = id;
192: }
193:
194: }
|