Source Code Cross Referenced for MetaObjectReference.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.util.PropertyMap;
012:        import com.completex.objective.components.persistency.Mappable;
013:
014:        import java.util.LinkedHashMap;
015:        import java.util.Map;
016:
017:        /**
018:         * @author Gennady Krizhevsky
019:         */
020:        public class MetaObjectReference implements  Referencing, Mappable {
021:            /*
022:               CPX_TEST_MASTER = {
023:                    className = "CpxTestMaster"
024:                    base = {
025:                        tableName = TEST_MASTER
026:                        # tableAlias = XXX
027:                        # className = XXX
028:                    } 
029:
030:                    complexChildren = {
031:                        slave = {
032:                            relationshipType = one_to_many
033:                            name = CPX_TEST_SLAVE
034:                            factory_method = cpxFactorySlave
035:                            lazy = TRUE
036:                            cascade_inserts = FALSE
037:                            cascade_updates = FALSE
038:                            cascade_deletes = FALSE
039:                            multipleResultFactory = com.completex.objective.components.persistency.type.TracingArrayListCollectionFactory
040:                        }
041:                    }  
042:                                        
043:                    compound = { 
044:                        delegateFactory = {}
045:                        children = {
046:                            masterAttr = {
047:                                ref = { 
048:                                    name = TEST_MASTER_ATTR # Name of one of objectsReferences from this file 
049:                                                            # or alias from external descriptor
050:                                    # className = XXX
051:                                }
052:                                containmentType = has # has | is 
053:                                cascadeInsert = true
054:                                cascadeDelete = true                                       
055:                            }
056:                        }
057:                    }
058:                }
059:             */
060:
061:            private String className;
062:            private String interfaceName;
063:            private MetaRef base;
064:            private MetaComplex complex;
065:            private MetaCompound compound;
066:            //
067:            // Tags:
068:            //
069:            public static final String TAG_CLASS_NAME = "className";
070:            public static final String TAG_INTERFACE_NAME = "interfaceName";
071:            public static final String TAG_BASE_OBJECT_NAME = "base";
072:            public static final String TAG_COMPLEX = "complex";
073:            public static final String TAG_COMPOUND = "compound";
074:
075:            public MetaObjectReference() {
076:            }
077:
078:            public MetaObjectReference(Map map) {
079:                fromMap(map);
080:            }
081:
082:            public Map toMap() {
083:                Map map = new LinkedHashMap();
084:                map.put(TAG_CLASS_NAME, className);
085:                map.put(TAG_INTERFACE_NAME, interfaceName);
086:                map.put(TAG_BASE_OBJECT_NAME, base.toMap());
087:
088:                if (complex != null) {
089:                    map.put(TAG_COMPLEX, complex.toMap());
090:                }
091:
092:                if (compound != null) {
093:                    map.put(TAG_COMPOUND, compound.toMap());
094:                }
095:
096:                return map;
097:            }
098:
099:            public void fromMap(Map map) {
100:                PropertyMap propertyMap = PropertyMap.toPropertyMap(map);
101:                className = propertyMap.getProperty(TAG_CLASS_NAME);
102:                interfaceName = propertyMap.getProperty(TAG_INTERFACE_NAME);
103:                Map baseMap = propertyMap.getPropertyMap(TAG_BASE_OBJECT_NAME);
104:                base = new MetaRef(baseMap);
105:
106:                PropertyMap complexMap = propertyMap
107:                        .getPropertyMap(TAG_COMPLEX);
108:                if (complexMap != null) {
109:                    complex = new MetaComplex(complexMap);
110:                }
111:
112:                PropertyMap compoundMap = propertyMap
113:                        .getPropertyMap(TAG_COMPOUND);
114:                if (compoundMap != null) {
115:                    compound = new MetaCompound(compoundMap);
116:                }
117:            }
118:
119:            public String getClassName() {
120:                return className;
121:            }
122:
123:            public void setClassName(String className) {
124:                this .className = className;
125:            }
126:
127:            public String getInterfaceName() {
128:                return interfaceName;
129:            }
130:
131:            public void setInterfaceName(String interfaceName) {
132:                this .interfaceName = interfaceName;
133:            }
134:
135:            public MetaRef getBase() {
136:                return base;
137:            }
138:
139:            public void setBase(MetaRef base) {
140:                this .base = base;
141:            }
142:
143:            public MetaComplex getComplex() {
144:                return complex;
145:            }
146:
147:            public MetaCompound getCompound() {
148:                return compound;
149:            }
150:
151:            public boolean isCompound() {
152:                return compound != null && !compound.isEmpty();
153:            }
154:
155:            public Map getCompoundChildren() {
156:                return compound == null ? null : compound.getChildren();
157:            }
158:
159:            public boolean hasCompoundChildren() {
160:                return isCompound() && compound.hasChildren();
161:            }
162:
163:            public String toString() {
164:                return toMap().toString();
165:            }
166:
167:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.