Source Code Cross Referenced for MetaComplexChild.java in  » Database-ORM » ODAL » com » completex » objective » components » persistency » meta » 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 » ODAL » com.completex.objective.components.persistency.meta 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /**
002:         *  Objective Database Abstraction Layer (ODAL)
003:         *  Copyright (c) 2004, The ODAL Development Group
004:         *  All rights reserved.
005:         *  For definition of the ODAL Development Group please refer to LICENCE.txt file
006:         *
007:         *  Distributable under LGPL license.
008:         *  See terms of license at gnu.org.
009:         */package com.completex.objective.components.persistency.meta;
010:
011:        import com.completex.objective.components.persistency.Link;
012:        import com.completex.objective.components.persistency.Mappable;
013:        import com.completex.objective.util.PropertyMap;
014:
015:        import java.util.LinkedHashMap;
016:        import java.util.Map;
017:
018:        /**
019:         * @author Gennady Krizhevsky
020:         */
021:        public class MetaComplexChild extends MetaChild implements  Mappable {
022:
023:            private String name;
024:            private Link.RelationshipType relationshipType;
025:            private boolean cascadeInsert;
026:            private boolean cascadeUpdate;
027:            private boolean cascadeDelete;
028:            private MetaMultipleResultFactory multipleResultFactory;
029:            private String factoryMethod;
030:            private boolean lazy;
031:            private String inlineMode;
032:
033:            //
034:            // calculated:
035:            //
036:            private boolean insertBeforeParent;
037:            //
038:            // Assigned:
039:            //
040:            private int index;
041:            private String className;
042:            //
043:            // Tags:
044:            //
045:            public static final String TAG_RELATIONSHIP_TYPE = "relationshipType";
046:            public static final String TAG_REF = "ref";
047:            public static final String TAG_CASCADE_INSERT = "cascadeInsert";
048:            public static final String TAG_CASCADE_UPDATE = "cascadeUpdate";
049:            public static final String TAG_CASCADE_DELETE = "cascadeDelete";
050:            public static final String TAG_MULTIPLE_RESULT_FACTORY = "multipleResultFactory";
051:            public static final String TAG_FACTORY_METHOD = "factoryMethod";
052:            public static final String TAG_LAZY = "lazy";
053:            public static final String TAG_NAME = "name";
054:            public static final String TAG_INLINE_MODE = "inlineMode";
055:
056:            public MetaComplexChild() {
057:            }
058:
059:            public MetaComplexChild(Map map) {
060:                fromMap(map);
061:            }
062:
063:            public MetaComplexChild(String name, Map map) {
064:                fromMap(map);
065:                this .name = name;
066:            }
067:
068:            public Map toMap() {
069:                LinkedHashMap map = new LinkedHashMap();
070:                map.put(TAG_RELATIONSHIP_TYPE, relationshipType);
071:                map.put(TAG_REF, ref.toMap());
072:                map.put(TAG_CASCADE_INSERT, Boolean.valueOf(cascadeInsert));
073:                map.put(TAG_CASCADE_UPDATE, Boolean.valueOf(cascadeUpdate));
074:                map.put(TAG_CASCADE_DELETE, Boolean.valueOf(cascadeDelete));
075:                map.put(TAG_FACTORY_METHOD, factoryMethod);
076:                map.put(TAG_LAZY, Boolean.valueOf(lazy));
077:                map.put(TAG_NAME, name);
078:                if (inlineMode != null) {
079:                    map.put(TAG_INLINE_MODE, inlineMode);
080:                }
081:                if (multipleResultFactory != null) {
082:                    map.put(TAG_MULTIPLE_RESULT_FACTORY, multipleResultFactory
083:                            .toMap());
084:                }
085:                return map;
086:            }
087:
088:            public void fromMap(Map map) {
089:                PropertyMap propertyMap = PropertyMap.toPropertyMap(map);
090:
091:                String relName = propertyMap.getProperty(TAG_RELATIONSHIP_TYPE,
092:                        true);
093:                relationshipType = Link.RelationshipType.name2type(relName);
094:                Map refMap = propertyMap.getPropertyMap(TAG_REF, true);
095:                ref = new MetaRef(refMap);
096:                cascadeInsert = propertyMap.getBoolean(TAG_CASCADE_INSERT);
097:                cascadeUpdate = propertyMap.getBoolean(TAG_CASCADE_UPDATE);
098:                cascadeDelete = propertyMap.getBoolean(TAG_CASCADE_DELETE);
099:                Map multipleResultFactoryMap = propertyMap
100:                        .getPropertyMap(TAG_MULTIPLE_RESULT_FACTORY);
101:                if (multipleResultFactoryMap != null) {
102:                    multipleResultFactory = new MetaMultipleResultFactory(
103:                            multipleResultFactoryMap);
104:                }
105:                factoryMethod = propertyMap.getProperty(TAG_FACTORY_METHOD);
106:                lazy = propertyMap.getBoolean(TAG_LAZY);
107:                name = propertyMap.getProperty(TAG_NAME);
108:                inlineMode = propertyMap.getProperty(TAG_INLINE_MODE);
109:
110:                //
111:                // calculate insertBeforeParent:
112:                //
113:                if (relationshipType == Link.MANY_TO_ONE) {
114:                    insertBeforeParent = true;
115:                }
116:            }
117:
118:            public boolean isCascadeInsert() {
119:                return cascadeInsert;
120:            }
121:
122:            public void setCascadeInsert(boolean cascadeInsert) {
123:                this .cascadeInsert = cascadeInsert;
124:            }
125:
126:            public boolean isCascadeUpdate() {
127:                return cascadeUpdate;
128:            }
129:
130:            public void setCascadeUpdate(boolean cascadeUpdate) {
131:                this .cascadeUpdate = cascadeUpdate;
132:            }
133:
134:            public boolean isCascadeDelete() {
135:                return cascadeDelete;
136:            }
137:
138:            public void setCascadeDelete(boolean cascadeDelete) {
139:                this .cascadeDelete = cascadeDelete;
140:            }
141:
142:            public MetaMultipleResultFactory getMultipleResultFactory() {
143:                return multipleResultFactory;
144:            }
145:
146:            public void setMultipleResultFactory(
147:                    MetaMultipleResultFactory multipleResultFactory) {
148:                this .multipleResultFactory = multipleResultFactory;
149:            }
150:
151:            public String getFactoryMethod() {
152:                return factoryMethod;
153:            }
154:
155:            public void setFactoryMethod(String factoryMethod) {
156:                this .factoryMethod = factoryMethod;
157:            }
158:
159:            public boolean isLazy() {
160:                return lazy;
161:            }
162:
163:            public void setLazy(boolean lazy) {
164:                this .lazy = lazy;
165:            }
166:
167:            public boolean isInsertBeforeParent() {
168:                return insertBeforeParent;
169:            }
170:
171:            public void setInsertBeforeParent(boolean insertBeforeParent) {
172:                this .insertBeforeParent = insertBeforeParent;
173:            }
174:
175:            public int getIndex() {
176:                return index;
177:            }
178:
179:            public void setIndex(int index) {
180:                this .index = index;
181:            }
182:
183:            public String getClassName() {
184:                return className;
185:            }
186:
187:            public void setClassName(String className) {
188:                this .className = className;
189:            }
190:
191:            public String getName() {
192:                return name;
193:            }
194:
195:            public void setName(String name) {
196:                this .name = name;
197:            }
198:
199:            public Link.RelationshipType getRelationshipType() {
200:                return relationshipType;
201:            }
202:
203:            public void setRelationshipType(
204:                    Link.RelationshipType relationshipType) {
205:                this .relationshipType = relationshipType;
206:            }
207:
208:            public String getInlineMode() {
209:                return inlineMode;
210:            }
211:
212:            public void setInlineMode(String inlineMode) {
213:                this .inlineMode = inlineMode;
214:            }
215:
216:            public String toString() {
217:                return toMap().toString();
218:            }
219:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.