Source Code Cross Referenced for IdentifierFactory.java in  » Database-ORM » JPOX » org » jpox » store » 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 » JPOX » org.jpox.store 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /**********************************************************************
002:        Copyright (c) 2005 Erik Bengtson and others. All rights reserved.
003:        Licensed under the Apache License, Version 2.0 (the "License");
004:        you may not use this file except in compliance with the License.
005:        You may obtain a copy of the License at
006:
007:            http://www.apache.org/licenses/LICENSE-2.0
008:
009:        Unless required by applicable law or agreed to in writing, software
010:        distributed under the License is distributed on an "AS IS" BASIS,
011:        WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
012:        See the License for the specific language governing permissions and
013:        limitations under the License.
014:
015:        Contributors:
016:        2006 Andy Jefferson - changed to interface
017:            ...
018:         **********************************************************************/package org.jpox.store;
019:
020:        import org.jpox.ClassLoaderResolver;
021:        import org.jpox.metadata.AbstractClassMetaData;
022:        import org.jpox.metadata.AbstractMemberMetaData;
023:        import org.jpox.store.DatastoreIdentifier;
024:
025:        /**
026:         * Factory that creates immutable instances of DatastoreIdentifier.
027:         * Identifiers are of a particular type. Each datastore could invent its own  particular types
028:         * as required, just that the ones here should be the principal types required.
029:         *
030:         * @version $Revision: 1.16 $
031:         */
032:        public interface IdentifierFactory {
033:            /** Representation of an identifier specified in UPPER CASE */
034:            public static final int IDENTIFIER_UPPER_CASE = 0;
035:
036:            /** Representation of an identifier specified in "UPPER CASE" */
037:            public static final int IDENTIFIER_UPPER_CASE_QUOTED = 1;
038:
039:            /** Representation of an identifier specified in lower case. */
040:            public static final int IDENTIFIER_LOWER_CASE = 2;
041:
042:            /** Representation of an identifier specified in "lower case" */
043:            public static final int IDENTIFIER_LOWER_CASE_QUOTED = 3;
044:
045:            /** Representation of an identifier specified in Mixed Case. */
046:            public static final int IDENTIFIER_MIXED_CASE = 4;
047:
048:            /** Representation of an identifier specified in "Mixed Case". */
049:            public static final int IDENTIFIER_MIXED_CASE_QUOTED = 5;
050:
051:            // TODO Not all of these statics are applicable to all datastores, so maybe trim them down and move some to RDBMS */
052:            /** identifier for table names **/
053:            public final static int TABLE = 0;
054:
055:            /** column **/
056:            public final static int COLUMN = 1;
057:
058:            /** foreign key **/
059:            public final static int FOREIGN_KEY = 2;
060:
061:            /** index **/
062:            public final static int INDEX = 3;
063:
064:            /** candidate key - unique index constraint **/
065:            public final static int CANDIDATE_KEY = 4;
066:
067:            /** primary key **/
068:            public final static int PRIMARY_KEY = 5;
069:
070:            /** identifier for datastore sequence. */
071:            public final static int SEQUENCE = 6;
072:
073:            /**
074:             * Accessor for the datastore adapter that we are creating identifiers for.
075:             * @return The datastore adapter
076:             */
077:            DatastoreAdapter getDatastoreAdapter();
078:
079:            /**
080:             * Accessor for the identifier case being used.
081:             * @return The identifier case
082:             */
083:            int getIdentifierCase();
084:
085:            /**
086:             * Convenience method to return the name for the identifier case.
087:             * @return Identifier case name
088:             */
089:            String getNameOfIdentifierCase();
090:
091:            /**
092:             * Accessor for an identifier for use in the datastore adapter
093:             * @param identifier The identifier name
094:             * @return Identifier name for use with the datastore adapter
095:             */
096:            String getIdentifierInAdapterCase(String identifier);
097:
098:            /**
099:             * To be called when we want an identifier name creating based on the
100:             * identifier. Creates identifier for COLUMN, FOREIGN KEY, INDEX and TABLE
101:             * @param identifierType the type of identifier to be created
102:             * @param sqlIdentifier The SQL identifier name
103:             * @return The DatastoreIdentifier
104:             */
105:            DatastoreIdentifier newIdentifier(int identifierType,
106:                    String sqlIdentifier);
107:
108:            /**
109:             * Method to use to generate an identifier for a datastore field with the supplied name.
110:             * The passed name will not be changed (other than in its case) although it may
111:             * be truncated to fit the maximum length permitted for a datastore field identifier.
112:             * @param identifierName The identifier name
113:             * @return The DatastoreIdentifier for the table
114:             */
115:            DatastoreIdentifier newDatastoreContainerIdentifier(
116:                    String identifierName);
117:
118:            /**
119:             * Method to return a Table identifier for the specified class.
120:             * @param clr the ClassLoaderResolver
121:             * @param md Meta data for the class
122:             * @return The identifier for the table
123:             **/
124:            DatastoreIdentifier newDatastoreContainerIdentifier(
125:                    ClassLoaderResolver clr, AbstractClassMetaData md);
126:
127:            /**
128:             * Method to return a Table identifier for the specified field.
129:             * @param clr the ClassLoaderResolver
130:             * @param fmd Meta data for the field
131:             * @return The identifier for the table
132:             **/
133:            DatastoreIdentifier newDatastoreContainerIdentifier(
134:                    ClassLoaderResolver clr, AbstractMemberMetaData fmd);
135:
136:            /**
137:             * Method to use to generate an identifier for a datastore field with the supplied name.
138:             * The passed name will not be changed (other than in its case) although it may
139:             * be truncated to fit the maximum length permitted for a datastore field identifier.
140:             * @param identifierName The identifier name
141:             * @return The DatastoreIdentifier
142:             */
143:            DatastoreIdentifier newDatastoreFieldIdentifier(
144:                    String identifierName);
145:
146:            /**
147:             * Method to create an identifier for a datastore field where we want the
148:             * name based on the supplied java name, and the field has a particular
149:             * role (and so could have its naming set according to the role).
150:             * @param javaName The java field name
151:             * @param embedded Whether the identifier is for a field embedded
152:             * @param fieldRole The role to be performed by this column e.g FK, Index ?
153:             * @return The DatastoreIdentifier
154:             */
155:            DatastoreIdentifier newDatastoreFieldIdentifier(String javaName,
156:                    boolean embedded, int fieldRole);
157:
158:            /**
159:             * Method to generate an identifier name for reference field, based on the metadata for the
160:             * field, and the ClassMetaData for the implementation.
161:             * @param refMetaData the MetaData for the reference field
162:             * @param implMetaData the AbstractClassMetaData for this implementation
163:             * @param implIdentifier PK identifier for the implementation
164:             * @param embedded Whether the identifier is for a field embedded
165:             * @param fieldRole The role to be performed by this column e.g FK, collection element ?
166:             * @return The DatastoreIdentifier
167:             */
168:            DatastoreIdentifier newReferenceFieldIdentifier(
169:                    AbstractMemberMetaData refMetaData,
170:                    AbstractClassMetaData implMetaData,
171:                    DatastoreIdentifier implIdentifier, boolean embedded,
172:                    int fieldRole);
173:
174:            /**
175:             * Method to return an identifier for a discriminator datastore field.
176:             * @return The discriminator datastore field identifier
177:             */
178:            DatastoreIdentifier newDiscriminatorFieldIdentifier();
179:
180:            /**
181:             * Method to return an identifier for a version datastore field.
182:             * @return The version datastore field identifier
183:             */
184:            DatastoreIdentifier newVersionFieldIdentifier();
185:
186:            /**
187:             * Method to return a new Identifier based on the passed identifier, but adding on the passed suffix
188:             * @param identifier The current identifier
189:             * @param suffix The suffix
190:             * @return The new identifier
191:             */
192:            DatastoreIdentifier newIdentifier(DatastoreIdentifier identifier,
193:                    String suffix);
194:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.