org.opensubsystems.patterns.mappeddata.persist.db.mssql
Class MSSQLMappingDatabaseSchema

java.lang.Object
  extended by org.opensubsystems.core.persist.db.DatabaseSchemaImpl
      extended by org.opensubsystems.core.persist.db.ModifiableDatabaseSchemaImpl
          extended by org.opensubsystems.patterns.mappeddata.persist.db.MappingDatabaseSchema
              extended by org.opensubsystems.patterns.mappeddata.persist.db.mssql.MSSQLMappingDatabaseSchema
All Implemented Interfaces:
org.opensubsystems.core.persist.db.DatabaseOperations, org.opensubsystems.core.persist.db.DatabaseSchema, org.opensubsystems.core.persist.db.ModifiableDatabaseSchema

public class MSSQLMappingDatabaseSchema
extends MappingDatabaseSchema

Database specific operations related to persistence of mapping tables for MS SQL Server 2000 database.

Version:
$Id: MSSQLMappingDatabaseSchema.java,v 1.9 2007/01/07 06:14:57 bastafidli Exp $
Author:
Julian Legeny
Code reviewer:
Miro Halas
Code reviewed:
1.7 2006/08/14 22:42:40 jlegeny

Field Summary
 
Fields inherited from class org.opensubsystems.patterns.mappeddata.persist.db.MappingDatabaseSchema
m_schema1, m_schema2, m_strColumnName1, m_strColumnName2, m_strConstraintBody, m_strMapTableName, m_strTableName1, m_strTableName2, MAPPING_CUSTOM_DATA_MAXLENGTH, MAPPING_SCHEMA_COLUMN1, MAPPING_SCHEMA_COLUMN2, MAPPING_SCHEMA_NAME, MAPPING_SCHEMA_VERSION
 
Fields inherited from class org.opensubsystems.core.persist.db.ModifiableDatabaseSchemaImpl
m_mapModifiableTableNames
 
Fields inherited from class org.opensubsystems.core.persist.db.DatabaseSchemaImpl
DATABASE_SCHEMA_PREFIX, DATABASE_SCHEMA_PREFIX_DEFAULT, m_arrDependentSchemas, m_bIsInDomain, m_iSchemaVersion, m_strSchemaName, NL
 
Fields inherited from interface org.opensubsystems.core.persist.db.DatabaseOperations
DBOP_DELETE, DBOP_INSERT, DBOP_SELECT, DBOP_UPDATE
 
Constructor Summary
MSSQLMappingDatabaseSchema(java.lang.String strMapTableName, java.lang.Class schema1, java.lang.String strTableName1, java.lang.String strColumnName1, java.lang.Class schema2, java.lang.String strTableName2, java.lang.String strColumnName2)
          Full constructor.
 
Method Summary
static java.lang.String constructInsertStoredProc(java.lang.String strUserName, java.lang.String strMapTableName)
          Construt SQL command for stored procedure that process inserting data.
static java.lang.String constructUpdateStoredProc(java.lang.String strUserName, java.lang.String strMapTableName)
          Construt SQL command for stored procedure that process inserting data.
 void create(java.sql.Connection cntDBConnection, java.lang.String strUserName)
          
 MappedData insertMappedData(java.sql.Connection dbConnection, MappedData data)
          Insert MappedData to the database and return the generated values.
 MappedData updateMappedData(java.sql.Connection dbConnection, MappedData data)
          Update MappedData in the database and return the generated values.
 
Methods inherited from class org.opensubsystems.patterns.mappeddata.persist.db.MappingDatabaseSchema
constructConstraintName, constructSQL, geSelectMappingMultipleRecords, geSelectMappingRecords, getColumns, getDatabaseSpecificInstance, getDeleteMappedDataById, getDeleteMappingRecord, getInsertMappingRecord, getSelectMappedDataById, handleInsertMappedDataException, handleUpdateMappedDataException
 
Methods inherited from class org.opensubsystems.core.persist.db.ModifiableDatabaseSchemaImpl
deleteRelatedData, getModifiableTableNames, handleSQLException
 
Methods inherited from class org.opensubsystems.core.persist.db.DatabaseSchemaImpl
getDependentSchemas, getJoinFromWhere, getName, getOwnerColumnNames, getSchemaPrefix, getVersion, isExistingIndex, isInDomain, upgrade, upgradeView
 
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
getDependentSchemas, getName, getVersion, isInDomain, upgrade
 

Constructor Detail

MSSQLMappingDatabaseSchema

public MSSQLMappingDatabaseSchema(java.lang.String strMapTableName,
                                  java.lang.Class schema1,
                                  java.lang.String strTableName1,
                                  java.lang.String strColumnName1,
                                  java.lang.Class schema2,
                                  java.lang.String strTableName2,
                                  java.lang.String strColumnName2)
                           throws org.opensubsystems.core.error.OSSException
Full constructor.

Parameters:
strMapTableName - - table name for mapping table
schema1 - - schema name the table 1 was defined in
strTableName1 - - name of the table 1
strColumnName1 - - name of the column 1
schema2 - - schema name the table 2 was defined in
strTableName2 - - name of the table 2
strColumnName2 - - name of the column 2
Throws:
org.opensubsystems.core.error.OSSException - - an error has occured
Method Detail

create

public void create(java.sql.Connection cntDBConnection,
                   java.lang.String strUserName)
            throws java.sql.SQLException,
                   org.opensubsystems.core.error.OSSException

Specified by:
create in interface org.opensubsystems.core.persist.db.DatabaseSchema
Overrides:
create in class MappingDatabaseSchema
Throws:
java.sql.SQLException
org.opensubsystems.core.error.OSSException

insertMappedData

public MappedData insertMappedData(java.sql.Connection dbConnection,
                                   MappedData data)
                            throws org.opensubsystems.core.error.OSSException
Insert MappedData to the database and return the generated values.

Overrides:
insertMappedData in class MappingDatabaseSchema
Parameters:
dbConnection - - database connection
data - - MappedData to insert
Returns:
MappedData - the same instance updated with generated values
Throws:
org.opensubsystems.core.error.OSSException - - an error has occured

updateMappedData

public MappedData updateMappedData(java.sql.Connection dbConnection,
                                   MappedData data)
                            throws org.opensubsystems.core.error.OSSException
Update MappedData in the database and return the generated values.

Overrides:
updateMappedData in class MappingDatabaseSchema
Parameters:
dbConnection - - database connection
data - - MappedData to update
Returns:
MappedData - the same instance updated with generated values
Throws:
org.opensubsystems.core.error.OSSException - - an error has occured

constructInsertStoredProc

public static java.lang.String constructInsertStoredProc(java.lang.String strUserName,
                                                         java.lang.String strMapTableName)
Construt SQL command for stored procedure that process inserting data.

Parameters:
strMapTableName - - table name
strUserName - - user name
Returns:
String - constructed command of insert stored procedure

constructUpdateStoredProc

public static java.lang.String constructUpdateStoredProc(java.lang.String strUserName,
                                                         java.lang.String strMapTableName)
Construt SQL command for stored procedure that process inserting data.

Parameters:
strMapTableName - - table name
strUserName - - user name
Returns:
String - constructed command of insert stored procedure


Copyright © 2003 - 2006 OpenSubsystems s.r.o.