Source Code Cross Referenced for PersonImpl.java in  » J2EE » Enhydra-Demos » 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 » J2EE » Enhydra Demos » 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: PersonImpl.java,v 1.1 2006-09-11 12:31:47 sinisa Exp $
022:         */
023:
024:        package discRack.business.person;
025:
026:        import discRack.data.person.PersonDO;
027:        import discRack.data.disc.DiscDO;
028:        import discRack.spec.Person;
029:        import discRack.business.DiscRackBusinessException;
030:
031:        import com.lutris.appserver.server.sql.DatabaseManagerException;
032:        import com.lutris.appserver.server.sql.ObjectIdException;
033:        import com.lutris.dods.builder.generator.query.DataObjectException;
034:        import org.enhydra.dods.exceptions.AssertionDataObjectException;
035:
036:        /**
037:         * Represents a person. 
038:         */
039:        public class PersonImpl implements  Person, java.io.Serializable {
040:            /**
041:             * The DO of the Person.
042:             */
043:            protected PersonDO myDO = null;
044:
045:            /**
046:             * The public constructor.
047:             */
048:            public PersonImpl() throws DiscRackBusinessException {
049:                try {
050:                    this .myDO = PersonDO.createVirgin();
051:                } catch (DatabaseManagerException ex) {
052:                    throw new DiscRackBusinessException(
053:                            "Error creating empty person", ex);
054:                } catch (ObjectIdException ex) {
055:                    throw new DiscRackBusinessException(
056:                            "Error creating object ID for person", ex);
057:                }
058:            }
059:
060:            /** The public constructor
061:             *
062:             * @param thePerson The data object of the person.
063:             */
064:            public PersonImpl(PersonDO thePerson) {
065:                this .myDO = thePerson;
066:            }
067:
068:            /**
069:             * Gets the object id for the person
070:             *
071:             * @return the object id.
072:             * @exception DiscRackBusinessException if an error occurs
073:             *   retrieving data (usually due to an underlying data layer
074:             *   error).
075:             */
076:            public String getHandle() throws DiscRackBusinessException {
077:                try {
078:                    return this .myDO.getHandle();
079:                } catch (DatabaseManagerException ex) {
080:                    throw new DiscRackBusinessException(
081:                            "Error getting handle for person", ex);
082:                }
083:            }
084:
085:            /**
086:             * Gets the login name for the person
087:             *
088:             * @return the login name.
089:             * @exception DiscRackBusinessException if an error occurs
090:             *   retrieving data (usually due to an underlying data layer
091:             *   error).
092:             */
093:            public String getLogin() throws DiscRackBusinessException {
094:                try {
095:                    return myDO.getLogin();
096:                } catch (DataObjectException ex) {
097:                    throw new DiscRackBusinessException(
098:                            "Error getting user's login name", ex);
099:                }
100:            }
101:
102:            /**
103:             * Gets the password for the person
104:             *
105:             * @return the password.
106:             * @exception DiscRackBusinessException if an error occurs
107:             *   retrieving data (usually due to an underlying data layer
108:             *   error).
109:             */
110:            public String getPassword() throws DiscRackBusinessException {
111:                try {
112:                    return myDO.getPassword();
113:                } catch (DataObjectException ex) {
114:                    throw new DiscRackBusinessException(
115:                            "Error getting user's password", ex);
116:                }
117:            }
118:
119:            /**
120:             * Gets the firstname for the person
121:             *
122:             * @return the firstname.
123:             * @exception DiscRackBusinessException if an error occurs
124:             *   retrieving data (usually due to an underlying data layer
125:             *   error).
126:             */
127:            public String getFirstname() throws DiscRackBusinessException {
128:                try {
129:                    return myDO.getFirstname();
130:                } catch (DataObjectException ex) {
131:                    throw new DiscRackBusinessException(
132:                            "Error getting user's first name", ex);
133:                }
134:            }
135:
136:            /**
137:             * Gets the lastname for the person
138:             *
139:             * @return the lastname.
140:             * @exception DiscRackBusinessException if an error occurs
141:             *   retrieving data (usually due to an underlying data layer
142:             *   error).
143:             */
144:            public String getLastname() throws DiscRackBusinessException {
145:                try {
146:                    return myDO.getLastname();
147:                } catch (DataObjectException ex) {
148:                    throw new DiscRackBusinessException(
149:                            "Error getting user's last name", ex);
150:                }
151:            }
152:
153:            /**
154:             * Sets the login name for the person.
155:             *
156:             * @param login  login name.
157:             * @exception DiscRackBusinessException if an error occurs
158:             *   setting the data (usually due to an underlying data layer
159:             *   error).
160:             */
161:            public void setLogin(String login) throws DiscRackBusinessException {
162:                try {
163:                    myDO.setLogin(login);
164:                } catch (DataObjectException ex) {
165:                    throw new DiscRackBusinessException(
166:                            "Error setting user's login name", ex);
167:                }
168:            }
169:
170:            /**
171:             * Sets the password for the person.
172:             *
173:             * @param password
174:             * @exception DiscRackBusinessException if an error occurs
175:             *   setting the data (usually due to an underlying data layer
176:             *   error).
177:             */
178:            public void setPassword(String password)
179:                    throws DiscRackBusinessException {
180:                try {
181:                    myDO.setPassword(password);
182:                } catch (DataObjectException ex) {
183:                    throw new DiscRackBusinessException(
184:                            "Error setting user's password", ex);
185:                }
186:            }
187:
188:            /**
189:             * Sets the firstname for the person.
190:             *
191:             * @param firstname
192:             * @exception DiscRackBusinessException if an error occurs
193:             *   setting the data (usually due to an underlying data layer
194:             *   error).
195:             */
196:            public void setFirstname(String firstname)
197:                    throws DiscRackBusinessException {
198:                try {
199:                    myDO.setFirstname(firstname);
200:                } catch (DataObjectException ex) {
201:                    throw new DiscRackBusinessException(
202:                            "Error setting user's first name", ex);
203:                }
204:            }
205:
206:            /**
207:             * Sets the lastname for the person.
208:             *
209:             * @param lastname
210:             * @exception DiscRackBusinessException if an error occurs
211:             *   setting the data (usually due to an underlying data layer
212:             *   error).
213:             */
214:            public void setLastname(String lastname)
215:                    throws DiscRackBusinessException {
216:                try {
217:                    myDO.setLastname(lastname);
218:                } catch (DataObjectException ex) {
219:                    throw new DiscRackBusinessException(
220:                            "Error setting user's last name", ex);
221:                }
222:            }
223:
224:            /**
225:             * Commits all changes to the database.
226:             *
227:             * @exception DiscRackBusinessException if an error occurs
228:             *   retrieving data (usually due to an underlying data layer
229:             *   error).
230:             */
231:            public void save() throws DiscRackBusinessException,
232:                    AssertionDataObjectException {
233:                try {
234:                    this .myDO.commit();
235:                } catch (AssertionDataObjectException ex) {
236:                    throw new AssertionDataObjectException(
237:                            "Read-only table: DML operations 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.