org.eclipse.wst.rdb.internal.models.sql.schema.helper
Class DatabaseHelper
java.lang.Object
|
+--org.eclipse.wst.rdb.internal.models.sql.schema.helper.DatabaseHelper
- public class DatabaseHelper
- extends java.lang.Object
- Author:
- ckadner
Helper to provide convenience methods that are related to
com.ibm.db.models.sql.schema.Database
.
Method Summary |
static int |
compareIdentifiers(Database database,
java.lang.String identifier,
java.lang.String lookupName)
Compares an existing identifier in a Database with the lookup name
respecting delimited identifiers otherwise ignoring case. |
static Schema |
findSchema(Database database,
java.lang.String schemaName)
Finds a Schema by its name in a given Database . |
static java.util.List |
findTables(Database database,
java.lang.String tableName)
Finds all Table s with the name tableName in all
Schema 's of the given database . |
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
DatabaseHelper
public DatabaseHelper()
findSchema
public static Schema findSchema(Database database,
java.lang.String schemaName)
- Finds a
Schema
by its name in a given Database
.
If the given schemaName
is not delimited, the
search is not case sensitive.
- Parameters:
database
- the Database
to find Schema
s inschemaName
- the String name of the Schema
to find- Returns:
- the
Schema
found or null
if no
corresponding Schema
was found - Throws:
NullPointerException
- if given database
or given
schemaName
is null
findTables
public static java.util.List findTables(Database database,
java.lang.String tableName)
- Finds all
Table
s with the name tableName
in all
Schema
's of the given database
.
Returns a list of Table
s with associated Schema
.
If the given tableName
is not delimited, the
search is not case sensitive.
- Parameters:
database
- the Database
to search intableName
- the String name of the Table
to find- Returns:
- List of
Table
s with associated Schema
- Throws:
NullPointerException
- if given schema
or given
tableName
is null
compareIdentifiers
public static int compareIdentifiers(Database database,
java.lang.String identifier,
java.lang.String lookupName)
- Compares an existing identifier in a Database with the lookup name
respecting delimited identifiers otherwise ignoring case.
- Parameters:
database
- the Database to determin the delimiter for identifiersidentifier
- a String identifier already existing in the DatabaselookupName
- the String name to compare to a existing identifier- Returns:
- 0 if lookupName is equal to identifier
- See Also:
String.compareTo(java.lang.String)