org.eclipse.datatools.modelbase.sql.schema.helper
Class DatabaseHelper
java.lang.Object
   org.eclipse.datatools.modelbase.sql.schema.helper.DatabaseHelper
org.eclipse.datatools.modelbase.sql.schema.helper.DatabaseHelper
- public class DatabaseHelper 
- extends java.lang.Object
- Author:
- ckadner
 Helper to provide convenience methods that are related to 
 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
 Schemaby its name in a givenDatabase. | 
| static java.util.List | findTables(Database database,
           java.lang.String tableName)Finds all
 Tables with the nametableNamein allSchema's of the givendatabase. | 
 
| 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 Schemaby its name in a givenDatabase.
 If the givenschemaNameis not delimited, the
 search is not case sensitive.
 
- 
- Parameters:
- database- the- Databaseto find- Schemas in
- schemaName- the String name of the- Schemato find
- Returns:
- the Schemafound ornullif no 
                correspondingSchemawas found
- Throws:
- java.lang.NullPointerException- if given- databaseor given- schemaNameis- null
 
findTables
public static java.util.List findTables(Database database,
                                        java.lang.String tableName)
- Finds all Tables with the nametableNamein allSchema's of the givendatabase.
 Returns a list ofTables with associatedSchema.
 If the giventableNameis not delimited, the
 search is not case sensitive.
 
- 
- Parameters:
- database- the- Databaseto search in
- tableName- the String name of the- Tableto find
- Returns:
- List of Tables with associatedSchema
- Throws:
- java.lang.NullPointerException- if given- schemaor given- tableNameis- 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 identifiers
- identifier- a String identifier already existing in the Database
- lookupName- the String name to compare to a existing identifier
- Returns:
- 0 if lookupName is equal to identifier
- See Also:
- String.compareTo(java.lang.String)