Class AbstractORContainer

java.lang.Object
com.softwaremining.containers.AbstractContainerBean
com.softwaremining.sql.AbstractORContainer
All Implemented Interfaces:
IPersistence, ISQLWrapper, AbstractDataObject, ISMBean, ISMDataType, ISMObject
Direct Known Subclasses:
Db400Container

public abstract class AbstractORContainer extends AbstractContainerBean implements ISQLWrapper, IPersistence
Abstract Object-Relational Container - USed for representation KSDS Indexed files. COBOL Structures for accessing Indexed-File are be translated to an Object-Relational (OR) design which read/write from a SQL Database instead of file system.
Such classes inherit from SQLWrapper or AbstractORContainer. The major part functionality for CRUD operations are provided in these classes.
The SQLWrapper class does the same thing, but when REDEFINES, OCCURS-DEPENDING, ... and generally COBOL emulation is not required, then this version can give a much better performance.
  • Field Details

    • rowFacade

      protected RowFacade rowFacade
    • nativeKeys

      protected ISMObject[] nativeKeys
    • postFixTableNameToImplicitDatabaseKey

      protected boolean postFixTableNameToImplicitDatabaseKey
    • openMode

      protected int openMode
    • sequentialKeyGeneration

      protected boolean sequentialKeyGeneration
    • resultSet

      protected ResultSet resultSet
    • fileOpened

      protected boolean fileOpened
    • suppressNextReadCurrent

      protected boolean suppressNextReadCurrent
    • connection

      protected Connection connection
    • totalRuntime

      public static long totalRuntime
      for internal use only ... profiling information
    • delegateDAO

      protected ISQLWrapper delegateDAO
  • Constructor Details

    • AbstractORContainer

      public AbstractORContainer()
    • AbstractORContainer

      public AbstractORContainer(BaseService owner)
  • Method Details

    • retrieveOpenMode

      public int retrieveOpenMode()
      Specified by:
      retrieveOpenMode in interface ISQLWrapper
    • retrieveFirstLevelEntry

      public ISMObject retrieveFirstLevelEntry()
    • retrieveFileName

      public String retrieveFileName()
      returns the table-name associated with this database table.
      Specified by:
      retrieveFileName in interface ISQLWrapper
    • assignRecordKey

      public void assignRecordKey(ISMObject recordKey)
      Description copied from interface: ISQLWrapper
      Used only used by CicsPersistent Subclasses.
      Specified by:
      assignRecordKey in interface ISQLWrapper
    • assignRecordKey

      public void assignRecordKey(ISMObject[] recordKeys)
      Description copied from interface: ISQLWrapper
      Used only used by CicsPersistent Subclasses.
      Specified by:
      assignRecordKey in interface ISQLWrapper
    • assignTreatAsSQLWrapper

      public void assignTreatAsSQLWrapper(boolean treatAsSQLWrapper)
      Description copied from interface: ISQLWrapper
      Used only used by CicsPersistent Subclasses. allows CicsPersistent (ILE or other subclasses of this) to be treated as SQLWrapper (Object-relational VSAM Files) by batch programs.
      Specified by:
      assignTreatAsSQLWrapper in interface ISQLWrapper
    • addRecordKey

      public void addRecordKey(ISMObject recordKey, Boolean ascendDescend)
      Allows adding single or composite record keys - one at a time invalid input: '&' specifying the Ascending/Descending order
      Parameters:
      recordKey - - ACMOBject
      ascendDescend - - IPersistence.DESCENDING or IPersistence.ASCENDING
    • retrieveAscentDescendOrder

      public List<Boolean> retrieveAscentDescendOrder()
      Specified by:
      retrieveAscentDescendOrder in interface ISQLWrapper
    • assignAlternateKey

      public void assignAlternateKey(ISMObject alternateKey)
    • assignRelativeKey

      public void assignRelativeKey(AbstractCBLNumeric relativeKey)
    • retrieveRowFacade

      public RowFacade retrieveRowFacade()
      Specified by:
      retrieveRowFacade in interface ISQLWrapper
    • retrieveNativeKeys

      public ISMObject[] retrieveNativeKeys()
      Native Keys refer to either a. any keys set by setRecordKey b. in absence of any keys defined by setRecordKey, then an additional index keys is created by SoftwareMining framework. (This is usually called INDX_FLD_0;)
      Specified by:
      retrieveNativeKeys in interface ISQLWrapper
      Returns:
    • retrieveImplicitDatabaseKey

      public ISMObject retrieveImplicitDatabaseKey()
      Native Keys refer to either a. any keys set by setRecordKey b. in absence of any keys defined by setRecordKey, then an additional index keys is created by SoftwareMining framework. (This is usually called INDX_FLD_0;)
      Specified by:
      retrieveImplicitDatabaseKey in interface ISQLWrapper
      Returns:
    • open

      public int open(int openMode) throws IOCriticalException
      Throws:
      IOCriticalException
    • close

      public int close() throws IOCriticalException
      Specified by:
      close in interface ISQLWrapper
      Throws:
      IOCriticalException
    • commit

      public void commit() throws IOCriticalException
      Throws:
      IOCriticalException
    • rollback

      public void rollback() throws IOCriticalException
      Throws:
      IOCriticalException
    • seekRecord

      public int seekRecord(ISMObject key, int conditionType) throws IOStatusException
      translation of COBOL START The method will open a result-set, read the information and then Close the result-set.
      Specified by:
      seekRecord in interface ISQLWrapper
      Parameters:
      key -
      conditionType -
      Throws:
      IOStatusException
    • seekRecord

      public int seekRecord(ISMObject[] keys, int conditionType) throws IOStatusException
      translation of COBOL START The method will open a result-set, read the information and then Close the result-set.
      Specified by:
      seekRecord in interface ISQLWrapper
      Parameters:
      keys -
      conditionType -
      Throws:
      IOStatusException
    • seek

      public int seek(ISMObject key, int conditionType)
      Go to the record identified by key Condition type is one of : ACMBasePersistence.CONDITION_TYPE_NO_CONDITION = 0; ACMBasePersistence.CONDITION_TYPE_EQUALS = 1; ACMBasePersistence.CONDITION_TYPE_GREATER = 2; ACMBasePersistence.CONDITION_TYPE_LESS = 3; ACMBasePersistence.CONDITION_TYPE_GREATER_OR_EQUALS = 4; ACMBasePersistence.CONDITION_TYPE_LESS_OR_EQUALS = 5;
    • seek

      public int seek(ISMObject[] keys, int conditionType) throws IOStatusException
      translation of COBOL START The method will open a result-set, read the information and then Close the result-set.
      Parameters:
      keys -
      conditionType -
      Throws:
      IOStatusException
    • restoreResultSet

      protected void restoreResultSet(int conditionType, ISMObject[] searchKeys) throws SQLException
      Throws:
      SQLException
    • nextRecord

      public int nextRecord() throws IOStatusException
      Translation of COBOL Read Next ...
      Throws:
      IOStatusException
    • prevRecord

      public int prevRecord() throws IOStatusException
      Translation of COBOL Read Next ...
      Throws:
      IOStatusException
    • readRecord

      public int readRecord() throws IOStatusException
      Equivalant of COBOL READ , at end throw exception If AccessMode is not SEQUENTIAL, a seek() will be performed before the read.
      Throws:
      IOStatusException
    • readWithLock

      public int readWithLock()
    • unlock

      public void unlock()
      Specified by:
      unlock in interface ISQLWrapper
    • deleteRecord

      public int deleteRecord() throws IOStatusException
      equivalant of COBOL delete (for VSAM)
      Throws:
      IOStatusException
    • clear

      public int clear() throws IOStatusException
      clear the result-sets and statements ...
      Throws:
      IOStatusException
    • insertRecord

      public int insertRecord() throws IOStatusException
      Insert a record - populate the values from the existing fields
      Throws:
      IOStatusException
    • updateRecord

      public int updateRecord() throws IOStatusException
      Translation of COBOL REWRITE statement
      Throws:
      IOStatusException
    • readCurrent

      protected void readCurrent(boolean useNativeKeys) throws IOStatusException
      Used in DMS and ILE DAO
      Parameters:
      useNativeKeys -
      Throws:
      IOStatusException
    • retrieveDbDecorator

      public ACMDbDecorator retrieveDbDecorator()
      Specified by:
      retrieveDbDecorator in interface ISQLWrapper
    • isKeyUnique

      public boolean isKeyUnique()
      Specified by:
      isKeyUnique in interface ISQLWrapper
    • assignKeyIsUnique

      public void assignKeyIsUnique(boolean keyUnique)
      used primarily in CICS Queues.
      Specified by:
      assignKeyIsUnique in interface ISQLWrapper
      Parameters:
      keyUnique -
    • isChangeGEConditonToLIKE

      public boolean isChangeGEConditonToLIKE()
      Description copied from interface: ISQLWrapper
      The system can replace GE searches to LIKE statements. this can potentially have a huge performance improvement.
      E.g. Consider generating SELECT ... from TABLE WHERE KEY_1 >= ? AND KEY_2 >= ?.
      If each key is 5 chars, and the supplied values are "A " and "B " - the above translates to:
       SELECT ... from TABLE WHERE KEY_1 >= 'A    ' AND KEY_2 >= 'B    '. 

      Converting it to LIKE will become
       SELECT ... from TABLE WHERE KEY_1 LIKE 'A%' AND KEY_2 LIKE 'B%' 
      This makes a significant performance improvements.
      Specified by:
      isChangeGEConditonToLIKE in interface ISQLWrapper
    • assignChangeGEConditonToLIKE

      public void assignChangeGEConditonToLIKE(boolean newValue)
      Description copied from interface: ISQLWrapper
      The system can replace GE searches to LIKE statements. this can potentially have a huge performance improvement.
      E.g. Consider generating SELECT ... from TABLE WHERE KEY_1 >= ? AND KEY_2 >= ?.
      If each key is 5 chars, and the supplied values are "A " and "B " - the above translates to:
       SELECT ... from TABLE WHERE KEY_1 >= 'A    ' AND KEY_2 >= 'B    '. 

      Converting it to LIKE will become
       SELECT ... from TABLE WHERE KEY_1 LIKE 'A%' AND KEY_2 LIKE 'B%' 
      This makes a significant performance improvements.
      Specified by:
      assignChangeGEConditonToLIKE in interface ISQLWrapper
    • isChangeGTEQ2EQForLIKECondition

      public boolean isChangeGTEQ2EQForLIKECondition()
      Description copied from interface: ISQLWrapper
      For internal Use only.
      Only applies when OR_CHANGE_GE_CONDITION_TO_LIKE__DEFAULT=true
      E.g. Consider generating SELECT ... from TABLE WHERE KEY_1 >= ? AND KEY_2 >= ?.
      If each key is 5 chars, and the supplied values are "ABCDE" and "B " - the above translates to:
       SELECT ... from TABLE WHERE KEY_1 >= 'ABCDE' AND KEY_2 >= 'B    '. 

      Converting it to LIKE will become
       SELECT ... from TABLE WHERE KEY_1 >= 'ABCDE' AND KEY_2 LIKE 'B%' 

      When this flag is set, if the char-count of a field is equal to that of the supplied value, then the generated SQL will become
       SELECT ... from TABLE WHERE KEY_1 = 'ABCDE' AND KEY_2 LIKE 'B%' 
      This can make a significant improvement to performance .
      Specified by:
      isChangeGTEQ2EQForLIKECondition in interface ISQLWrapper
    • assignChangeGTEQ2EQForLIKECondition

      public void assignChangeGTEQ2EQForLIKECondition(boolean useEQForExactLenghtMatch)
      Description copied from interface: ISQLWrapper
      Only applies when OR_CHANGE_GE_CONDITION_TO_LIKE__DEFAULT=true
      E.g. Consider generating SELECT ... from TABLE WHERE KEY_1 >= ? AND KEY_2 >= ?.
      If each key is 5 chars, and the supplied values are "ABCDE" and "B " - the above translates to:
       SELECT ... from TABLE WHERE KEY_1 >= 'ABCDE' AND KEY_2 >= 'B    '. 

      Converting it to LIKE will become
       SELECT ... from TABLE WHERE KEY_1 >= 'ABCDE' AND KEY_2 LIKE 'B%' 

      When this flag is set, if the char-count of a field is equal to that of the supplied value, then the generated SQL will become
       SELECT ... from TABLE WHERE KEY_1 = 'ABCDE' AND KEY_2 LIKE 'B%' 
      This can make a significant improvement to performance .
      Specified by:
      assignChangeGTEQ2EQForLIKECondition in interface ISQLWrapper
    • isSeekSuppressed

      public boolean isSeekSuppressed()
      for internal use only - For VSAM SEEK / READ / ... VSAM apps need to throw InvalidKeyException (even if they use CICS delegates), but CICS applications need to throw KeyNotFoundException ,
      Specified by:
      isSeekSuppressed in interface ISQLWrapper
      Returns:
    • assignSuppressSeek

      public void assignSuppressSeek(boolean newValue)
      for internal use only - For VSAM SEEK / READ / ... VSAM apps need to throw InvalidKeyException (even if they use CICS delegates), but CICS applications need to throw KeyNotFoundException ,
      Specified by:
      assignSuppressSeek in interface ISQLWrapper
    • assignTopRowSelectStrategyCount

      public void assignTopRowSelectStrategyCount(int count)
      Description copied from interface: ISQLWrapper
      (Default = -1) When set to 0 or 1 , the Object-Relation SQL Generator will produce:
                        SELECT � FROM table WHERE condition-1 
      When set to greater than 1 - (for Oracle) it will produce:
        SELECT ... FROM ( SELECT � FROM table WHERE condition-1 ) WHERE ROWNUM <OR_SELECT_TOP_ROW__DEFAULT; 
      Specified by:
      assignTopRowSelectStrategyCount in interface ISQLWrapper
    • retrieveTopRowSelectStrategyCount

      public int retrieveTopRowSelectStrategyCount()
      Description copied from interface: ISQLWrapper
      For internal use only (Default = -1) When set to 0 or 1 , the Object-Relation SQL Generator will produce:
                        SELECT ... FROM table WHERE condition-1 
      When set to greater than 1 - (for Oracle) it will produce:
        SELECT ... FROM ( SELECT ... FROM table WHERE condition-1 ) WHERE ROWNUM <OR_SELECT_TOP_ROW__DEFAULT; 
      Specified by:
      retrieveTopRowSelectStrategyCount in interface ISQLWrapper
    • retrieveTopRowSelectStrategyStartingRow

      public int retrieveTopRowSelectStrategyStartingRow()
      Description copied from interface: ISQLWrapper
      for internal use only
      Specified by:
      retrieveTopRowSelectStrategyStartingRow in interface ISQLWrapper
    • assignTopRowSelectStrategyRange

      public void assignTopRowSelectStrategyRange(int startRowNumber, int count)
      Description copied from interface: ISQLWrapper
      Similar to assignTopRowSelectStrategyCount - but aslso defines starting points
      Specified by:
      assignTopRowSelectStrategyRange in interface ISQLWrapper
      Parameters:
      startRowNumber -
      count -
    • retrieveAdditionalSQLOrderBy

      public StringBuilder retrieveAdditionalSQLOrderBy()
      Specified by:
      retrieveAdditionalSQLOrderBy in interface ISQLWrapper
    • assignAdditionalSQLOrderBy

      public void assignAdditionalSQLOrderBy(String newValue)
      Description copied from interface: ISQLWrapper
      This method allows inserting additional Ordering clauses It is useful in hierarchical tables will define additional SQLConditions - e.g. (INDX_FLD_TABLE_1 ASCENDING)
      Specified by:
      assignAdditionalSQLOrderBy in interface ISQLWrapper
    • retrieveAdditionalSQLCondition

      public StringBuilder retrieveAdditionalSQLCondition()
      Hierarchical tables will define additional SQLConditions - e.g. INDX_FLD_TABLE_1 = 12
      Specified by:
      retrieveAdditionalSQLCondition in interface ISQLWrapper
      Returns:
    • assignAdditionalSQLConditions

      public void assignAdditionalSQLConditions(String condition)
      Hierarchical tables will define additional SQLConditions - e.g. INDX_FLD_TABLE_1 = 12
      Specified by:
      assignAdditionalSQLConditions in interface ISQLWrapper
      Parameters:
      condition -
    • assignSQLConditions

      public void assignSQLConditions(String condition)
      Define you own SQLConditions - e.g. (A = ?) and (B = ?)
      Specified by:
      assignSQLConditions in interface ISQLWrapper
      Parameters:
      condition -
    • assignAdditionalSQLConditions

      public void assignAdditionalSQLConditions(StringBuilder condition)
      Hierarchical tables will define additional SQLConditions - e.g. INDX_FLD_TABLE_1 = 12
      Specified by:
      assignAdditionalSQLConditions in interface ISQLWrapper
      Parameters:
      condition -
    • assignFetchSize

      public void assignFetchSize(int newFetchSize)
      maps onto ResultSet.setFetchSize Gives the JDBC driver a hint as to the number of rows that should be fetched from the database when more rows are needed for this ResultSet object. If the fetch size specified is zero, the JDBC driver ignores the value and is free to make its own best guess as to what the fetch size should be. The default value is set by the Statement object that created the result set. The fetch size may be changed at any time,
    • getForeignKeys

      protected ISMObject[] getForeignKeys()
      Stub method to be over-written by LinkedSQLWrapper class.
      Returns:
    • useOidTableForKeyGeneration

      public boolean useOidTableForKeyGeneration()
      Stub method to be over-written by LinkedSQLWrapper class.
      Specified by:
      useOidTableForKeyGeneration in interface ISQLWrapper
      Returns:
    • releaseResources

      public void releaseResources()
      this is called internally - after a program is CANCEL'ed. it is to help with the GC process
      Overrides:
      releaseResources in class AbstractContainerBean
    • releaseResources

      public void releaseResources(boolean forceRelease)
      this is called internally - after a program is CANCEL'ed. it is to help with the GC process
      Specified by:
      releaseResources in interface ISMBean
      Overrides:
      releaseResources in class AbstractContainerBean
      Parameters:
      forceRelease -
    • assignAdditionalKeyPosition

      public void assignAdditionalKeyPosition(ISMObject theField, int position)
      Support for Tandem START .... AFTER POSITON ...
      Parameters:
      theField -
      position -
    • retrieveSessionId

      public Long retrieveSessionId()
      Description copied from class: AbstractContainerBean
      For internal use only
      Specified by:
      retrieveSessionId in interface ISMBean
      Specified by:
      retrieveSessionId in interface ISQLWrapper
      Overrides:
      retrieveSessionId in class AbstractContainerBean
    • isSequentialKeyGeneration

      public boolean isSequentialKeyGeneration()
      Specified by:
      isSequentialKeyGeneration in interface ISQLWrapper
    • assignSequentialKeyGeneration

      public void assignSequentialKeyGeneration(boolean sequentialKeyGeneration)
      Specified by:
      assignSequentialKeyGeneration in interface ISQLWrapper
    • retrieveResultSet

      public ResultSet retrieveResultSet()
      Specified by:
      retrieveResultSet in interface ISQLWrapper
    • assignResultSet

      public void assignResultSet(ResultSet resultSet)
      Specified by:
      assignResultSet in interface ISQLWrapper
    • isKept

      public boolean isKept()
      Specified by:
      isKept in interface ISQLWrapper
    • setLock

      public void setLock(boolean kept)
      Specified by:
      setLock in interface ISQLWrapper
    • isFileOpened

      public boolean isFileOpened()
      Specified by:
      isFileOpened in interface ISQLWrapper
    • assignFileOpened

      public void assignFileOpened(boolean fileOpened)
      Specified by:
      assignFileOpened in interface ISQLWrapper
    • retrieveLastSeekCondition

      public int retrieveLastSeekCondition()
      Specified by:
      retrieveLastSeekCondition in interface ISQLWrapper
    • assignLastSeekCondition

      public void assignLastSeekCondition(int lastSeekCondition)
      Specified by:
      assignLastSeekCondition in interface ISQLWrapper
    • isSuppressNextReadCurrent

      public boolean isSuppressNextReadCurrent()
      Specified by:
      isSuppressNextReadCurrent in interface ISQLWrapper
    • isLastSeekConditionLookedForEquality

      public boolean isLastSeekConditionLookedForEquality()
      Specified by:
      isLastSeekConditionLookedForEquality in interface ISQLWrapper
    • assignLastSeekConditionLookedForEquality

      public void assignLastSeekConditionLookedForEquality(boolean lastSeekConditionLookedForEquality)
      Specified by:
      assignLastSeekConditionLookedForEquality in interface ISQLWrapper
    • retrieveResultSetFetchSize

      public int retrieveResultSetFetchSize()
      Specified by:
      retrieveResultSetFetchSize in interface ISQLWrapper
    • assignResultSetFetchSize

      public void assignResultSetFetchSize(int resultSetFetchSize)
      Specified by:
      assignResultSetFetchSize in interface ISQLWrapper
    • assignRowFacade

      public void assignRowFacade(RowFacade rowFacade)
      Specified by:
      assignRowFacade in interface ISQLWrapper
    • assignDbDecorator

      public void assignDbDecorator(ACMDbDecorator dbDecorator)
      Specified by:
      assignDbDecorator in interface ISQLWrapper
    • assignOpenMode

      public void assignOpenMode(int openMode)
      Specified by:
      assignOpenMode in interface ISQLWrapper
    • assignTableName

      public void assignTableName(String newName)
      Called Programs declaring instances of the persistence classes
      FOr Indexed-Files, this call often relates to setting name to a data-file name E.g. for
      SELECT CUSTOMER-FILE assign to "CUSTOMER.DAT"
      Results in:
      customerFile.assignTableName("customer.dat");
      or
      customerFile.assignTableName(System.getEnv("CUST");
      this is incorrect. We cannot keep changing the table names.

      But we cannot suppress its generation - as the system should be able to swap between IndexedFiles and SQLWrappe/OR . IndexedFiles WILL need this.
      However, the real name can be set by the persistence class itself - using "assignSQLTableName" Besides, this may "sometimes" be useful. So, the system is going to continue generating the call to this method.
      Specified by:
      assignTableName in interface ISQLWrapper
      Parameters:
      newName -
    • assignFileName

      public void assignFileName(String newName)
      This method does not do anything on this class. Called Programs declaring instances of the persistence classes
      FOr Indexed-Files, this call often relates to setting name to a data-file name E.g. for
      SELECT CUSTOMER-FILE assign to "CUSTOMER.DAT"
      Results in:
      customerFile.assignTableName("customer.dat");
      or
      customerFile.assignTableName(System.getEnv("CUST");
      this is incorrect. We cannot keep changing the table names.

      But we cannot suppress its generation - as the system should be able to swap between IndexedFiles and SQLWrappe/OR . IndexedFiles WILL need this.
      However, the real name can be set by the persistence class itself - using "assignSQLTableName" Besides, this may "sometimes" be useful. So, the system is going to continue generating the call to this method.
      Parameters:
      newName -
    • assignSQLTableName

      public void assignSQLTableName(String newName)
      Called by "persistence" Classes themselves allows overriding the default table name. This sets the table to the matching one in SQL DDL The main Program classes still call "assignTableName" - which would do nothing. The call is not currently removed for safety - It may become needed at some stage for some projects
      Specified by:
      assignSQLTableName in interface ISQLWrapper
      Parameters:
      newName -
    • retrieveTableName

      public String retrieveTableName()
      Specified by:
      retrieveTableName in interface ISQLWrapper
    • read

      public int read()
      READ is used in conjuction with SEEK statements. Read the next record, trapping at end exceptions ....
      Specified by:
      read in interface ISQLWrapper
    • next

      public int next()
      read the next record from file. DOES NOT THROW AtEndException ... instead only the FileStatus will be changed.
      Specified by:
      next in interface ISQLWrapper
      Returns:
      false if there was no more record, or problem encountered. Otherwise returns true;
    • insert

      public int insert()
      Insert a record - populate the values from the existing fields
      Specified by:
      insert in interface ISQLWrapper
    • update

      public int update()
      Update the current record with the current record structure. If at end of file is reached, it does not throw an exception
      Specified by:
      update in interface ISQLWrapper
    • delete

      public int delete()
      Equivalent of COBOL delete (for VSAM).
      Specified by:
      delete in interface ISQLWrapper
    • prev

      public int prev()
      ] Equivalent of COBOL VSAM READ PREV
      Specified by:
      prev in interface ISQLWrapper
      Returns:
    • retrieveStatusValue

      public int retrieveStatusValue()
      Used internally to set the IO operation status-values. Also if a FileStatus field is defined, the system will allocate correct values to it.
      Specified by:
      retrieveStatusValue in interface ISQLWrapper
      Returns:
      - the status value .. one of ACMBasePersistent.STATUS_xxxx
    • assignStatusValue

      public void assignStatusValue(int value)
      Used internally to set the IO operation status-values. Also if a FileStatus field is defined, the system will allocate correct values to it.
      Specified by:
      assignStatusValue in interface ISQLWrapper
      Parameters:
      value - - .. one of ACMBasePersistent.STATUS_xxxx
    • assignStatus

      public void assignStatus(ISMObject status)
      set the status object
      Specified by:
      assignStatus in interface ISQLWrapper
      Parameters:
      status -
    • assignAccessMode

      public void assignAccessMode(int accessMode)
      Similar to the COBOL ACCESS Mode
      Specified by:
      assignAccessMode in interface ISQLWrapper
      Parameters:
      accessMode - : types are defined in ACMBasePersistence.ACCESS_MODE_xxx : Sequential, Random or Dynamic
    • retrieveAccessMode

      public int retrieveAccessMode()
      Similar to the COBOL ACCESS Mode
      Specified by:
      retrieveAccessMode in interface ISQLWrapper
      Parameters:
      accessMode - : types are defined in ACMBasePersistence.ACCESS_MODE_xxx : Sequential, Random or Dynamic
    • reduceGEorEQ

      public void reduceGEorEQ(boolean newValue)
      Description copied from interface: ISQLWrapper
      used in AS400 / DB400 to increase speed of searches
      Specified by:
      reduceGEorEQ in interface ISQLWrapper
    • isReduceGEorEQ

      public boolean isReduceGEorEQ()
      Description copied from interface: ISQLWrapper
      used in AS400 / DB400 to increase speed of searches
      Specified by:
      isReduceGEorEQ in interface ISQLWrapper
    • isAllowedToExpandGTEQSearches

      public boolean isAllowedToExpandGTEQSearches()
      Description copied from interface: ISQLWrapper
      internal use only. Example: Lets say there are 3 key fields involved in a search with condition GTEQ
      If flag is set to true (default) - then the following SQL condition will be generated
      (A > ? or (A = ? and B > ?) or (A = ? and B = ? and C >= ?))
      With flag is set to FALSE - the following will be generated
      (A >= ?) and (B >= ?) and (C >= ?)
      Specified by:
      isAllowedToExpandGTEQSearches in interface ISQLWrapper
    • assignExpandGTEQSearches

      public void assignExpandGTEQSearches(boolean expandGTEQSearches)
      Description copied from interface: ISQLWrapper
      (default is true) Example: Lets say there are 3 key fields involved in a search with condition GTEQ
      If flag is set to true (default) - then the following SQL condition will be generated
      (A > ? or (A = ? and B > ?) or (A = ? and B = ? and C >= ?))
      With flag is set to FALSE - the following will be generated
      (A >= ?) and (B >= ?) and (C >= ?)
      Specified by:
      assignExpandGTEQSearches in interface ISQLWrapper
    • assignIgnoreOriginalKeys

      public void assignIgnoreOriginalKeys(boolean newValue)
      Description copied from interface: ISQLWrapper
      for internal use
      Specified by:
      assignIgnoreOriginalKeys in interface ISQLWrapper
      Parameters:
      newValue -
    • isIgnoreOriginalKeys

      public boolean isIgnoreOriginalKeys()
      Specified by:
      isIgnoreOriginalKeys in interface ISQLWrapper
    • retrieveGenerate_OrderBy_ForReadStatements

      public boolean retrieveGenerate_OrderBy_ForReadStatements()
      Description copied from interface: ISQLWrapper
      for internal use
      Specified by:
      retrieveGenerate_OrderBy_ForReadStatements in interface ISQLWrapper
    • assignGenerate_OrderBy_ForReadStatements

      public void assignGenerate_OrderBy_ForReadStatements(boolean enabled)
      Description copied from interface: ISQLWrapper
      READ() statement on DB tables with MANY rows, issues an ORDER BY on the SELECT which may have a big performance impact. If the data was populated sequentially, then the ORDER BY may not be strictly required, and may be removed.
      Specified by:
      assignGenerate_OrderBy_ForReadStatements in interface ISQLWrapper
    • assignCachedSeekValues

      public void assignCachedSeekValues(List objects)
      Specified by:
      assignCachedSeekValues in interface ISQLWrapper
    • retrieveCachedSeekValues

      public List retrieveCachedSeekValues()
      Specified by:
      retrieveCachedSeekValues in interface ISQLWrapper
    • assignGDGProperty

      public void assignGDGProperty(String setgdgProperty)
      Additional SQL statement to be read from gdg.properties file. E.g. assignGDGProperty("GDG1"); If gdg.properties file contains: GDG1=AND GDG_YEAR=2012 Then the above search condition will be appended to any SQL statements issued reading this class
      Specified by:
      assignGDGProperty in interface ISQLWrapper
    • assignGDGCondition

      public void assignGDGCondition(String gdgProperty)
      Additional SQL statement to be read from gdg.properties file. E.g. assignGDGCondition("GDG_YEAR = 2013"); Then the above search condition will be appended to any SQL statements issued reading this class.
      Specified by:
      assignGDGCondition in interface ISQLWrapper
    • assignDelegateDAO

      public void assignDelegateDAO(ISQLWrapper delegateDAO)
      Indexed files with totally different formats will sometimes still need to go to same database table. Assigning a delegateDAO causes the delegate class to be used for access to the SQLDatabase. The values are then transfered between "this" class and delegateDAO
      Specified by:
      assignDelegateDAO in interface ISQLWrapper
      Parameters:
      delegateDAO -
    • retrieveDelegateDAO

      public ISQLWrapper retrieveDelegateDAO()
      Indexed files with totally different formats will sometimes still need to go to same database table. A DelegateDAO allows another class to be used for access to the SQLDatabase.
      Specified by:
      retrieveDelegateDAO in interface ISQLWrapper
      Returns:
    • assignKeyValue

      protected void assignKeyValue(String value)
      Used only used by CicsPersistent Subclasses.
      Parameters:
      value -
    • assignKeyValue

      public void assignKeyValue(int value)
      Used only used by CicsPersistent Subclasses.
      Parameters:
      value -
    • assignKeyValue

      public void assignKeyValue(AbstractDataObject keyValueField)
      Description copied from interface: ISQLWrapper
      Used only used by CicsPersistent Subclasses. After each read or next, it will update the value of the Key with the new values from database
      Specified by:
      assignKeyValue in interface ISQLWrapper
    • retrieveRecordKey

      public ISMObject retrieveRecordKey()
      for internal use only
      Specified by:
      retrieveRecordKey in interface ISQLWrapper
      Returns:
    • retrieveRecordKeyValue

      public String retrieveRecordKeyValue()
      Used only used by CicsPersistent Subclasses.
      Specified by:
      retrieveRecordKeyValue in interface ISQLWrapper
      Parameters:
      value -
    • validateConditionType

      public int validateConditionType(ISMObject key, int conditionType)
      For internal use only reverts to defaults for CONDITION_TYPE_NO_CONDITION and CONDITION_TYPE_NOT_ASSIGNED
      Specified by:
      validateConditionType in interface ISQLWrapper
      Parameters:
      conditionType -
      Returns:
    • retrieveThrowInvalidKeyException

      public boolean retrieveThrowInvalidKeyException()
      for internal use only
      Specified by:
      retrieveThrowInvalidKeyException in interface ISQLWrapper
      Returns:
    • assignThrowInvalidKeyException

      public void assignThrowInvalidKeyException(boolean newValue)
      for internal use only
      Specified by:
      assignThrowInvalidKeyException in interface ISQLWrapper
    • assignLowerLimitForExpandGTEQSearches

      public void assignLowerLimitForExpandGTEQSearches(int range)
      Description copied from interface: ISQLWrapper
      (default is -1 - disabled) Only works when assignExpandGTEQSearches(true);
      Example: Lets say there are 3 key fields involved in a search with condition GTEQ
      In default settings, the following SQL condition will be generated
       SELECT ... FROM ... WHERE
           (A > ?)
        or (A = ? and B > ?) 
        or (A = ? and B = ? and C >= ?)) 

      using the statement assignLowerLimitForExpandGTEQSearches( 3 ) - the key conditions below position 3 are ignored, and only the following is generated.
       SELECT ... FROM ... WHERE
             (A = ? and B = ? and C >= ?)) 

      and the following proceeding conditions are ignored invalid input: '<'> (A > ?)
      or (A = ? and B > ?)
      Specified by:
      assignLowerLimitForExpandGTEQSearches in interface ISQLWrapper
    • retreiveLowerLimitForExpandGTEQSearches

      public int retreiveLowerLimitForExpandGTEQSearches()
      Specified by:
      retreiveLowerLimitForExpandGTEQSearches in interface ISQLWrapper
    • assignUpperLimitForExpandGTEQSearches

      public void assignUpperLimitForExpandGTEQSearches(int range)
      Description copied from interface: ISQLWrapper
      (default is -1 - disabled) Only works when assignExpandGTEQSearches(true);
      Example: Lets say there are 3 key fields involved in a search with condition GTEQ
      In default settings, the following SQL condition will be generated
       SELECT ... FROM ... WHERE
           (A > ?)
        or (A = ? and B > ?) 
        or (A = ? and B = ? and C >= ?)) 

      but if assignUpperLimitForExpandGTEQSearches( 1 ) - only conditions up to 1st Key will be generated
      ie The following will be generated
       SELECT ... FROM ... WHERE 
          (A > ?) 

      and the following conditions will NOT be generated (A = ? and B > ?) or (A = ? and B = ? and C >= ?))
      Specified by:
      assignUpperLimitForExpandGTEQSearches in interface ISQLWrapper
    • retreiveUpperLimitForExpandGTEQSearches

      public int retreiveUpperLimitForExpandGTEQSearches()
      Specified by:
      retreiveUpperLimitForExpandGTEQSearches in interface ISQLWrapper
    • assignConnection

      public void assignConnection(Connection connection)
      Specified by:
      assignConnection in interface ISQLWrapper
    • retrieveConnection

      public Connection retrieveConnection()
      Specified by:
      retrieveConnection in interface ISQLWrapper
    • assignFetchDirectionIsForward

      public void assignFetchDirectionIsForward(Boolean direction)
      Specified by:
      assignFetchDirectionIsForward in interface ISQLWrapper
    • isFetchDirectionForward

      public boolean isFetchDirectionForward()
      Specified by:
      isFetchDirectionForward in interface ISQLWrapper
    • isFetchDirectionBackward

      public boolean isFetchDirectionBackward()
      Specified by:
      isFetchDirectionBackward in interface ISQLWrapper
    • retrieveAdditionalSearchParameters

      public List<Object> retrieveAdditionalSearchParameters()
      Description copied from interface: ISQLWrapper
      assignSQLCondition can also have conditions such as "NAME = ?". In that case the program should also use the "addSearchParameter" method to provide values
      Specified by:
      retrieveAdditionalSearchParameters in interface ISQLWrapper
      Returns: