Package com.softwaremining.sql
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.
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 Summary
FieldsModifier and TypeFieldDescriptionprotected Connectionprotected ISQLWrapperprotected booleanprotected ISMObject[]protected intprotected booleanprotected ResultSetprotected RowFacadeprotected booleanprotected booleanstatic longfor internal use only ...Fields inherited from interface com.softwaremining.sql.IPersistence
ACCESS_MODE_DYNAMIC, ACCESS_MODE_RANDOM, ACCESS_MODE_SEQUENTIAL, ASCENDING_RECORD_KEY, CONDITION_TYPE_EQUALS, CONDITION_TYPE_GREATER, CONDITION_TYPE_GREATER_OR_EQUALS, CONDITION_TYPE_IGNORE, CONDITION_TYPE_IGNORE_FOR_SQL_LIKE, CONDITION_TYPE_LESS, CONDITION_TYPE_LESS_OR_EQUALS, CONDITION_TYPE_LIKE, CONDITION_TYPE_NO_CONDITION, CONDITION_TYPE_NOT_ASSIGNED, DESCENDING_RECORD_KEY, OPEN_MODE_EXTEND, OPEN_MODE_I_O, OPEN_MODE_INPUT, OPEN_MODE_NOT_OPENED, OPEN_MODE_OUTPUT, STATUS_AT_END, STATUS_CLOSE_FILE_FILE_NOT_OPEN, STATUS_DUP_KEY, STATUS_FAILED_CLOSING, STATUS_INCORRECT_READ_OF_UNOPENED_FILE, STATUS_INCORRECT_RECORDSIZE_REWRITE, STATUS_INSERT_ERR_INAPPROPRIATE_FILE, STATUS_INSERT_ERR_INVALID_KEY, STATUS_LOCK, STATUS_NOT_FOUND, STATUS_OPEN_FILE_FILE_NOT_FOUND, STATUS_REWRITE_WITHOUT_READ, STATUS_SM_FAIL_UNKOWN_REASON, STATUS_SM_NOT_ASSIGNED, STATUS_SUCCESS, UNCERTAIN_OF_RETURN_VALUE -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddRecordKey(ISMObject recordKey, Boolean ascendDescend) Allows adding single or composite record keys - one at a time & specifying the Ascending/Descending ordervoidassignAccessMode(int accessMode) Similar to the COBOL ACCESS ModevoidassignAdditionalKeyPosition(ISMObject theField, int position) Support for Tandem START ....voidassignAdditionalSQLConditions(String condition) Hierarchical tables will define additional SQLConditions - e.g.voidassignAdditionalSQLConditions(StringBuilder condition) Hierarchical tables will define additional SQLConditions - e.g.voidThis method allows appending to current SQL Conditions without overwriting previous conditionsvoidassignAdditionalSQLOrderBy(String newValue) This method allows inserting additional Ordering clauses It is useful in hierarchical tables will define additional SQLConditions - e.g.voidassignAlternateKey(ISMObject alternateKey) voidassignCachedSeekValues(List objects) voidassignChangeGEConditonToLIKE(boolean newValue) The system can replace GE searches to LIKE statements.voidassignChangeGTEQ2EQForLIKECondition(boolean useEQForExactLenghtMatch) Only applies when OR_CHANGE_GE_CONDITION_TO_LIKE__DEFAULT=true
E.g.voidassignConnection(Connection connection) voidassignDbDecorator(ACMDbDecorator dbDecorator) voidassignDelegateDAO(ISQLWrapper delegateDAO) Indexed files with totally different formats will sometimes still need to go to same database table.voidassignExpandGTEQSearches(boolean expandGTEQSearches) (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 >= ?)voidassignFetchDirectionIsForward(Boolean direction) voidassignFetchSize(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.voidassignFileName(String newName) This method does not do anything on this class.voidassignFileOpened(boolean fileOpened) voidassignGDGCondition(String gdgProperty) Additional SQL statement to be read from gdg.properties file.voidassignGDGProperty(String setgdgProperty) Additional SQL statement to be read from gdg.properties file.voidassignGenerate_OrderBy_ForReadStatements(boolean enabled) READ() statement on DB tables with MANY rows, issues an ORDER BY on the SELECT which may have a big performance impact.voidassignIgnoreOriginalKeys(boolean newValue) for internal usevoidassignIncludeRedefinedFieldsInCRUD(boolean includeRedefinedFieldsInCRUD) voidassignKeyIsUnique(boolean keyUnique) used primarily in CICS Queues.voidassignKeyValue(int value) Used only used by CicsPersistent Subclasses.voidassignKeyValue(AbstractDataObject keyValueField) Used only used by CicsPersistent Subclasses.protected voidassignKeyValue(String value) Used only used by CicsPersistent Subclasses.voidassignLastSeekCondition(int lastSeekCondition) voidassignLastSeekConditionLookedForEquality(boolean lastSeekConditionLookedForEquality) voidassignLowerLimitForExpandGTEQSearches(int range) (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 generatedvoidassignOpenMode(int openMode) voidassignRecordKey(ISMObject recordKey) Used only used by CicsPersistent Subclasses.voidassignRecordKey(ISMObject[] recordKeys) Used only used by CicsPersistent Subclasses.voidassignRelativeKey(AbstractCBLNumeric relativeKey) voidassignResultSet(ResultSet resultSet) voidassignResultSetFetchSize(int resultSetFetchSize) voidassignRowFacade(RowFacade rowFacade) voidassignSequentialKeyGeneration(boolean sequentialKeyGeneration) voidassignSQLConditions(String condition) Define you own SQLConditions - e.g.voidassignSQLTableName(String newName) Called by "persistence" Classes themselves allows overriding the default table name.voidassignStatus(ISMObject status) set the status objectvoidassignStatusValue(int value) Used internally to set the IO operation status-values.voidassignSuppressSeek(boolean newValue) for internal use only - For VSAM SEEK / READ / ...voidassignTableName(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.voidassignThrowInvalidKeyException(boolean newValue) for internal use onlyvoidassignTopRowSelectStrategyCount(int count) (Default = -1) When set to 0 or 1 , the Object-Relation SQL Generator will produce:voidassignTopRowSelectStrategyRange(int startRowNumber, int count) Similar to assignTopRowSelectStrategyCount - but aslso defines starting pointsvoidassignTreatAsSQLWrapper(boolean treatAsSQLWrapper) Used only used by CicsPersistent Subclasses.voidassignUpperLimitForExpandGTEQSearches(int range) (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 generatedintclear()clear the result-sets and statements ...voidintclose()voidcommit()intdelete()Equivalent of COBOL delete (for VSAM).intequivalant of COBOL delete (for VSAM)protected ISMObject[]Stub method to be over-written by LinkedSQLWrapper class.intinsert()Insert a record - populate the values from the existing fieldsintInsert a record - populate the values from the existing fieldsbooleaninternal use only.booleanThe system can replace GE searches to LIKE statements.booleanFor internal Use only.booleanbooleanbooleanbooleanbooleanisKept()booleanbooleanbooleanused in AS400 / DB400 to increase speed of searchesbooleanfor internal use only - For VSAM SEEK / READ / ...booleanbooleanintnext()read the next record from file.intTranslation of COBOL Read Next ...intopen(int openMode) intprev()] Equivalent of COBOL VSAM READ PREVintTranslation of COBOL Read Next ...intread()READ is used in conjuction with SEEK statements.protected voidreadCurrent(boolean useNativeKeys) Used in DMS and ILE DAOintEquivalant of COBOL READ , at end throw exception If AccessMode is not SEQUENTIAL, a seek() will be performed before the read.intvoidreduceGEorEQ(boolean newValue) used in AS400 / DB400 to increase speed of searchesvoidthis is called internally - after a program is CANCEL'ed.voidreleaseResources(boolean forceRelease) this is called internally - after a program is CANCEL'ed.protected voidrestoreResultSet(int conditionType, ISMObject[] searchKeys) intintintSimilar to the COBOL ACCESS ModeassignSQLCondition can also have conditions such as "NAME = ?".Hierarchical tables will define additional SQLConditions - e.g.Indexed files with totally different formats will sometimes still need to go to same database table.returns the table-name associated with this database table.booleanfor internal useNative Keys refer to either a.booleanintNative Keys refer to either a.intfor internal use onlyUsed only used by CicsPersistent Subclasses.intFor internal use onlyintUsed internally to set the IO operation status-values.booleanfor internal use onlyintFor internal use only (Default = -1) When set to 0 or 1 , the Object-Relation SQL Generator will produce:intfor internal use onlyvoidrollback()inttranslation of COBOL START The method will open a result-set, read the information and then Close the result-set.intGo 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;intseekRecord(ISMObject[] keys, int conditionType) translation of COBOL START The method will open a result-set, read the information and then Close the result-set.intseekRecord(ISMObject key, int conditionType) translation of COBOL START The method will open a result-set, read the information and then Close the result-set.voidsetLock(boolean kept) voidunlock()intupdate()Update the current record with the current record structure.intTranslation of COBOL REWRITE statementbooleanStub method to be over-written by LinkedSQLWrapper class.intvalidateConditionType(ISMObject key, int conditionType) For internal use only reverts to defaults for CONDITION_TYPE_NO_CONDITION and CONDITION_TYPE_NOT_ASSIGNEDMethods inherited from class com.softwaremining.containers.AbstractContainerBean
assignDefaultValue, assignEbcdicValue, assignEncodedValue, assignExcludeFromSQLTable, assignExemptFromMemRelease, assignHighValues, assignHighValues, assignLowValues, assignLowValues, assignMasterSQLColumnsForArrays, assignObject, assignOverrideSQLTableName, assignSessionId, assignString, assignStringFormatted, assignSubstring, assignValue, assignValue, assignValue, bytesSize, equalsRightTrimmed, fill, fill, getValue, initDefaultValues, initialize, initializeMD, isExcludedFromSQLTable, isExemptFromMemRelease, isFilled, isFilled, isFiller, isResourceAlreadyReleased, resetStructure, retrieveActualLength, retrieveAsString, retrieveAsStringFormatted, retrieveEbcdicValue, retrieveEncodedValue, retrieveField, retrieveField, retrieveFields, retrieveMasterSQLColumnsForArrays, retrieveName, retrieveObject, retrieveSQLObject, retrieveSQLObject, retrieveSQLTableNameOverride, retrieveStorageCellSize, retrieveSubField, retrieveSubstring, retrieveTopLevelField, retrieveValue, retrieveValue, retrieveWrapper, stringValue, toString, trimMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface com.softwaremining.wrappers.ISMBean
assignExemptFromMemRelease, assignSessionId, assignValue, initialize, isExemptFromMemRelease, isResourceAlreadyReleased, resetStructure, retrieveActualLength, retrieveAsString, retrieveField, retrieveField, retrieveTopLevelField, retrieveValue, stringValue
-
Field Details
-
rowFacade
-
nativeKeys
-
postFixTableNameToImplicitDatabaseKey
protected boolean postFixTableNameToImplicitDatabaseKey -
openMode
protected int openMode -
sequentialKeyGeneration
protected boolean sequentialKeyGeneration -
resultSet
-
fileOpened
protected boolean fileOpened -
suppressNextReadCurrent
protected boolean suppressNextReadCurrent -
connection
-
totalRuntime
public static long totalRuntimefor internal use only ... profiling information -
delegateDAO
-
-
Constructor Details
-
AbstractORContainer
public AbstractORContainer() -
AbstractORContainer
-
-
Method Details
-
retrieveOpenMode
public int retrieveOpenMode()- Specified by:
retrieveOpenModein interfaceISQLWrapper
-
retrieveFirstLevelEntry
-
retrieveFileName
returns the table-name associated with this database table.- Specified by:
retrieveFileNamein interfaceISQLWrapper
-
assignRecordKey
Description copied from interface:ISQLWrapperUsed only used by CicsPersistent Subclasses.- Specified by:
assignRecordKeyin interfaceISQLWrapper
-
assignRecordKey
Description copied from interface:ISQLWrapperUsed only used by CicsPersistent Subclasses.- Specified by:
assignRecordKeyin interfaceISQLWrapper
-
assignTreatAsSQLWrapper
public void assignTreatAsSQLWrapper(boolean treatAsSQLWrapper) Description copied from interface:ISQLWrapperUsed 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:
assignTreatAsSQLWrapperin interfaceISQLWrapper
-
addRecordKey
Allows adding single or composite record keys - one at a time & specifying the Ascending/Descending order- Parameters:
recordKey- - ACMOBjectascendDescend- - IPersistence.DESCENDING or IPersistence.ASCENDING
-
retrieveAscentDescendOrder
- Specified by:
retrieveAscentDescendOrderin interfaceISQLWrapper
-
assignAlternateKey
-
assignRelativeKey
-
retrieveRowFacade
- Specified by:
retrieveRowFacadein interfaceISQLWrapper
-
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:
retrieveNativeKeysin interfaceISQLWrapper- Returns:
-
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:
retrieveImplicitDatabaseKeyin interfaceISQLWrapper- Returns:
-
open
- Throws:
IOCriticalException
-
close
- Specified by:
closein interfaceISQLWrapper- Throws:
IOCriticalException
-
commit
- Throws:
IOCriticalException
-
rollback
- Throws:
IOCriticalException
-
seekRecord
translation of COBOL START The method will open a result-set, read the information and then Close the result-set.- Specified by:
seekRecordin interfaceISQLWrapper- Parameters:
key-conditionType-- Throws:
IOStatusException
-
seekRecord
translation of COBOL START The method will open a result-set, read the information and then Close the result-set.- Specified by:
seekRecordin interfaceISQLWrapper- Parameters:
keys-conditionType-- Throws:
IOStatusException
-
seek
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
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
- Throws:
SQLException
-
nextRecord
Translation of COBOL Read Next ...- Throws:
IOStatusException
-
prevRecord
Translation of COBOL Read Next ...- Throws:
IOStatusException
-
readRecord
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:
unlockin interfaceISQLWrapper
-
deleteRecord
equivalant of COBOL delete (for VSAM)- Throws:
IOStatusException
-
clear
clear the result-sets and statements ...- Throws:
IOStatusException
-
insertRecord
Insert a record - populate the values from the existing fields- Throws:
IOStatusException
-
updateRecord
Translation of COBOL REWRITE statement- Throws:
IOStatusException
-
readCurrent
Used in DMS and ILE DAO- Parameters:
useNativeKeys-- Throws:
IOStatusException
-
retrieveDbDecorator
- Specified by:
retrieveDbDecoratorin interfaceISQLWrapper
-
isKeyUnique
public boolean isKeyUnique()- Specified by:
isKeyUniquein interfaceISQLWrapper
-
assignKeyIsUnique
public void assignKeyIsUnique(boolean keyUnique) used primarily in CICS Queues.- Specified by:
assignKeyIsUniquein interfaceISQLWrapper- Parameters:
keyUnique-
-
isChangeGEConditonToLIKE
public boolean isChangeGEConditonToLIKE()Description copied from interface:ISQLWrapperThe 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 becomeSELECT ... from TABLE WHERE KEY_1 LIKE 'A%' AND KEY_2 LIKE 'B%'
This makes a significant performance improvements.- Specified by:
isChangeGEConditonToLIKEin interfaceISQLWrapper
-
assignChangeGEConditonToLIKE
public void assignChangeGEConditonToLIKE(boolean newValue) Description copied from interface:ISQLWrapperThe 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 becomeSELECT ... from TABLE WHERE KEY_1 LIKE 'A%' AND KEY_2 LIKE 'B%'
This makes a significant performance improvements.- Specified by:
assignChangeGEConditonToLIKEin interfaceISQLWrapper
-
isChangeGTEQ2EQForLIKECondition
public boolean isChangeGTEQ2EQForLIKECondition()Description copied from interface:ISQLWrapperFor 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 becomeSELECT ... 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 becomeSELECT ... from TABLE WHERE KEY_1 = 'ABCDE' AND KEY_2 LIKE 'B%'
This can make a significant improvement to performance .- Specified by:
isChangeGTEQ2EQForLIKEConditionin interfaceISQLWrapper
-
assignChangeGTEQ2EQForLIKECondition
public void assignChangeGTEQ2EQForLIKECondition(boolean useEQForExactLenghtMatch) Description copied from interface:ISQLWrapperOnly 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 becomeSELECT ... 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 becomeSELECT ... from TABLE WHERE KEY_1 = 'ABCDE' AND KEY_2 LIKE 'B%'
This can make a significant improvement to performance .- Specified by:
assignChangeGTEQ2EQForLIKEConditionin interfaceISQLWrapper
-
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:
isSeekSuppressedin interfaceISQLWrapper- 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:
assignSuppressSeekin interfaceISQLWrapper
-
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:
assignTopRowSelectStrategyCountin interfaceISQLWrapper
-
retrieveTopRowSelectStrategyCount
public int retrieveTopRowSelectStrategyCount()Description copied from interface:ISQLWrapperFor 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:
retrieveTopRowSelectStrategyCountin interfaceISQLWrapper
-
retrieveTopRowSelectStrategyStartingRow
public int retrieveTopRowSelectStrategyStartingRow()Description copied from interface:ISQLWrapperfor internal use only- Specified by:
retrieveTopRowSelectStrategyStartingRowin interfaceISQLWrapper
-
assignTopRowSelectStrategyRange
public void assignTopRowSelectStrategyRange(int startRowNumber, int count) Description copied from interface:ISQLWrapperSimilar to assignTopRowSelectStrategyCount - but aslso defines starting points- Specified by:
assignTopRowSelectStrategyRangein interfaceISQLWrapper
-
retrieveAdditionalSQLOrderBy
- Specified by:
retrieveAdditionalSQLOrderByin interfaceISQLWrapper
-
assignAdditionalSQLOrderBy
Description copied from interface:ISQLWrapperThis 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:
assignAdditionalSQLOrderByin interfaceISQLWrapper
-
retrieveAdditionalSQLCondition
Hierarchical tables will define additional SQLConditions - e.g. INDX_FLD_TABLE_1 = 12- Specified by:
retrieveAdditionalSQLConditionin interfaceISQLWrapper- Returns:
-
assignAdditionalSQLConditions
Hierarchical tables will define additional SQLConditions - e.g. INDX_FLD_TABLE_1 = 12- Specified by:
assignAdditionalSQLConditionsin interfaceISQLWrapper
-
assignSQLConditions
Define you own SQLConditions - e.g. (A = ?) and (B = ?)- Specified by:
assignSQLConditionsin interfaceISQLWrapper
-
assignAdditionalSQLConditions
Hierarchical tables will define additional SQLConditions - e.g. INDX_FLD_TABLE_1 = 12- Specified by:
assignAdditionalSQLConditionsin interfaceISQLWrapper
-
assignAdditionalSQLForeignKeyCondition
Description copied from interface:ISQLWrapperThis method allows appending to current SQL Conditions without overwriting previous conditions- Specified by:
assignAdditionalSQLForeignKeyConditionin interfaceISQLWrapper
-
clearAdditionalSQLCondition
public void clearAdditionalSQLCondition()- Specified by:
clearAdditionalSQLConditionin interfaceISQLWrapper
-
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
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:
useOidTableForKeyGenerationin interfaceISQLWrapper- Returns:
-
releaseResources
public void releaseResources()this is called internally - after a program is CANCEL'ed. it is to help with the GC process- Overrides:
releaseResourcesin classAbstractContainerBean
-
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:
releaseResourcesin interfaceISMBean- Overrides:
releaseResourcesin classAbstractContainerBean
-
assignAdditionalKeyPosition
Support for Tandem START .... AFTER POSITON ...- Parameters:
theField-position-
-
retrieveSessionId
Description copied from class:AbstractContainerBeanFor internal use only- Specified by:
retrieveSessionIdin interfaceISMBean- Specified by:
retrieveSessionIdin interfaceISQLWrapper- Overrides:
retrieveSessionIdin classAbstractContainerBean
-
isSequentialKeyGeneration
public boolean isSequentialKeyGeneration()- Specified by:
isSequentialKeyGenerationin interfaceISQLWrapper
-
assignSequentialKeyGeneration
public void assignSequentialKeyGeneration(boolean sequentialKeyGeneration) - Specified by:
assignSequentialKeyGenerationin interfaceISQLWrapper
-
retrieveResultSet
- Specified by:
retrieveResultSetin interfaceISQLWrapper
-
assignResultSet
- Specified by:
assignResultSetin interfaceISQLWrapper
-
isKept
public boolean isKept()- Specified by:
isKeptin interfaceISQLWrapper
-
setLock
public void setLock(boolean kept) - Specified by:
setLockin interfaceISQLWrapper
-
isFileOpened
public boolean isFileOpened()- Specified by:
isFileOpenedin interfaceISQLWrapper
-
assignFileOpened
public void assignFileOpened(boolean fileOpened) - Specified by:
assignFileOpenedin interfaceISQLWrapper
-
retrieveLastSeekCondition
public int retrieveLastSeekCondition()- Specified by:
retrieveLastSeekConditionin interfaceISQLWrapper
-
assignLastSeekCondition
public void assignLastSeekCondition(int lastSeekCondition) - Specified by:
assignLastSeekConditionin interfaceISQLWrapper
-
isSuppressNextReadCurrent
public boolean isSuppressNextReadCurrent()- Specified by:
isSuppressNextReadCurrentin interfaceISQLWrapper
-
isLastSeekConditionLookedForEquality
public boolean isLastSeekConditionLookedForEquality()- Specified by:
isLastSeekConditionLookedForEqualityin interfaceISQLWrapper
-
assignLastSeekConditionLookedForEquality
public void assignLastSeekConditionLookedForEquality(boolean lastSeekConditionLookedForEquality) - Specified by:
assignLastSeekConditionLookedForEqualityin interfaceISQLWrapper
-
retrieveResultSetFetchSize
public int retrieveResultSetFetchSize()- Specified by:
retrieveResultSetFetchSizein interfaceISQLWrapper
-
assignResultSetFetchSize
public void assignResultSetFetchSize(int resultSetFetchSize) - Specified by:
assignResultSetFetchSizein interfaceISQLWrapper
-
assignRowFacade
- Specified by:
assignRowFacadein interfaceISQLWrapper
-
assignDbDecorator
- Specified by:
assignDbDecoratorin interfaceISQLWrapper
-
assignOpenMode
public void assignOpenMode(int openMode) - Specified by:
assignOpenModein interfaceISQLWrapper
-
assignTableName
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:
assignTableNamein interfaceISQLWrapper- Parameters:
newName-
-
assignFileName
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
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:
assignSQLTableNamein interfaceISQLWrapper- Parameters:
newName-
-
retrieveTableName
- Specified by:
retrieveTableNamein interfaceISQLWrapper
-
read
public int read()READ is used in conjuction with SEEK statements. Read the next record, trapping at end exceptions ....- Specified by:
readin interfaceISQLWrapper
-
next
public int next()read the next record from file. DOES NOT THROW AtEndException ... instead only the FileStatus will be changed.- Specified by:
nextin interfaceISQLWrapper- 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:
insertin interfaceISQLWrapper
-
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:
updatein interfaceISQLWrapper
-
delete
public int delete()Equivalent of COBOL delete (for VSAM).- Specified by:
deletein interfaceISQLWrapper
-
prev
public int prev()] Equivalent of COBOL VSAM READ PREV- Specified by:
previn interfaceISQLWrapper- 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:
retrieveStatusValuein interfaceISQLWrapper- 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:
assignStatusValuein interfaceISQLWrapper- Parameters:
value- - .. one of ACMBasePersistent.STATUS_xxxx
-
assignStatus
set the status object- Specified by:
assignStatusin interfaceISQLWrapper- Parameters:
status-
-
assignAccessMode
public void assignAccessMode(int accessMode) Similar to the COBOL ACCESS Mode- Specified by:
assignAccessModein interfaceISQLWrapper- 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:
retrieveAccessModein interfaceISQLWrapper- Parameters:
accessMode- : types are defined in ACMBasePersistence.ACCESS_MODE_xxx : Sequential, Random or Dynamic
-
reduceGEorEQ
public void reduceGEorEQ(boolean newValue) Description copied from interface:ISQLWrapperused in AS400 / DB400 to increase speed of searches- Specified by:
reduceGEorEQin interfaceISQLWrapper
-
isReduceGEorEQ
public boolean isReduceGEorEQ()Description copied from interface:ISQLWrapperused in AS400 / DB400 to increase speed of searches- Specified by:
isReduceGEorEQin interfaceISQLWrapper
-
isAllowedToExpandGTEQSearches
public boolean isAllowedToExpandGTEQSearches()Description copied from interface:ISQLWrapperinternal 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:
isAllowedToExpandGTEQSearchesin interfaceISQLWrapper
-
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:
assignExpandGTEQSearchesin interfaceISQLWrapper
-
assignIgnoreOriginalKeys
public void assignIgnoreOriginalKeys(boolean newValue) Description copied from interface:ISQLWrapperfor internal use- Specified by:
assignIgnoreOriginalKeysin interfaceISQLWrapper
-
isIgnoreOriginalKeys
public boolean isIgnoreOriginalKeys()- Specified by:
isIgnoreOriginalKeysin interfaceISQLWrapper
-
retrieveGenerate_OrderBy_ForReadStatements
public boolean retrieveGenerate_OrderBy_ForReadStatements()Description copied from interface:ISQLWrapperfor internal use- Specified by:
retrieveGenerate_OrderBy_ForReadStatementsin interfaceISQLWrapper
-
assignGenerate_OrderBy_ForReadStatements
public void assignGenerate_OrderBy_ForReadStatements(boolean enabled) Description copied from interface:ISQLWrapperREAD() 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_ForReadStatementsin interfaceISQLWrapper
-
assignCachedSeekValues
- Specified by:
assignCachedSeekValuesin interfaceISQLWrapper
-
retrieveCachedSeekValues
- Specified by:
retrieveCachedSeekValuesin interfaceISQLWrapper
-
assignGDGProperty
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:
assignGDGPropertyin interfaceISQLWrapper
-
assignGDGCondition
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:
assignGDGConditionin interfaceISQLWrapper
-
assignDelegateDAO
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:
assignDelegateDAOin interfaceISQLWrapper- Parameters:
delegateDAO-
-
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:
retrieveDelegateDAOin interfaceISQLWrapper- Returns:
-
assignKeyValue
Used only used by CicsPersistent Subclasses.- Parameters:
value-
-
assignKeyValue
public void assignKeyValue(int value) Used only used by CicsPersistent Subclasses.- Parameters:
value-
-
assignKeyValue
Description copied from interface:ISQLWrapperUsed 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:
assignKeyValuein interfaceISQLWrapper
-
retrieveRecordKey
for internal use only- Specified by:
retrieveRecordKeyin interfaceISQLWrapper- Returns:
-
retrieveRecordKeyValue
Used only used by CicsPersistent Subclasses.- Specified by:
retrieveRecordKeyValuein interfaceISQLWrapper- Parameters:
value-
-
validateConditionType
For internal use only reverts to defaults for CONDITION_TYPE_NO_CONDITION and CONDITION_TYPE_NOT_ASSIGNED- Specified by:
validateConditionTypein interfaceISQLWrapper- Parameters:
conditionType-- Returns:
-
retrieveThrowInvalidKeyException
public boolean retrieveThrowInvalidKeyException()for internal use only- Specified by:
retrieveThrowInvalidKeyExceptionin interfaceISQLWrapper- Returns:
-
assignThrowInvalidKeyException
public void assignThrowInvalidKeyException(boolean newValue) for internal use only- Specified by:
assignThrowInvalidKeyExceptionin interfaceISQLWrapper
-
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 generatedSELECT ... 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 <> (A > ?)
or (A = ? and B > ?)- Specified by:
assignLowerLimitForExpandGTEQSearchesin interfaceISQLWrapper
-
retreiveLowerLimitForExpandGTEQSearches
public int retreiveLowerLimitForExpandGTEQSearches()- Specified by:
retreiveLowerLimitForExpandGTEQSearchesin interfaceISQLWrapper
-
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 generatedSELECT ... 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 generatedSELECT ... FROM ... WHERE (A > ?)
and the following conditions will NOT be generated (A = ? and B > ?) or (A = ? and B = ? and C >= ?))- Specified by:
assignUpperLimitForExpandGTEQSearchesin interfaceISQLWrapper
-
retreiveUpperLimitForExpandGTEQSearches
public int retreiveUpperLimitForExpandGTEQSearches()- Specified by:
retreiveUpperLimitForExpandGTEQSearchesin interfaceISQLWrapper
-
assignConnection
- Specified by:
assignConnectionin interfaceISQLWrapper
-
retrieveConnection
- Specified by:
retrieveConnectionin interfaceISQLWrapper
-
assignFetchDirectionIsForward
- Specified by:
assignFetchDirectionIsForwardin interfaceISQLWrapper
-
isFetchDirectionForward
public boolean isFetchDirectionForward()- Specified by:
isFetchDirectionForwardin interfaceISQLWrapper
-
isFetchDirectionBackward
public boolean isFetchDirectionBackward()- Specified by:
isFetchDirectionBackwardin interfaceISQLWrapper
-
retrieveAdditionalSearchParameters
Description copied from interface:ISQLWrapperassignSQLCondition can also have conditions such as "NAME = ?". In that case the program should also use the "addSearchParameter" method to provide values- Specified by:
retrieveAdditionalSearchParametersin interfaceISQLWrapper- Returns:
-
retrieveIncludeRedefinedFieldsInCRUD
public boolean retrieveIncludeRedefinedFieldsInCRUD()- Specified by:
retrieveIncludeRedefinedFieldsInCRUDin interfaceISQLWrapper
-
assignIncludeRedefinedFieldsInCRUD
public void assignIncludeRedefinedFieldsInCRUD(boolean includeRedefinedFieldsInCRUD) - Specified by:
assignIncludeRedefinedFieldsInCRUDin interfaceISQLWrapper
-