|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.eclipse.datatools.sqltools.sql.util.ModelUtil
public class ModelUtil
Utility class to resolve the SQL model object relationships or convert SQL model into classes required by SQL Dev Tools.
Field Summary | |
---|---|
static java.lang.String |
EVENT_FOLDER_CLASS
|
Constructor Summary | |
---|---|
ModelUtil()
|
Method Summary | |
---|---|
static boolean |
equals(java.lang.String object1,
java.lang.String object2,
boolean caseSensitive)
|
static boolean |
equalsIgnoreNull(java.lang.String object1,
java.lang.String object2,
boolean caseSensitive)
Compares the two strings for equality. |
static SQLObject |
findProceduralObject(org.eclipse.datatools.sqltools.core.ProcIdentifier proc)
|
static SQLObject |
findProceduralObject(org.eclipse.datatools.sqltools.core.ProcIdentifier proc,
boolean refresh)
|
static SQLObject |
findProceduralObject(org.eclipse.datatools.sqltools.core.ProcIdentifier proc,
boolean refresh,
boolean caseSensitive)
|
static SQLObject |
findProceduralObject(org.eclipse.datatools.sqltools.core.ProcIdentifier proc,
boolean refresh,
boolean caseSensitive,
boolean ignoreTableName)
|
static Schema |
findSchema(Database database,
java.lang.String catalogName,
java.lang.String schemaName)
Returns the schema object with the given name |
static Table |
findTableInAllSchemas(org.eclipse.datatools.sqltools.core.DatabaseIdentifier dbid,
java.lang.String dbname,
java.lang.String tableName,
boolean caseSensitive,
boolean refresh)
|
static Table |
findTableObject(org.eclipse.datatools.sqltools.core.DatabaseIdentifier dbid,
java.lang.String dbname,
java.lang.String schemaName,
java.lang.String tableName)
This method is used to find the table object in existing SQL model. |
static Table |
findTableObject(org.eclipse.datatools.sqltools.core.DatabaseIdentifier dbid,
java.lang.String dbname,
java.lang.String schemaName,
java.lang.String tableName,
boolean refresh)
This method is used to find the table object in existing SQL model. |
static Table |
findTableObject(org.eclipse.datatools.sqltools.core.DatabaseIdentifier dbid,
java.lang.String dbname,
java.lang.String schemaName,
java.lang.String tableName,
boolean refresh,
boolean caseSensitive)
This method is used to find the table object in existing SQL model. |
static Table |
findTableObject(org.eclipse.datatools.sqltools.core.DatabaseIdentifier dbid,
java.lang.String dbname,
java.lang.String schemaName,
java.lang.String tableName,
boolean refresh,
boolean caseSensitive,
boolean findInAllCatalogs)
This method is used to find the table object in existing SQL model. |
static java.util.List |
getAuthorizationIdentifiers(SQLObject obj)
Returns all the authorization identifiers |
static Catalog |
getCatalog(org.eclipse.emf.ecore.EObject obj)
Returns the database name by taking catalog into account. |
static IConnectionProfile |
getConnectionProfile(Database database)
|
static Database |
getDatabase(Schema schema)
|
static DatabaseDefinition |
getDatabaseDefinition(SQLObject obj)
|
static java.lang.String |
getDatabaseName(org.eclipse.emf.ecore.EObject obj)
Returns the database name by taking catalog into account. |
static org.eclipse.datatools.sqltools.core.DatabaseVendorDefinitionId |
getDatabaseVendorDefinitionId(SQLObject obj)
|
static Schema |
getSchema(org.eclipse.emf.ecore.EObject obj)
Returns the schema by looking up parent in the containment service. |
static java.lang.String |
getSchemaName(org.eclipse.emf.ecore.EObject obj)
Returns the schema name by looking up parent in the containment service. |
static org.eclipse.emf.common.util.EList |
getSchemas(Database database,
java.lang.String catalogName)
Returns the schema list for the database, or, if catalog feature is supported, returns the schema list for the default catalog. |
static IDatatype |
map(DatabaseDefinition databaseDefinition,
DataType type,
java.lang.String owner)
|
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final java.lang.String EVENT_FOLDER_CLASS
Constructor Detail |
---|
public ModelUtil()
Method Detail |
---|
public static IDatatype map(DatabaseDefinition databaseDefinition, DataType type, java.lang.String owner)
public static SQLObject findProceduralObject(org.eclipse.datatools.sqltools.core.ProcIdentifier proc)
public static Database getDatabase(Schema schema)
public static java.lang.String getDatabaseName(org.eclipse.emf.ecore.EObject obj)
obj
-
public static Catalog getCatalog(org.eclipse.emf.ecore.EObject obj)
obj
-
public static java.lang.String getSchemaName(org.eclipse.emf.ecore.EObject obj)
-
public static Schema getSchema(org.eclipse.emf.ecore.EObject obj)
-
public static IConnectionProfile getConnectionProfile(Database database)
public static org.eclipse.emf.common.util.EList getSchemas(Database database, java.lang.String catalogName)
database
- catalogName
- uses same convention as JDBC DatabaseMetaData: null returns
all schema; catalog name returns schema for the specified
catalog; empty string returns schema not associated with a
specific catalog (use for DBs that do not support catalogs)
public static Schema findSchema(Database database, java.lang.String catalogName, java.lang.String schemaName)
public static DatabaseDefinition getDatabaseDefinition(SQLObject obj)
public static org.eclipse.datatools.sqltools.core.DatabaseVendorDefinitionId getDatabaseVendorDefinitionId(SQLObject obj)
public static java.util.List getAuthorizationIdentifiers(SQLObject obj)
authid
- obj
- used to locate the catalog or database
public static Table findTableObject(org.eclipse.datatools.sqltools.core.DatabaseIdentifier dbid, java.lang.String dbname, java.lang.String schemaName, java.lang.String tableName)
dbid
- dbname
- schemaName
- tableName
-
public static Table findTableObject(org.eclipse.datatools.sqltools.core.DatabaseIdentifier dbid, java.lang.String dbname, java.lang.String schemaName, java.lang.String tableName, boolean refresh)
dbid
- Database identifierdbname
- Database nameschemaName
- Schema nametableName
- Table namerefresh
- Refresh
public static Table findTableObject(org.eclipse.datatools.sqltools.core.DatabaseIdentifier dbid, java.lang.String dbname, java.lang.String schemaName, java.lang.String tableName, boolean refresh, boolean caseSensitive)
dbid
- Database identifierdbname
- Database nameschemaName
- Schema nametableName
- Table namerefresh
- Refreshcasesensivie
- Case sensitive when compare two objects
public static Table findTableObject(org.eclipse.datatools.sqltools.core.DatabaseIdentifier dbid, java.lang.String dbname, java.lang.String schemaName, java.lang.String tableName, boolean refresh, boolean caseSensitive, boolean findInAllCatalogs)
dbid
- Database identifierdbname
- Database nameschemaName
- Schema nametableName
- Table namerefresh
- Refreshcasesensivie
- Case sensitive when compare two objectsfindInAllCatalogs
- if true, find the table in all catalogs; otherwise just in current catalog
public static Table findTableInAllSchemas(org.eclipse.datatools.sqltools.core.DatabaseIdentifier dbid, java.lang.String dbname, java.lang.String tableName, boolean caseSensitive, boolean refresh)
public static SQLObject findProceduralObject(org.eclipse.datatools.sqltools.core.ProcIdentifier proc, boolean refresh)
proc
- refresh
- Whether to refresh the procedural object's parent folder
public static SQLObject findProceduralObject(org.eclipse.datatools.sqltools.core.ProcIdentifier proc, boolean refresh, boolean caseSensitive)
proc
- refresh
- Whether to refresh the procedural object's parent folder
public static SQLObject findProceduralObject(org.eclipse.datatools.sqltools.core.ProcIdentifier proc, boolean refresh, boolean caseSensitive, boolean ignoreTableName)
proc
- refresh
- Whether to refresh the procedural object's parent folder
public static boolean equals(java.lang.String object1, java.lang.String object2, boolean caseSensitive)
public static boolean equalsIgnoreNull(java.lang.String object1, java.lang.String object2, boolean caseSensitive)
null
the result is true
.
object1
- Thing 1object2
- Thing 2caseSensitive
- Specifies whether the comparison is case sensitive.
true
if the strings are equal or if either is
null
, false
otherwise.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |