Source Code Cross Referenced for PersonImpl.java in  » Database-ORM » db-ojb » org » apache » ojb » odmg » shared » 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 » db ojb » org.apache.ojb.odmg.shared 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /*
002:         * Created by IntelliJ IDEA.
003:         * User: tom
004:         * Date: May 28, 2001
005:         * Time: 10:35:05 PM
006:         * To change template for new class use
007:         * Code Style | Class Templates options (Tools | IDE Options).
008:         */
009:        package org.apache.ojb.odmg.shared;
010:
011:        import org.apache.commons.lang.builder.ToStringBuilder;
012:        import org.apache.commons.lang.builder.ToStringStyle;
013:
014:        import java.io.Serializable;
015:        import java.util.ArrayList;
016:        import java.util.Arrays;
017:
018:        public class PersonImpl implements  Person, Serializable {
019:            // technical attributes only needed for O/R mapping
020:            private int id;
021:            private int motherId;
022:            private int fatherId;
023:
024:            // domain specific attributes
025:            private String firstname;
026:            private String lastname;
027:            private Person mother;
028:            private Person father;
029:            private Person[] children;
030:
031:            public PersonImpl() {
032:            }
033:
034:            public String getFirstname() {
035:                return firstname;
036:            }
037:
038:            public String getLastname() {
039:                return lastname;
040:            }
041:
042:            public Person getMother() {
043:                return mother;
044:            }
045:
046:            public Person getFather() {
047:                return father;
048:            }
049:
050:            public Person[] getChildren() {
051:                return children;
052:            }
053:
054:            public void setFirstname(String pFirstname) {
055:                firstname = pFirstname;
056:            }
057:
058:            public void setLastname(String pLastname) {
059:                lastname = pLastname;
060:            }
061:
062:            public void setMother(Person pMother) {
063:                mother = pMother;
064:            }
065:
066:            public void setFather(Person pFather) {
067:                father = pFather;
068:            }
069:
070:            public void setChildren(Person[] pChildren) {
071:                children = pChildren;
072:            }
073:
074:            public void addChild(Person pChild) {
075:                int numOfChildren = ((children == null) ? 0 : children.length);
076:                Person[] newKids = new Person[numOfChildren + 1];
077:                ArrayList list = new ArrayList(Arrays.asList(children));
078:                list.add(pChild);
079:                list.toArray(newKids);
080:            }
081:
082:            /**
083:             * Gets the fatherId.
084:             * @return Returns a int
085:             */
086:            public int getFatherId() {
087:                return fatherId;
088:            }
089:
090:            /**
091:             * Sets the fatherId.
092:             * @param fatherId The fatherId to set
093:             */
094:            public void setFatherId(int fatherId) {
095:                this .fatherId = fatherId;
096:            }
097:
098:            /**
099:             * Gets the id.
100:             * @return Returns a int
101:             */
102:            public int getId() {
103:                return id;
104:            }
105:
106:            /**
107:             * Sets the id.
108:             * @param id The id to set
109:             */
110:            public void setId(int id) {
111:                this .id = id;
112:            }
113:
114:            /**
115:             * Gets the motherId.
116:             * @return Returns a int
117:             */
118:            public int getMotherId() {
119:                return motherId;
120:            }
121:
122:            /**
123:             * Sets the motherId.
124:             * @param motherId The motherId to set
125:             */
126:            public void setMotherId(int motherId) {
127:                this .motherId = motherId;
128:            }
129:
130:            public String toString() {
131:                ToStringBuilder buf = new ToStringBuilder(this ,
132:                        ToStringStyle.MULTI_LINE_STYLE);
133:                buf.append("id", id);
134:                buf.append("firstname", firstname);
135:                buf.append("lastname", lastname);
136:                buf.append("motherId", motherId);
137:                buf.append("mother", mother != null ? "PersonImpl@"
138:                        + System.identityHashCode(mother) + "(" + motherId
139:                        + ")" : null);
140:                buf.append("fatherId", fatherId);
141:                buf.append("father", father != null ? "PersonImpl@"
142:                        + System.identityHashCode(father) + "(" + fatherId
143:                        + ")" : null);
144:                return buf.toString();
145:            }
146:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.