KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > objectweb > easybeans > tests > common > ejbs > entity > entitytest00 > Technician


1 /**
2  * EasyBeans
3  * Copyright (C) 2006 Bull S.A.S.
4  * Contact: easybeans@objectweb.org
5  *
6  * This library is free software; you can redistribute it and/or
7  * modify it under the terms of the GNU Lesser General Public
8  * License as published by the Free Software Foundation; either
9  * version 2.1 of the License, or any later version.
10  *
11  * This library is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14  * Lesser General Public License for more details.
15  *
16  * You should have received a copy of the GNU Lesser General Public
17  * License along with this library; if not, write to the Free Software
18  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
19  * USA
20  *
21  * --------------------------------------------------------------------------
22  * $Id: Technician.java 975 2006-07-28 11:14:14Z pinheirg $
23  * --------------------------------------------------------------------------
24  */

25 package org.objectweb.easybeans.tests.common.ejbs.entity.entitytest00;
26
27 import javax.persistence.DiscriminatorValue;
28 import javax.persistence.Embedded;
29 import javax.persistence.Entity;
30 import javax.persistence.EnumType;
31 import javax.persistence.Enumerated;
32 import javax.persistence.SecondaryTable;
33 import javax.persistence.SecondaryTables;
34 import javax.persistence.Transient;
35
36 /**
37  * The technician.
38  * @author Gisele Pinheiro Souza
39  * @author Eduardo Studzinski Estima de Castro
40  *
41  */

42 @Entity
43 @DiscriminatorValue("technician")
44 @SecondaryTables({@SecondaryTable(name = "technicianDetails"), @SecondaryTable(name = "bankingData")})
45 public class Technician extends Person {
46
47     /**
48      * Serial version.
49      */

50     private static final long serialVersionUID = -1732670933017289750L;
51
52     /**
53      * The type of contract.
54      * @author Gisele Pinheiro Souza
55      * @author Eduardo Studzinski Estima de Castro
56      *
57      */

58     public enum ContractType {CDD, CDI, INTERNSHIP}
59
60     /**
61      * The current work place.
62      */

63     private String JavaDoc place;
64
65     /**
66      * The contratc type.
67      */

68     private ContractType contract;
69
70     /**
71      * The telephone number.
72      */

73     private Telephone phone;
74
75
76     /**
77      * Returns the telephone number.
78      * @return the telephone.
79      */

80     @Embedded
81     public Telephone getPhone() {
82         return phone;
83     }
84
85     /**
86      * Sets the telephone number.
87      * @param phone the phone number.
88      */

89     public void setPhone(final Telephone phone) {
90         this.phone = phone;
91     }
92     /**
93      * Returns the contract type.
94      * @return the contract type.
95      */

96     @Enumerated(EnumType.ORDINAL)
97     public ContractType getContract() {
98         return contract;
99     }
100
101     /**
102      * Sets the contract type.
103      * @param contract the contract type.
104      */

105     public void setContract(final ContractType contract) {
106         this.contract = contract;
107     }
108
109     /**
110      * Returns the current work place.
111      * @return the work place.
112      */

113     @Transient
114     public String JavaDoc getPlace() {
115         return place;
116     }
117
118     /**
119      * Sets the current work place.
120      * @param place the work place.
121      */

122     public void setPlace(final String JavaDoc place) {
123         this.place = place;
124     }
125
126 }
127
Popular Tags