|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectorg.objectweb.cjdbc.common.sql.schema.DatabaseSchema
A DatabaseSchema describes all the tables and columns of a
database.
| Field Summary | |
private java.util.ArrayList |
procedures
ArrayList of DatabaseProcedures. |
private java.util.ArrayList |
tables
ArrayList of DatabaseTables. |
| Constructor Summary | |
DatabaseSchema()
Creates a new DatabaseSchema instance. |
|
DatabaseSchema(DatabaseSchema schema)
Creates a new DatabaseSchema instance from an existing
database schema (the schema is cloned). |
|
DatabaseSchema(int nbOfTables)
Creates a new DatabaseSchema instance with a specified
number of tables. |
|
| Method Summary | |
void |
addProcedure(DatabaseProcedure procedure)
Adds a DatabaseProcedure describing a procedure of the
database. |
void |
addTable(DatabaseTable table)
Adds a DatabaseTable describing a table of the database. |
boolean |
equals(java.lang.Object other)
Two DatabaseSchema are considered equal if they have the
same tables and the same procedures. |
DatabaseProcedure |
getProcedure(java.lang.String procedureName)
Returns the DatabaseProcedure object matching the given
procedure name or null if not found. |
java.util.ArrayList |
getProcedures()
Returns an ArrayList of DatabaseProcedure
objects describing the database. |
DatabaseTable |
getTable(java.lang.String tableName)
Returns the DatabaseTable object matching the given table
name or null if not found. |
DatabaseTable |
getTable(java.lang.String tableName,
boolean isCaseSensitive)
Returns the DatabaseTable object matching the given table
name or null if not found. |
java.util.ArrayList |
getTables()
Returns an ArrayList of DatabaseTable objects
describing the database. |
java.lang.String |
getXml()
Get xml information about this schema. |
boolean |
hasProcedure(java.lang.String procedureName)
Returns true if the given ProcedureName is
found in this schema. |
boolean |
hasTable(java.lang.String tableName)
Returns true if the given TableName is found
in this schema. |
boolean |
isCompatibleSubset(DatabaseSchema other)
Checks if this DatabaseSchema is a compatible subset of a
given schema. |
boolean |
isCompatibleWith(DatabaseSchema other)
Checks if this DatabaseSchema is compatible with the given
schema. |
void |
mergeSchema(DatabaseSchema databaseSchema)
Merges the given schema with the current one. |
void |
removeProcedure(DatabaseProcedure procedure)
removes a DatabaseProcedure describing a procedure of the
database. |
void |
removeTable(DatabaseTable table)
Removes a DatabaseTable describing a table of the database. |
| Methods inherited from class java.lang.Object |
clone, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
private java.util.ArrayList tables
ArrayList of DatabaseTables.
private java.util.ArrayList procedures
ArrayList of DatabaseProcedures.
| Constructor Detail |
public DatabaseSchema()
DatabaseSchema instance.
public DatabaseSchema(int nbOfTables)
DatabaseSchema instance with a specified
number of tables.
nbOfTables - an int valuepublic DatabaseSchema(DatabaseSchema schema)
DatabaseSchema instance from an existing
database schema (the schema is cloned).
schema - the existing database schema| Method Detail |
public void addTable(DatabaseTable table)
DatabaseTable describing a table of the database.
table - the table to addpublic void addProcedure(DatabaseProcedure procedure)
DatabaseProcedure describing a procedure of the
database.
procedure - the procedure to addpublic void removeTable(DatabaseTable table)
DatabaseTable describing a table of the database.
table - the table to removepublic void removeProcedure(DatabaseProcedure procedure)
DatabaseProcedure describing a procedure of the
database.
procedure - to remove
public void mergeSchema(DatabaseSchema databaseSchema)
throws java.sql.SQLException
databaseSchema - the schema to merge
java.sql.SQLException - if the schemas conflictpublic java.util.ArrayList getTables()
ArrayList of DatabaseTable objects
describing the database.
ArrayList of DatabaseTablepublic java.util.ArrayList getProcedures()
ArrayList of DatabaseProcedure
objects describing the database.
ArrayList of DatabaseProcedurepublic DatabaseTable getTable(java.lang.String tableName)
DatabaseTable object matching the given table
name or null if not found.
tableName - the table name to look for
DatabaseTable value or nullpublic DatabaseProcedure getProcedure(java.lang.String procedureName)
DatabaseProcedure object matching the given
procedure name or null if not found.
procedureName - the procedure name to look for
DatabaseProcedure value or null
public DatabaseTable getTable(java.lang.String tableName,
boolean isCaseSensitive)
DatabaseTable object matching the given table
name or null if not found. An extra boolean indicates if
table name matching is case sensitive or not.
tableName - the table name to look forisCaseSensitive - true if name matching must be case sensitive
DatabaseTable value or nullpublic boolean hasTable(java.lang.String tableName)
true if the given TableName is found
in this schema.
tableName - the name of the table you are looking for
true if the table has been foundpublic boolean hasProcedure(java.lang.String procedureName)
true if the given ProcedureName is
found in this schema.
procedureName - the name of the procedure you are looking for
true if the procedure has been foundpublic boolean isCompatibleSubset(DatabaseSchema other)
DatabaseSchema is a compatible subset of a
given schema. It means that all tables in this schema must be present with
the same definition in the other schema.
other - the object to compare with
true if the two schemas are compatiblepublic boolean isCompatibleWith(DatabaseSchema other)
DatabaseSchema is compatible with the given
schema. It means that all tables in this schema that are common with the
other schema must be identical.
other - the object to compare with
true if the two schemas are compatiblepublic boolean equals(java.lang.Object other)
DatabaseSchema are considered equal if they have the
same tables and the same procedures.
other - the object to compare with
true if the schemas are equalspublic java.lang.String getXml()
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||