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