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


001:        /**********************************************************************
002:        Copyright (c) 2006 Andy Jefferson 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:            ...
017:         **********************************************************************/package org.jpox.metadata;
018:
019:        import org.jpox.util.StringUtils;
020:
021:        /**
022:         * Representation of the MetaData of a TableGenerator (JPA).
023:         *
024:         * @since 1.1
025:         * @version $Revision: 1.5 $
026:         */
027:        public class TableGeneratorMetaData extends MetaData {
028:            /** Name under which this table generator is known. */
029:            protected final String name;
030:
031:            /** Name of the table to use for sequences */
032:            protected String tableName;
033:
034:            /** Name of the catalog to use for the table */
035:            protected String catalogName;
036:
037:            /** Name of the schema to use for the table */
038:            protected String schemaName;
039:
040:            /** Name of the primary-key column name */
041:            protected String pkColumnName;
042:
043:            /** Name of the value column name */
044:            protected String valueColumnName;
045:
046:            /** Name of the primary-key column value */
047:            protected String pkColumnValue;
048:
049:            /** Initial value in the table. */
050:            protected long initialValue = 0;
051:
052:            /** Allocation size for ids from the table. */
053:            protected long allocationSize = 50;
054:
055:            /**
056:             * Constructor.
057:             * @param parent The parent of this element
058:             * @param name The generator name
059:             * @param tableName The table name
060:             * @param catalogName Catalog name for the table
061:             * @param schemaName Schema name for the table
062:             * @param pkColumnName Name of PK column in table
063:             * @param valueColumnName Name of value column in table
064:             * @param pkColumnValue Value of the pk in the table
065:             * @param initialValue Initial value
066:             * @param allocationSize Allocation size
067:             */
068:            public TableGeneratorMetaData(final MetaData parent,
069:                    final String name, final String tableName,
070:                    final String catalogName, final String schemaName,
071:                    final String pkColumnName, final String valueColumnName,
072:                    final String pkColumnValue, final String initialValue,
073:                    final String allocationSize) {
074:                super (parent);
075:
076:                if (StringUtils.isWhitespace(name)) {
077:                    throw new InvalidMetaDataException(LOCALISER, "044155");
078:                }
079:
080:                this .name = name;
081:                this .tableName = (StringUtils.isWhitespace(tableName) ? null
082:                        : tableName);
083:                this .catalogName = (StringUtils.isWhitespace(catalogName) ? null
084:                        : catalogName);
085:                this .schemaName = (StringUtils.isWhitespace(schemaName) ? null
086:                        : schemaName);
087:                this .pkColumnName = (StringUtils.isWhitespace(pkColumnName) ? null
088:                        : pkColumnName);
089:                this .valueColumnName = (StringUtils
090:                        .isWhitespace(valueColumnName) ? null : valueColumnName);
091:                this .pkColumnValue = (StringUtils.isWhitespace(pkColumnValue) ? null
092:                        : pkColumnValue);
093:                if (!StringUtils.isWhitespace(initialValue)) {
094:                    this .initialValue = new Long(initialValue).longValue();
095:                }
096:                if (!StringUtils.isWhitespace(allocationSize)) {
097:                    this .allocationSize = new Long(allocationSize).longValue();
098:                }
099:            }
100:
101:            /**
102:             * Convenience accessor for the fully-qualified name of the sequence.
103:             * @return Fully qualfiied name of the sequence (including the package name).
104:             */
105:            public String getFullyQualifiedName() {
106:                PackageMetaData pmd = (PackageMetaData) getParent();
107:                return pmd.getName() + "." + name;
108:            }
109:
110:            /**
111:             * Accessor for the generator name.
112:             * @return generator name
113:             */
114:            public String getName() {
115:                return name;
116:            }
117:
118:            /**
119:             * Accessor for the table name.
120:             * @return table name
121:             */
122:            public String getTableName() {
123:                return tableName;
124:            }
125:
126:            /**
127:             * Accessor for the catalog name.
128:             * @return catalog name
129:             */
130:            public String getCatalogName() {
131:                return catalogName;
132:            }
133:
134:            /**
135:             * Accessor for the schema name.
136:             * @return schema name
137:             */
138:            public String getSchemaName() {
139:                return schemaName;
140:            }
141:
142:            /**
143:             * Accessor for the PK column name.
144:             * @return PK column name
145:             */
146:            public String getPKColumnName() {
147:                return pkColumnName;
148:            }
149:
150:            /**
151:             * Accessor for the value column name.
152:             * @return Value column name
153:             */
154:            public String getValueColumnName() {
155:                return valueColumnName;
156:            }
157:
158:            /**
159:             * Accessor for the PK column value.
160:             * @return PK column value
161:             */
162:            public String getPKColumnValue() {
163:                return pkColumnValue;
164:            }
165:
166:            /**
167:             * Accessor for the initial value of the sequence.
168:             * @return The initial value
169:             */
170:            public long getInitialValue() {
171:                return initialValue;
172:            }
173:
174:            /**
175:             * Accessor for the allocation size of the sequence.
176:             * @return The allocation size
177:             */
178:            public long getAllocationSize() {
179:                return allocationSize;
180:            }
181:
182:            /**
183:             * Returns a string representation of the object.
184:             * @param prefix prefix string
185:             * @param indent indent string
186:             * @return a string representation of the object.
187:             */
188:            public String toString(String prefix, String indent) {
189:                StringBuffer sb = new StringBuffer();
190:                sb.append(prefix).append(
191:                        "<table-generator name=\"" + name + "\"\n");
192:
193:                // Add extensions
194:                sb.append(super .toString(prefix + indent, indent));
195:
196:                sb.append(prefix + "</table-generator>\n");
197:                return sb.toString();
198:            }
199:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.