Source Code Cross Referenced for Employee.java in  » Database-ORM » Speedo_1.4.5 » org » objectweb » speedo » j2eedo » database » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » Database ORM » Speedo_1.4.5 » org.objectweb.speedo.j2eedo.database 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /*
002:         * Speedo: an implementation of JDO compliant personality on top of JORM
003:         * generic I/O sub-system. Copyright (C) 2001-2004 France Telecom R&D
004:         * 
005:         * This library is free software; you can redistribute it and/or modify it
006:         * under the terms of the GNU Lesser General Public License as published by the
007:         * Free Software Foundation; either version 2 of the License, or (at your
008:         * option) any later version.
009:         * 
010:         * This library is distributed in the hope that it will be useful, but WITHOUT
011:         * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
012:         * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License
013:         * for more details.
014:         * 
015:         * You should have received a copy of the GNU Lesser General Public License
016:         * along with this library; if not, write to the Free Software Foundation,
017:         * Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
018:         * 
019:         * Release: 1.0
020:         * 
021:         * Created on 27 feb. 2004 @author franck.milleville@cgey.com
022:         *  
023:         */
024:        package org.objectweb.speedo.j2eedo.database;
025:
026:        import java.util.Collection;
027:        import java.util.Date;
028:        import java.util.Iterator;
029:
030:        /**
031:         * This class define the Java class to access to the employee's data
032:         * @author franck.milleville @cgey.com
033:         *  
034:         */
035:        public class Employee implements  DatabaseObjectInterface {
036:            private long empid;
037:            private String firstname;
038:            private String lastname;
039:            private Address address;
040:            private Date birthdate;
041:            private Date hiredate;
042:            private float salary;
043:            private Department department;
044:            private Employee manager;
045:            private Collection slaves;
046:            private Collection projects; //element:Project
047:
048:            /**
049:             * @param firstname
050:             * @param lastname
051:             * @param birthdate
052:             * @param department
053:             */
054:            public Employee(String firstname, String lastname, Date birthdate,
055:                    Department department) {
056:                super ();
057:                this .firstname = firstname;
058:                this .lastname = lastname;
059:                this .birthdate = birthdate;
060:                this .department = department;
061:                this .hiredate = new Date();
062:            }
063:
064:            /**
065:             * @param firstname
066:             * @param lastname
067:             * @param address
068:             * @param birthdate
069:             * @param hiredate
070:             * @param salary
071:             * @param department
072:             * @param manager
073:             * @param projects
074:             */
075:            public Employee(String firstname, String lastname, Address address,
076:                    Date birthdate, Date hiredate, float salary,
077:                    Department department, Employee manager, Collection projects) {
078:                super ();
079:                this .firstname = firstname;
080:                this .lastname = lastname;
081:                this .address = address;
082:                this .birthdate = birthdate;
083:                this .hiredate = hiredate;
084:                this .salary = salary;
085:                this .department = department;
086:                this .manager = manager;
087:                this .projects = projects;
088:            }
089:
090:            /**
091:             * Empty constructor
092:             */
093:            public Employee() {
094:                super ();
095:            }
096:
097:            public String getAsString() {
098:                StringBuffer sb = new StringBuffer();
099:                sb.append("\nEmployee\t(empid:").append(this .empid);
100:                sb.append(" department:").append(this .department.getName());
101:                sb.append(")\n\tFirst name:").append(this .firstname);
102:                sb.append("\tlast name:").append(this .lastname);
103:                sb.append("\tbirthdate:").append(this .birthdate);
104:                sb.append("\tmanager:");
105:                if (null != this .manager)
106:                    sb.append(this .manager.getLastname());
107:                else
108:                    sb.append("No manager");
109:                sb.append("\tsalary:").append(this .salary);
110:                sb.append("\thire date:").append(this .hiredate);
111:                sb.append("\n\tadsress:").append(this .address.getAsString());
112:                if (this .projects != null) {
113:                    Iterator i = projects.iterator();
114:                    if (i.hasNext()) {
115:                        sb.append("\tMember of projects:");
116:                    }
117:                    while (i.hasNext()) {
118:                        sb.append(((Project) i.next()).getName()).append(" ");
119:                    }
120:                }
121:                return sb.toString();
122:            }
123:
124:            /**
125:             * @see org.objectweb.speedo.j2eedo.database.DatabaseObjectInterface#getId()
126:             */
127:            public long getId() {
128:                return this .empid;
129:            }
130:
131:            /**
132:             * @return Returns the empid.
133:             */
134:            public long getEmpid() {
135:                return empid;
136:            }
137:
138:            /**
139:             * @return Returns the hiredate.
140:             */
141:            public Date getHiredate() {
142:                return hiredate;
143:            }
144:
145:            /**
146:             * @param hiredate
147:             *            The hiredate to set.
148:             */
149:            public void setHiredate(Date hiredate) {
150:                this .hiredate = hiredate;
151:            }
152:
153:            /**
154:             * @return Returns the lastname.
155:             */
156:            public String getLastname() {
157:                return lastname;
158:            }
159:
160:            /**
161:             * @param lastname
162:             *            The lastname to set.
163:             */
164:            public void setLastname(String lastname) {
165:                this .lastname = lastname;
166:            }
167:
168:            /**
169:             * @return Returns the manager.
170:             */
171:            public Employee getManager() {
172:                return manager;
173:            }
174:
175:            /**
176:             * @param manager
177:             *            The manager to set.
178:             */
179:            public void setManager(Employee manager) {
180:                this .manager = manager;
181:            }
182:
183:            /**
184:             * @return Returns the projects.
185:             */
186:            public Collection getProjects() {
187:                return projects;
188:            }
189:
190:            /**
191:             * @param projects
192:             *            The projects to set.
193:             */
194:            public void setProjects(Collection projects) {
195:                this .projects.addAll(projects);
196:            }
197:
198:            /**
199:             * @return Returns the salary.
200:             */
201:            public float getSalary() {
202:                return salary;
203:            }
204:
205:            /**
206:             * @param salary
207:             *            The salary to set.
208:             */
209:            public void setSalary(float salary) {
210:                this .salary = salary;
211:            }
212:
213:            /**
214:             * @return Returns the address.
215:             */
216:            public Address getAddress() {
217:                return address;
218:            }
219:
220:            /**
221:             * @param address
222:             *            The address to set.
223:             */
224:            public void setAddress(Address address) {
225:                this .address = address;
226:            }
227:
228:            /**
229:             * @return Returns the birthdate.
230:             */
231:            public Date getBirthdate() {
232:                return birthdate;
233:            }
234:
235:            /**
236:             * @param birthdate
237:             *            The birthdate to set.
238:             */
239:            public void setBirthdate(Date birthdate) {
240:                this .birthdate = birthdate;
241:            }
242:
243:            /**
244:             * @return Returns the department.
245:             */
246:            public Department getDepartment() {
247:                return department;
248:            }
249:
250:            /**
251:             * @param department
252:             *            The department to set.
253:             */
254:            public void setDepartment(Department department) {
255:                this .department = department;
256:            }
257:
258:            /**
259:             * @return Returns the firstname.
260:             */
261:            public String getFirstname() {
262:                return firstname;
263:            }
264:
265:            /**
266:             * @param firstname
267:             *            The firstname to set.
268:             */
269:            public void setFirstname(String firstname) {
270:                this.firstname = firstname;
271:            }
272:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.