Source Code Cross Referenced for JDODefaults.java in  » Database-ORM » Speedo_1.4.5 » org » objectweb » speedo » metadata » jdo » 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 » Speedo_1.4.5 » org.objectweb.speedo.metadata.jdo 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /**
002:         * Copyright (C) 2001-2005 France Telecom R&D
003:         *
004:         * This library is free software; you can redistribute it and/or
005:         * modify it under the terms of the GNU Lesser General Public
006:         * License as published by the Free Software Foundation; either
007:         * version 2 of the License, or (at your option) any later version.
008:         *
009:         * This library is distributed in the hope that it will be useful,
010:         * but WITHOUT ANY WARRANTY; without even the implied warranty of
011:         * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
012:         * Lesser General Public License for more details.
013:         *
014:         * You should have received a copy of the GNU Lesser General Public
015:         * License along with this library; if not, write to the Free Software
016:         * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
017:         */package org.objectweb.speedo.metadata.jdo;
018:
019:        import java.util.ArrayList;
020:        import java.util.HashMap;
021:
022:        import org.objectweb.speedo.api.SpeedoRuntimeException;
023:        import org.objectweb.speedo.lib.Personality;
024:        import org.objectweb.speedo.metadata.SpeedoCallback;
025:        import org.objectweb.speedo.metadata.SpeedoClass;
026:        import org.objectweb.speedo.metadata.SpeedoCollection;
027:        import org.objectweb.speedo.metadata.SpeedoColumn;
028:        import org.objectweb.speedo.metadata.SpeedoDefaults;
029:        import org.objectweb.speedo.metadata.SpeedoDiscriminator;
030:        import org.objectweb.speedo.metadata.SpeedoElement;
031:        import org.objectweb.speedo.metadata.SpeedoField;
032:        import org.objectweb.speedo.metadata.SpeedoIdentity;
033:        import org.objectweb.speedo.metadata.SpeedoInheritance;
034:        import org.objectweb.speedo.metadata.SpeedoInheritedField;
035:        import org.objectweb.speedo.metadata.SpeedoJoin;
036:        import org.objectweb.speedo.metadata.SpeedoJoinColumn;
037:        import org.objectweb.speedo.metadata.SpeedoMap;
038:        import org.objectweb.speedo.metadata.SpeedoNoFieldColumn;
039:        import org.objectweb.speedo.metadata.SpeedoNullValue;
040:        import org.objectweb.speedo.metadata.SpeedoPackage;
041:        import org.objectweb.speedo.metadata.SpeedoTable;
042:
043:        /**
044:         * This class is in charge of the initialization of Speedo Meta Objects with 
045:         * the default value corresponding to the JDO personality.
046:         *
047:         * @author S.Chassande-Barrioz, P. Dechamboux
048:         */
049:        public class JDODefaults extends SpeedoDefaults {
050:
051:            public void assignDefaults(Object se) throws SpeedoRuntimeException {
052:                ((SpeedoElement) se).personality = Personality.JDO;
053:                if (se instanceof  SpeedoPackage) {
054:                    SpeedoPackage sp = (SpeedoPackage) se;
055:                    //sp.classes = ?;
056:                    //sp.jdoExtension = ?;
057:                    //sp.name = ?;
058:                    //sp.sequences = ?;
059:                    //sp.xmlDescriptor = ?;
060:                } else if (se instanceof  SpeedoClass) {
061:                    SpeedoClass sc = (SpeedoClass) se;
062:                    //sc.enhancementStatus = ?;
063:                    sc.fetchGroups = new HashMap();
064:                    sc.fields = new HashMap();
065:                    sc.identity = new SpeedoIdentity();
066:                    sc.versionField = null;
067:                    sc.inheritance = null;
068:                    sc.isAbstract = false;
069:                    sc.isDetachable = false;
070:                    sc.isInstanceCallbacks = false;
071:                    sc.isSerializable = false;
072:                    //sc.jdoExtension = ?;
073:                    //sc.joinToExtTables = ?;
074:                    //sc.jormclass = ?;
075:                    sc.callBacks = null;
076:                    //sc.mainTable = ?;
077:                    //sc.moPackage = ?;
078:                    //sc.name = ?;
079:                    sc.name2query = new HashMap();
080:                    //sc.noArgConstructorStatus = ?;
081:                    //sc.version = ?;
082:                } else if (se instanceof  SpeedoField) {
083:                    SpeedoField sf = (SpeedoField) se;
084:                    sf.name = null;
085:                    //sf.visibility = ?;
086:                    sf.propagate = SpeedoField.PROPAG_ALL;
087:                    sf.type = null;
088:                    sf.number = -1;
089:                    sf.persistenceStatus = SpeedoField.UNKNOWN;
090:                    sf.primaryKey = false;
091:                    sf.nullValue = SpeedoNullValue.NONE;
092:                    sf.defaultFetchGroup = true;
093:                    sf.depth = 0;
094:                    //sf.fetchGroup = ?;
095:                    sf.embedded = true;
096:                    //sf.valueStrategy = ?;
097:                    //sf.sequence = ?;
098:                    sf.relationType = SpeedoField.NO_BI_RELATION;
099:                    sf.reverseField = null;
100:                    sf.isCoherentReverseField = false;
101:                    sf.jdoTuple = null;
102:                    sf.moClass = null;
103:                    if (sf.columns != null) {
104:                        System.out.println("forget existing columns");
105:                        throw new RuntimeException("forget existing columns");
106:                    }
107:                    sf.columns = null;
108:                    sf.join = null;
109:                    sf.mappedByReversefield = false;
110:                } else if (se instanceof  SpeedoTable) {
111:                    SpeedoTable st = (SpeedoTable) se;
112:                    st.catalog = null;
113:                    st.name = null;
114:                    st.schema = null;
115:                    st.join = null;
116:                } else if (se instanceof  SpeedoJoin) {
117:                    SpeedoJoin sj = (SpeedoJoin) se;
118:                    sj.extTable = null;
119:                    sj.mainTable = null;
120:                    sj.columns = new ArrayList();
121:                    sj.deleteAction = SpeedoJoin.ACTION_NONE;
122:                } else if (se instanceof  SpeedoColumn) {
123:                    SpeedoColumn sc = (SpeedoColumn) se;
124:                    sc.allowNull = true;
125:                    sc.defaultValue = null;
126:                    sc.jdbcType = null;
127:                    sc.length = -1;
128:                    sc.name = null;
129:                    sc.targetColumn = null;
130:                    sc.targetField = null;
131:                    sc.scale = -1;
132:                    sc.sqlType = null;
133:                    sc.table = null;
134:                    sc.insertable = true;
135:                    sc.updatable = true;
136:                } else if (se instanceof  SpeedoIdentity) {
137:                    SpeedoIdentity si = (SpeedoIdentity) se;
138:                    si.objectidClass = null;
139:                    si.objectidJClass = null;
140:                    si.sequenceName = null;
141:                    si.strategy = SpeedoIdentity.DATASTORE_LONG;
142:                    si.columns = null;
143:                } else if (se instanceof  SpeedoJoinColumn) {
144:                    SpeedoJoinColumn sjc = (SpeedoJoinColumn) se;
145:                    sjc.column = null;
146:                    sjc.targetColumn = null;
147:                    sjc.targetField = null;
148:                } else if (se instanceof  SpeedoInheritance) {
149:                    SpeedoInheritance si = (SpeedoInheritance) se;
150:                    si.clazz = null;
151:                    si.discriminator = null;
152:                    si.discriminatorValues = null;
153:                    si.join = null;
154:                    si.remappedInheritedFields = null;
155:                    si.strategy = SpeedoInheritance.STRATEGY_UNKOWN;
156:                    si.super ClassName = null;
157:                } else if (se instanceof  SpeedoDiscriminator) {
158:                    SpeedoDiscriminator sd = (SpeedoDiscriminator) se;
159:                    sd.elements = new ArrayList();
160:                    sd.strategy = SpeedoDiscriminator.STRATEGY_NONE;
161:                } else if (se instanceof  SpeedoNoFieldColumn) {
162:                    SpeedoNoFieldColumn sc = (SpeedoNoFieldColumn) se;
163:                    // In EJB3, type may be one of {"Ljava.lang.String;", "", ""}.
164:                    //sc.type = ;
165:                    //sc.column = ;
166:                } else if (se instanceof  SpeedoInheritedField) {
167:                    SpeedoInheritedField shf = (SpeedoInheritedField) se;
168:                    shf.name = null;
169:                    shf.columns = null;
170:                    shf.inheritedField = null;
171:                    shf.join = null;
172:                    shf.moClass = null;
173:                } else if (se instanceof  SpeedoCollection) {
174:                    SpeedoCollection sc = (SpeedoCollection) se;
175:                    sc.elementType = null;
176:                    sc.embeddedElement = false;
177:                    sc.indexColumns = null;
178:                    sc.moField = null;
179:                } else if (se instanceof  SpeedoMap) {
180:                    SpeedoMap sm = (SpeedoMap) se;
181:                    sm.embeddedKey = false;
182:                    sm.embeddedValue = false;
183:                    sm.keyColumns = null;
184:                    sm.keyType = null;
185:                    sm.moField = null;
186:                } else if (se instanceof  SpeedoCallback) {
187:                    SpeedoCallback sc = (SpeedoCallback) se;
188:                    sc.listenerClassName = null;
189:                    sc.callbackName = null;
190:                    sc.methodByteCodeSignature = null;
191:                    sc.callbackType = -1;
192:                } else {
193:                    /*throw new SpeedoException("Unknown element to initialize: " +
194:                    		se.getClass().getName());*/
195:                }
196:            }
197:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.