Source Code Cross Referenced for EJBDefaults.java in  » Database-ORM » Speedo_1.4.5 » org » objectweb » speedo » metadata » ejb » 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.ejb 
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.ejb;
018:
019:        import java.util.ArrayList;
020:        import java.util.HashMap;
021:
022:        import org.objectweb.speedo.api.SpeedoException;
023:        import org.objectweb.speedo.api.SpeedoRuntimeException;
024:        import org.objectweb.speedo.lib.Personality;
025:        import org.objectweb.speedo.metadata.SpeedoCallback;
026:        import org.objectweb.speedo.metadata.SpeedoClass;
027:        import org.objectweb.speedo.metadata.SpeedoCollection;
028:        import org.objectweb.speedo.metadata.SpeedoColumn;
029:        import org.objectweb.speedo.metadata.SpeedoDefaults;
030:        import org.objectweb.speedo.metadata.SpeedoDiscriminator;
031:        import org.objectweb.speedo.metadata.SpeedoElement;
032:        import org.objectweb.speedo.metadata.SpeedoField;
033:        import org.objectweb.speedo.metadata.SpeedoIdentity;
034:        import org.objectweb.speedo.metadata.SpeedoInheritance;
035:        import org.objectweb.speedo.metadata.SpeedoInheritedField;
036:        import org.objectweb.speedo.metadata.SpeedoJoin;
037:        import org.objectweb.speedo.metadata.SpeedoJoinColumn;
038:        import org.objectweb.speedo.metadata.SpeedoMap;
039:        import org.objectweb.speedo.metadata.SpeedoNoFieldColumn;
040:        import org.objectweb.speedo.metadata.SpeedoNullValue;
041:        import org.objectweb.speedo.metadata.SpeedoPackage;
042:        import org.objectweb.speedo.metadata.SpeedoTable;
043:
044:        /**
045:         * This class is in charge of the initialization of Speedo Meta Objects with 
046:         * the default value corresponding to the EJB personality.
047:         *
048:         * @author S.Chassande-Barrioz, P. Dechamboux
049:         */
050:        public class EJBDefaults extends SpeedoDefaults {
051:            final static String UNKNOWN = "unknown";
052:
053:            public void assignDefaults(Object se) throws SpeedoRuntimeException {
054:                ((SpeedoElement) se).personality = Personality.EJB;
055:                if (se instanceof  SpeedoPackage) {
056:                    SpeedoPackage sp = (SpeedoPackage) se;
057:                    //sp.classes = ?;
058:                    //sp.jdoExtension = ?;
059:                    sp.name = UNKNOWN;
060:                    //sp.sequences = ?;
061:                    sp.xmlDescriptor = null;
062:                } else if (se instanceof  SpeedoClass) {
063:                    SpeedoClass sc = (SpeedoClass) se;
064:                    //sc.enhancementStatus = ?;
065:                    sc.fetchGroups = new HashMap();
066:                    sc.fields = new HashMap();
067:                    sc.identity = null;
068:                    sc.versionField = null;
069:                    sc.inheritance = null;
070:                    sc.isAbstract = false;
071:                    sc.isDetachable = false;
072:                    sc.isInstanceCallbacks = false;
073:                    sc.isSerializable = false;
074:                    //sc.jdoExtension = ?;
075:                    //sc.joinToExtTables = ?;
076:                    //sc.jormclass = ?;
077:                    sc.callBacks = new HashMap();
078:                    //sc.mainTable = ?;
079:                    //sc.moPackage = ?;
080:                    sc.name = UNKNOWN;
081:                    sc.name2query = new HashMap();
082:                    //sc.noArgConstructorStatus = ?;
083:                    //sc.version = ?;
084:                } else if (se instanceof  SpeedoField) {
085:                    SpeedoField sf = (SpeedoField) se;
086:                    sf.name = null;
087:                    //sf.visibility = ?;
088:                    sf.propagate = SpeedoField.PROPAG_NONE;
089:                    sf.type = null;
090:                    sf.number = -1;
091:                    sf.persistenceStatus = SpeedoField.UNKNOWN;
092:                    sf.primaryKey = false;
093:                    sf.nullValue = SpeedoNullValue.NONE;
094:                    sf.defaultFetchGroup = true;
095:                    sf.depth = 0;
096:                    //sf.fetchGroup = ?;
097:                    sf.embedded = true;
098:                    //sf.valueStrategy = ?;
099:                    //sf.sequence = ?;
100:                    sf.relationType = SpeedoField.NO_BI_RELATION;
101:                    sf.reverseField = null;
102:                    sf.isCoherentReverseField = false;
103:                    sf.jdoTuple = null;
104:                    sf.moClass = null;
105:                    sf.columns = null;
106:                    sf.join = null;
107:                    sf.mappedByReversefield = false;
108:                } else if (se instanceof  SpeedoTable) {
109:                    SpeedoTable st = (SpeedoTable) se;
110:                    st.catalog = null;
111:                    st.name = null;
112:                    st.schema = null;
113:                    st.join = null;
114:                } else if (se instanceof  SpeedoJoin) {
115:                    SpeedoJoin sj = (SpeedoJoin) se;
116:                    sj.extTable = null;
117:                    sj.mainTable = null;
118:                    sj.columns = new ArrayList();
119:                    sj.deleteAction = SpeedoJoin.ACTION_NONE;
120:                } else if (se instanceof  SpeedoColumn) {
121:                    SpeedoColumn sc = (SpeedoColumn) se;
122:                    sc.allowNull = true;
123:                    //sc.defaultValue = ?;
124:                    //sc.jdbcType = ?;
125:                    sc.length = 255;
126:                    sc.name = null;
127:                    sc.targetColumn = null;
128:                    sc.targetField = null;
129:                    sc.scale = 0;
130:                    //sc.sqlType = ?;
131:                    sc.table = null;
132:                    sc.insertable = true;
133:                    sc.updatable = true;
134:                } else if (se instanceof  SpeedoIdentity) {
135:                    SpeedoIdentity si = (SpeedoIdentity) se;
136:                    si.objectidClass = null;
137:                    si.objectidJClass = null;
138:                    si.sequenceName = null;
139:                    si.strategy = SpeedoIdentity.NO_ID;
140:                    si.columns = null;
141:                } else if (se instanceof  SpeedoJoinColumn) {
142:                    SpeedoJoinColumn sjc = (SpeedoJoinColumn) se;
143:                    sjc.column = null;
144:                    sjc.targetColumn = null;
145:                    sjc.targetField = null;
146:                } else if (se instanceof  SpeedoInheritance) {
147:                    SpeedoInheritance si = (SpeedoInheritance) se;
148:                    si.clazz = null;
149:                    //si.discriminator = ;
150:                    si.discriminatorValues = null;
151:                    si.join = null;
152:                    si.remappedInheritedFields = null;
153:                    si.strategy = SpeedoInheritance.STRATEGY_UNKOWN;
154:                    si.super ClassName = "";//TODO: null should be better
155:                } else if (se instanceof  SpeedoDiscriminator) {
156:                    SpeedoDiscriminator sd = (SpeedoDiscriminator) se;
157:                    sd.elements = new ArrayList();
158:                    sd.strategy = SpeedoDiscriminator.STRATEGY_NONE;
159:                } else if (se instanceof  SpeedoNoFieldColumn) {
160:                    SpeedoNoFieldColumn sc = (SpeedoNoFieldColumn) se;
161:                    // In EJB3, type may be one of {"Ljava.lang.String;", "", ""}.
162:                    //sc.type = ;
163:                    //sc.column = ;
164:                } else if (se instanceof  SpeedoInheritedField) {
165:                    SpeedoInheritedField shf = (SpeedoInheritedField) se;
166:                    shf.name = null;
167:                    shf.columns = null;
168:                    shf.inheritedField = null;
169:                    shf.join = null;
170:                    shf.moClass = null;
171:                } else if (se instanceof  SpeedoCollection) {
172:                    SpeedoCollection sc = (SpeedoCollection) se;
173:                    sc.elementType = null;
174:                    sc.embeddedElement = false;
175:                    sc.indexColumns = null;
176:                    sc.moField = null;
177:                } else if (se instanceof  SpeedoMap) {
178:                    SpeedoMap sm = (SpeedoMap) se;
179:                    sm.embeddedKey = false;
180:                    sm.embeddedValue = false;
181:                    sm.keyColumns = null;
182:                    sm.keyType = null;
183:                    sm.moField = null;
184:                } else if (se instanceof  SpeedoCallback) {
185:                    SpeedoCallback sc = (SpeedoCallback) se;
186:                    sc.listenerClassName = null;
187:                    sc.callbackName = null;
188:                    sc.methodByteCodeSignature = null;
189:                    sc.callbackType = -1;
190:                } else {
191:                    throw new SpeedoRuntimeException(
192:                            "Unknown meta-info element to initialize: "
193:                                    + se.getClass().getName());
194:                }
195:            }
196:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.