|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.jpox.store.rdbms.RDBMSStoreHelper
Provides a series of uilities assisting in the datastore management process for RDBMS datastores.
Field Summary | |
static int |
TABLE_IDENTIFIER_COLUMN
|
Constructor Summary | |
RDBMSStoreHelper()
|
Method Summary | |
static AbstractClassMetaData |
getClassMetaDataManagingTableForClass(AbstractClassMetaData cmd)
Utility to find the ClassMetaData for the class that manages the table where the supplied class stores its fields. |
static java.lang.String |
getClassNameForIdKeyUsingDiscriminator(PersistenceManager pm,
RDBMSManager storeMgr,
java.lang.Object id,
java.util.List schemaDataOptions)
Utility that takes an id and a list of possible class RDBMSStoreData and finds which of these classes contains the object with that id. |
static java.lang.String |
getClassNameForIdKeyUsingUnion(PersistenceManager pm,
RDBMSManager storeMgr,
java.lang.Object id,
java.util.List schemaDataOptions)
Utility that takes an id and a list of possible class RDBMSStoreData and finds which of these classes contains the object with that id. |
static ColumnInfo |
getColumnInfoForColumnName(RDBMSManager storeMgr,
Table table,
java.sql.Connection conn,
DatastoreIdentifier column)
Returns the column info for a database table. |
static java.util.List |
getColumnInfoForTable(RDBMSManager storeMgr,
Table table,
java.sql.Connection conn)
Returns the column info for a database table. |
static java.util.List |
getForeignKeyInfoForTable(RDBMSManager storeMgr,
Table table,
java.sql.Connection conn)
Returns the foreign key info for a database table. |
static java.lang.String |
getFullyQualifiedTableName(RDBMSAdapter dba,
java.lang.String catalog,
java.lang.String schema,
java.lang.String table)
Method to return a name for a table, fully qualified by catalog/schema if the adapter supports it and if specified. |
static java.util.List |
getTableInfo(RDBMSManager storeMgr,
java.lang.String catalogName,
java.lang.String schemaName,
java.sql.Connection conn)
Returns the table info. |
static int |
getTableType(RDBMSManager storeMgr,
Table table,
java.sql.Connection conn)
Returns the type of a database table in the datastore. |
static java.lang.String[] |
splitColumnIdentifierName(java.lang.String separator,
java.lang.String name)
Method to split a fully-qualified database column name into its constituent parts (CATALOG.SCHEMA.TABLE.COLUMN). |
static java.lang.String[] |
splitTableIdentifierName(java.lang.String separator,
java.lang.String name)
Method to split a fully-qualified database table name into its constituent parts (CATALOG.SCHEMA.TABLE). |
static java.lang.String |
stringWithoutIdentifierQuotes(RDBMSAdapter dba,
java.lang.String identifier)
Convenience method to remove any identifier quotes from the passed (SQL) identifier. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final int TABLE_IDENTIFIER_COLUMN
Constructor Detail |
public RDBMSStoreHelper()
Method Detail |
public static int getTableType(RDBMSManager storeMgr, Table table, java.sql.Connection conn) throws java.sql.SQLException
storeMgr
- Manager for the storetable
- The table/viewconn
- Connection to the database.
Table
.
java.sql.SQLException
Table
public static java.util.List getColumnInfoForTable(RDBMSManager storeMgr, Table table, java.sql.Connection conn) throws java.sql.SQLException
storeMgr
- The RDBMSManagertable
- The table/viewconn
- Connection to the datastore
java.sql.SQLException
ColumnInfo
public static java.util.List getTableInfo(RDBMSManager storeMgr, java.lang.String catalogName, java.lang.String schemaName, java.sql.Connection conn) throws java.sql.SQLException
storeMgr
- The RDBMSManagercatalogName
- The catalog nameschemaName
- The schema nameconn
- Connection to the datastore
java.sql.SQLException
TableInfo
public static ColumnInfo getColumnInfoForColumnName(RDBMSManager storeMgr, Table table, java.sql.Connection conn, DatastoreIdentifier column) throws java.sql.SQLException
storeMgr
- The RDBMSManagertable
- The table/viewconn
- Connection to the datastorecolumn
- The column
java.sql.SQLException
ColumnInfo
public static java.lang.String stringWithoutIdentifierQuotes(RDBMSAdapter dba, java.lang.String identifier)
dba
- Database adapter being usedidentifier
- The identifier string
public static java.util.List getForeignKeyInfoForTable(RDBMSManager storeMgr, Table table, java.sql.Connection conn) throws java.sql.SQLException
storeMgr
- Manager of the storetable
- The tableconn
- Connection to the datastore
java.sql.SQLException
ForeignKeyInfo
public static java.lang.String[] splitTableIdentifierName(java.lang.String separator, java.lang.String name)
separator
- Separator charactername
- The fully qualified name.
public static java.lang.String[] splitColumnIdentifierName(java.lang.String separator, java.lang.String name)
separator
- Separator charactername
- The fully qualified name.
public static final java.lang.String getFullyQualifiedTableName(RDBMSAdapter dba, java.lang.String catalog, java.lang.String schema, java.lang.String table)
dba
- the RDBMSAdaptercatalog
- the catalog identifierschema
- the schema identifiertable
- the table identifier
public static java.lang.String getClassNameForIdKeyUsingUnion(PersistenceManager pm, RDBMSManager storeMgr, java.lang.Object id, java.util.List schemaDataOptions)
pm
- Persistence ManagerstoreMgr
- Store Managerid
- The idschemaDataOptions
- List of possible RDBMSStoreData
public static java.lang.String getClassNameForIdKeyUsingDiscriminator(PersistenceManager pm, RDBMSManager storeMgr, java.lang.Object id, java.util.List schemaDataOptions)
pm
- Persistence ManagerstoreMgr
- Store Managerid
- The idschemaDataOptions
- List of possible RDBMSStoreData
public static AbstractClassMetaData getClassMetaDataManagingTableForClass(AbstractClassMetaData cmd)
cmd
- The meta data for this class.
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |