|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectfedora.server.utilities.TableSpec
Title: TableSpec.java
Description: A holder of table specification information that helps in producing RDBMS-generic DDL "CREATE TABLE" commands.
An application constructs a TableSpec without regard to the underlying database kind, and then the TableSpec is converted to a DB-specific CREATE TABLE DDL command by a DDLConverter before the command is issued via JDBC.
-----------------------------------------------------------------------------License and Copyright: The contents of this file are subject to the Mozilla Public License Version 1.1 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.mozilla.org/MPL/.
Software distributed under the License is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for the specific language governing rights and limitations under the License.
The entire file consists of original code. Copyright © 2002-2005 by The Rector and Visitors of the University of Virginia and Cornell University. All rights reserved.
-----------------------------------------------------------------------------
| Constructor Summary | |
TableSpec(java.lang.String name,
java.util.List columnSpecs,
java.lang.String primaryColumnName)
Constructs a TableSpec given a name, a set of ColumnSpecs, and the name of the primary key column. |
|
TableSpec(java.lang.String name,
java.util.List columnSpecs,
java.lang.String primaryColumnName,
java.lang.String type)
Constructs a TableSpec given a name, a set of ColumnSpecs, the name of the primary key column, and a table type. |
|
| Method Summary | |
void |
assertConsistent()
Ensures that the TableSpec is internally consistent. |
java.util.Iterator |
columnSpecIterator()
Gets an iterator over the columns. |
java.lang.String |
getName()
Gets the name of the table. |
java.lang.String |
getPrimaryColumnName()
Gets the name of the primary key column. |
static java.util.List |
getTableSpecs(java.io.InputStream in)
Gets a TableSpec for each table element in the stream, where the stream contains a valid XML document containing one or more table elements, wrapped in the root element. |
java.lang.String |
getType()
Gets the type of the table. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
public TableSpec(java.lang.String name,
java.util.List columnSpecs,
java.lang.String primaryColumnName)
throws InconsistentTableSpecException
name - The table name.columnSpecs - ColumnSpec objects describing columns in the table.primaryColumnName - The column that is the primary key for the table.
InconsistentTableSpecException - if inconsistencies are detected in
table specifications.
public TableSpec(java.lang.String name,
java.util.List columnSpecs,
java.lang.String primaryColumnName,
java.lang.String type)
throws InconsistentTableSpecException
name - The table name.columnSpecs - ColumnSpec objects describing columns in the table.primaryColumnName - The column that is the primary key for the table.type - The table type.
InconsistentTableSpecException - if inconsistencies are detected in
table specifications.| Method Detail |
public static java.util.List getTableSpecs(java.io.InputStream in)
throws InconsistentTableSpecException,
java.io.IOException
<database>
<table name="tableName" primaryKey="primaryColumnName" type="tableType">
<column name="columnName"
type="typeSpec"
autoIncrement="isAutoIncremented"
index="indexName"
notNull="isNotNull"
unique="isUnique"
default="defaultValue"
foreignKey="foreignTableName.columnName onDeleteAction"/>
</table>
</database>
About the attributes:
in - The xml-encoded table specs.
InconsistentTableSpecException - if inconsistencies are detected in
table specifications.
java.io.IOException - if an IO error occurs.
public void assertConsistent()
throws InconsistentTableSpecException
InconsistentTableSpecException - If it's inconsistent.public java.lang.String getName()
public java.lang.String getPrimaryColumnName()
public java.lang.String getType()
public java.util.Iterator columnSpecIterator()
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||