Source Code Cross Referenced for Person.java in  » Database-ORM » tro-community-7.2-1 » discRack » business » person » 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 » tro community 7.2 1 » discRack.business.person 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /*
002:         * Enhydra Java Application Server Project
003:         *
004:         * The contents of this file are subject to the Enhydra Public License
005:         * Version 1.1 (the "License"); you may not use this file except in
006:         * compliance with the License. You may obtain a copy of the License on
007:         * the Enhydra web site ( http://www.enhydra.org/ ).
008:         *
009:         * Software distributed under the License is distributed on an "AS IS"
010:         * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
011:         * the License for the specific terms governing rights and limitations
012:         * under the License.
013:         *
014:         * The Initial Developer of the Enhydra Application Server is Lutris
015:         * Technologies, Inc. The Enhydra Application Server and portions created
016:         * by Lutris Technologies, Inc. are Copyright Lutris Technologies, Inc.
017:         * All Rights Reserved.
018:         *
019:         * Contributor(s):
020:         *
021:         * $Id: Person.java,v 1.1 2004/09/03 13:41:25 sinisa Exp $
022:         */
023:
024:        package discRack.business.person;
025:
026:        import discRack.business.DiscRackBusinessException;
027:        import discRack.data.person.*;
028:        import discRack.data.disc.DiscDO;
029:        import discRack.business.disc.Disc;
030:        import com.lutris.appserver.server.sql.DatabaseManagerException;
031:        import com.lutris.appserver.server.sql.ObjectIdException;
032:        import com.lutris.dods.builder.generator.query.DataObjectException;
033:        import org.enhydra.dods.exceptions.AssertionDataObjectException;
034:
035:        /**
036:         * Represents a person.
037:         */
038:        public class Person {
039:            /**
040:             * The DO of the Person.
041:             */
042:            protected PersonDO myDO = null;
043:
044:            /**
045:             * The public constructor.
046:             */
047:            public Person() throws DiscRackBusinessException {
048:                try {
049:                    this .myDO = PersonDO.createVirgin();
050:                } catch (DatabaseManagerException ex) {
051:                    throw new DiscRackBusinessException(
052:                            "Error creating empty person", ex);
053:                } catch (ObjectIdException ex) {
054:                    throw new DiscRackBusinessException(
055:                            "Error creating object ID for person", ex);
056:                }
057:            }
058:
059:            /** The public constructor
060:             *
061:             * @param thePerson. The data object of the person.
062:             */
063:            public Person(PersonDO thePerson) {
064:                this .myDO = thePerson;
065:            }
066:
067:            /**
068:             * Gets the object id for the person
069:             *
070:             * @return the object id.
071:             * @exception DiscRackBusinessException if an error occurs
072:             *   retrieving data (usually due to an underlying data layer
073:             *   error).
074:             */
075:            public String getHandle() throws DiscRackBusinessException {
076:                try {
077:                    return this .myDO.getHandle();
078:                } catch (DatabaseManagerException ex) {
079:                    throw new DiscRackBusinessException(
080:                            "Error getting handle for person", ex);
081:                }
082:            }
083:
084:            /**
085:             * Gets the login name for the person
086:             *
087:             * @return the login name.
088:             * @exception DiscRackBusinessException if an error occurs
089:             *   retrieving data (usually due to an underlying data layer
090:             *   error).
091:             */
092:            public String getLogin() throws DiscRackBusinessException {
093:                try {
094:                    return myDO.getLogin();
095:                } catch (DataObjectException ex) {
096:                    throw new DiscRackBusinessException(
097:                            "Error getting user's login name", ex);
098:                }
099:            }
100:
101:            /**
102:             * Gets the password for the person
103:             *
104:             * @return the password.
105:             * @exception DiscRackBusinessException if an error occurs
106:             *   retrieving data (usually due to an underlying data layer
107:             *   error).
108:             */
109:            public String getPassword() throws DiscRackBusinessException {
110:                try {
111:                    return myDO.getPassword();
112:                } catch (DataObjectException ex) {
113:                    throw new DiscRackBusinessException(
114:                            "Error getting user's password", ex);
115:                }
116:            }
117:
118:            /**
119:             * Gets the firstname for the person
120:             *
121:             * @return the firstname.
122:             * @exception DiscRackBusinessException if an error occurs
123:             *   retrieving data (usually due to an underlying data layer
124:             *   error).
125:             */
126:            public String getFirstname() throws DiscRackBusinessException {
127:                try {
128:                    return myDO.getFirstname();
129:                } catch (DataObjectException ex) {
130:                    throw new DiscRackBusinessException(
131:                            "Error getting user's first name", ex);
132:                }
133:            }
134:
135:            /**
136:             * Gets the lastname for the person
137:             *
138:             * @return the lastname.
139:             * @exception DiscRackBusinessException if an error occurs
140:             *   retrieving data (usually due to an underlying data layer
141:             *   error).
142:             */
143:            public String getLastname() throws DiscRackBusinessException {
144:                try {
145:                    return myDO.getLastname();
146:                } catch (DataObjectException ex) {
147:                    throw new DiscRackBusinessException(
148:                            "Error getting user's last name", ex);
149:                }
150:            }
151:
152:            /**
153:             * Sets the login name for the person.
154:             *
155:             * @param the login name.
156:             * @exception DiscRackBusinessException if an error occurs
157:             *   setting the data (usually due to an underlying data layer
158:             *   error).
159:             */
160:            public void setLogin(String login) throws DiscRackBusinessException {
161:                try {
162:                    myDO.setLogin(login);
163:                } catch (DataObjectException ex) {
164:                    throw new DiscRackBusinessException(
165:                            "Error setting user's login name", ex);
166:                }
167:            }
168:
169:            /**
170:             * Sets the password for the person.
171:             *
172:             * @param the password.
173:             * @exception DiscRackBusinessException if an error occurs
174:             *   setting the data (usually due to an underlying data layer
175:             *   error).
176:             */
177:            public void setPassword(String password)
178:                    throws DiscRackBusinessException {
179:                try {
180:                    myDO.setPassword(password);
181:                } catch (DataObjectException ex) {
182:                    throw new DiscRackBusinessException(
183:                            "Error setting user's password", ex);
184:                }
185:            }
186:
187:            /**
188:             * Sets the firstname for the person.
189:             *
190:             * @param the firstname.
191:             * @exception DiscRackBusinessException if an error occurs
192:             *   setting the data (usually due to an underlying data layer
193:             *   error).
194:             */
195:            public void setFirstname(String firstname)
196:                    throws DiscRackBusinessException {
197:                try {
198:                    myDO.setFirstname(firstname);
199:                } catch (DataObjectException ex) {
200:                    throw new DiscRackBusinessException(
201:                            "Error setting user's first name", ex);
202:                }
203:            }
204:
205:            /**
206:             * Sets the lastname for the person.
207:             *
208:             * @param the lastname.
209:             * @exception DiscRackBusinessException if an error occurs
210:             *   setting the data (usually due to an underlying data layer
211:             *   error).
212:             */
213:            public void setLastname(String lastname)
214:                    throws DiscRackBusinessException {
215:                try {
216:                    myDO.setLastname(lastname);
217:                } catch (DataObjectException ex) {
218:                    throw new DiscRackBusinessException(
219:                            "Error setting user's last name", ex);
220:                }
221:            }
222:
223:            /**
224:             * Commits all changes to the database.
225:             *
226:             * @exception DiscRackBusinessException if an error occurs
227:             *   retrieving data (usually due to an underlying data layer
228:             *   error).
229:             */
230:            public void save() throws DiscRackBusinessException,
231:                    AssertionDataObjectException {
232:                try {
233:                    //this.myDO.commit();
234:                    this .myDO.save();
235:                } catch (AssertionDataObjectException ex) {
236:                    throw new AssertionDataObjectException(
237:                            "DML opertions not allowed.", ex);
238:                } catch (Exception ex) {
239:                    throw new DiscRackBusinessException("Error saving person",
240:                            ex);
241:                }
242:            }
243:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.