Source Code Cross Referenced for Project.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 fmillevi@yahoo.com
022:         *  
023:         */
024:        package org.objectweb.speedo.j2eedo.database;
025:
026:        import java.math.BigDecimal;
027:        import java.util.ArrayList;
028:        import java.util.Collection;
029:        import java.util.Iterator;
030:
031:        /**
032:         * This class define the Java class to access to the project's data
033:         * @author fmillevi@yahoo.com
034:         *  
035:         */
036:        public class Project implements  DatabaseObjectInterface {
037:            private long proid;
038:            private String name;
039:            private BigDecimal budget;
040:            private Collection members; //element:Employee
041:            private Department department;
042:
043:            /**
044:             * @param name
045:             * @param department
046:             */
047:            public Project(String name, Department department) {
048:                super ();
049:                this .name = name;
050:                this .department = department;
051:                this .members = new ArrayList();
052:            }
053:
054:            /**
055:             * Empty constructor
056:             */
057:            public Project() {
058:                super ();
059:            }
060:
061:            public String getAsString() {
062:                StringBuffer sb = new StringBuffer();
063:                sb.append("\nProject (proid:").append(proid);
064:                sb.append(" department:");
065:                if (this .department != null) {
066:                    sb.append(this .department.getName());
067:                } else {
068:                    sb.append("is null");
069:                }
070:                sb.append(")\n\tName:").append(name);
071:                sb.append("\n\tbudget:").append(budget);
072:                if (null != this .members) {
073:                    Iterator i = this .members.iterator();
074:                    if (i.hasNext())
075:                        sb.append("\n\tMembers:");
076:                    Employee e = null;
077:                    while (i.hasNext()) {
078:                        e = (Employee) i.next();
079:                        sb.append(e.getFirstname()).append(" ");
080:                        sb.append(e.getLastname()).append("  ");
081:                    }
082:                }
083:                return sb.toString();
084:            }
085:
086:            /**
087:             * @see org.objectweb.speedo.j2eedo.database.DatabaseObjectInterface#getId()
088:             */
089:            public long getId() {
090:                return this .proid;
091:            }
092:
093:            /**
094:             * @return Returns the budget.
095:             */
096:            public BigDecimal getBudget() {
097:                return budget;
098:            }
099:
100:            /**
101:             * @param budget
102:             *            The budget to set.
103:             */
104:            public void setBudget(BigDecimal budget) {
105:                this .budget = budget;
106:            }
107:
108:            /**
109:             * @return Returns the members.
110:             */
111:            public Collection getMembers() {
112:                return members;
113:            }
114:
115:            /**
116:             * @param members
117:             *            The members to set.
118:             */
119:            public void setMembers(Collection members) {
120:                this .members.addAll(members);
121:            }
122:
123:            /**
124:             * @param newEmployee
125:             */
126:            public boolean addMember(Employee newEmployee) {
127:                if (!members.contains(newEmployee)) {
128:                    this .members.add(newEmployee);
129:                    return true;
130:                } else {
131:                    return false;
132:                }
133:            }
134:
135:            /**
136:             * @param newEmployee
137:             */
138:            public void removeMember(Employee newEmployee) {
139:                this .members.remove(newEmployee);
140:            }
141:
142:            /**
143:             * @return Returns the name.
144:             */
145:            public String getName() {
146:                return name;
147:            }
148:
149:            /**
150:             * @param name
151:             *            The name to set.
152:             */
153:            public void setName(String name) {
154:                this .name = name;
155:            }
156:
157:            /**
158:             * @return Returns the proid.
159:             */
160:            public long getProid() {
161:                return proid;
162:            }
163:
164:            /**
165:             * @return Returns the department.
166:             */
167:            public Department getDepartment() {
168:                return department;
169:            }
170:
171:            /**
172:             * @param department
173:             *            The department to set.
174:             */
175:            public void setDepartment(Department department) {
176:                this.department = department;
177:            }
178:
179:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.