|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.opensubsystems.core.persist.db.DatabaseSchemaImpl
public abstract class DatabaseSchemaImpl
Base class implementation for database schemas that provides the common functionality needed by all schemas that allow to read data from the tables managed by this schema.
| Field Summary | |
|---|---|
static java.lang.String |
DATABASE_SCHEMA_PREFIX
Name of the property that can specify default prefix to use for database objects. |
static java.lang.String |
DATABASE_SCHEMA_PREFIX_DEFAULT
Default prefix to use for database objects. |
protected DatabaseSchema[] |
m_arrDependentSchemas
Array of dependent schemas. |
protected boolean |
m_bIsInDomain
Flag signaling if object is in domain. |
protected int |
m_iSchemaVersion
Version of the schema. |
protected java.lang.String |
m_strSchemaName
Name of the schema. |
static java.lang.String |
NL
New line constant which should be used when creating any table or stored procedure in the database. |
| Fields inherited from interface org.opensubsystems.core.persist.db.DatabaseOperations |
|---|
DBOP_DELETE, DBOP_INSERT, DBOP_SELECT, DBOP_UPDATE |
| Constructor Summary | |
|---|---|
DatabaseSchemaImpl(DatabaseSchema[] arrDependentSchemas,
java.lang.String strSchemaName,
int iSchemaVersion,
boolean bIsInDomain)
Constructor allowing to specify attributes for database schema that doesn't provide any operations that would modify any of the tables it is accessing. |
|
| Method Summary | |
|---|---|
DatabaseSchema[] |
getDependentSchemas()
Get list of database schemas which this schema depends on. |
java.lang.String[] |
getJoinFromWhere(java.util.List conditions,
int[] columns)
Create SQL query fragments, which can be used to create database join between multiple database tables. |
java.lang.String |
getName()
Get the name of this database schema. |
protected java.lang.String[] |
getOwnerColumnNames()
Deprecated. |
static java.lang.String |
getSchemaPrefix()
Get prefix which should be used to construct database objects. |
int |
getVersion()
Get the current (most recent) version of database schema. |
void |
handleSQLException(java.sql.SQLException exc,
java.sql.Connection dbConnection,
int iOperationType,
int iDataType,
java.lang.Object data)
Handle SQL Exception caused by some database operations. |
boolean |
isExistingIndex(java.lang.String strIndexName)
Check if index with the specified name exists within this schema. |
boolean |
isInDomain()
Check if the the data object belongs to a domain or not. |
void |
upgrade(java.sql.Connection cntDBConnection,
java.lang.String strUserName,
int iOriginalVersion)
Upgrade the schema. |
protected void |
upgradeView(java.sql.Connection cntDBConnection,
java.lang.String strUserName,
int iOriginalVersion,
java.lang.String strViewName)
Upgrade the view by dropping it and recreating it again. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface org.opensubsystems.core.persist.db.DatabaseSchema |
|---|
create |
| Field Detail |
|---|
public static final java.lang.String DATABASE_SCHEMA_PREFIX
public static final java.lang.String DATABASE_SCHEMA_PREFIX_DEFAULT
public static final java.lang.String NL
protected DatabaseSchema[] m_arrDependentSchemas
protected java.lang.String m_strSchemaName
protected int m_iSchemaVersion
protected boolean m_bIsInDomain
| Constructor Detail |
|---|
public DatabaseSchemaImpl(DatabaseSchema[] arrDependentSchemas,
java.lang.String strSchemaName,
int iSchemaVersion,
boolean bIsInDomain)
throws OSSException
arrDependentSchemas - - array of dependent schemasstrSchemaName - - name of the schemaiSchemaVersion - - version of the schemabIsInDomain - - flag signaling if object is in domain
OSSException - - an error has occured| Method Detail |
|---|
public void upgrade(java.sql.Connection cntDBConnection,
java.lang.String strUserName,
int iOriginalVersion)
throws java.sql.SQLException
upgrade in interface DatabaseSchemacntDBConnection - - valid connection to databasestrUserName - - name of user who will be accessing this tableiOriginalVersion - - original version from which to upgrade
java.sql.SQLException - - problem creating the database schema
public java.lang.String[] getJoinFromWhere(java.util.List conditions,
int[] columns)
conditions - - list of DataConditions, which may represent search
criterias in multiple tables which may need to be joinedcolumns - - columns we are trying to retrieve
public boolean isExistingIndex(java.lang.String strIndexName)
strIndexName - - name of the index existency of which we want to check
public static java.lang.String getSchemaPrefix()
protected void upgradeView(java.sql.Connection cntDBConnection,
java.lang.String strUserName,
int iOriginalVersion,
java.lang.String strViewName)
throws java.sql.SQLException,
OSSException
cntDBConnection - - valid connection to databasestrUserName - - name of user who will be accessing this tableiOriginalVersion - - original version from which to upgradestrViewName - - view to upgrade
java.sql.SQLException - - problem creating the database schema
OSSException - - problem creating the database schemaprotected final java.lang.String[] getOwnerColumnNames()
public boolean isInDomain()
isInDomain in interface DatabaseSchema
public DatabaseSchema[] getDependentSchemas()
throws OSSException
getDependentSchemas in interface DatabaseSchemaOSSException - - database cannot be started.public java.lang.String getName()
getName in interface DatabaseSchemapublic int getVersion()
getVersion in interface DatabaseSchema
public void handleSQLException(java.sql.SQLException exc,
java.sql.Connection dbConnection,
int iOperationType,
int iDataType,
java.lang.Object data)
throws OSSException
handleSQLException in interface DatabaseSchemaexc - - sql exception to be handleddbConnection - - database connection used when the exception occurediOperationType - - type of the operation that caused the exception,
see DatabaseOperations for possible valuesiDataType - - data type the data object represents (e.g if this is
type user and data is Integer, that means it is id
of user object). This is one of the DataConstant
constants.data - - data object the exception is handled for
OSSException - - problem handling exception
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||