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
Modifier and TypeFieldDescriptionprotected Connection
protected ISQLWrapper
protected boolean
protected ISMObject[]
protected int
protected boolean
protected ResultSet
protected RowFacade
protected boolean
protected boolean
static long
for 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_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_REWRITE_WITHOUT_READ, STATUS_SM_FAIL_UNKOWN_REASON, STATUS_SM_NOT_ASSIGNED, STATUS_SUCCESS, UNCERTAIN_OF_RETURN_VALUE
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
addRecordKey
(ISMObject recordKey, Boolean ascendDescend) Allows adding single or composite record keys - one at a time invalid input: '&' specifying the Ascending/Descending ordervoid
assignAccessMode
(int accessMode) Similar to the COBOL ACCESS Modevoid
assignAdditionalKeyPosition
(ISMObject theField, int position) Support for Tandem START ....void
assignAdditionalSQLConditions
(String condition) Hierarchical tables will define additional SQLConditions - e.g.void
assignAdditionalSQLConditions
(StringBuilder condition) Hierarchical tables will define additional SQLConditions - e.g.void
assignAdditionalSQLOrderBy
(String newValue) This method allows inserting additional Ordering clauses It is useful in hierarchical tables will define additional SQLConditions - e.g.void
assignAlternateKey
(ISMObject alternateKey) void
assignCachedSeekValues
(List objects) void
assignChangeGEConditonToLIKE
(boolean newValue) The system can replace GE searches to LIKE statements.void
assignChangeGTEQ2EQForLIKECondition
(boolean useEQForExactLenghtMatch) Only applies when OR_CHANGE_GE_CONDITION_TO_LIKE__DEFAULT=true
E.g.void
assignConnection
(Connection connection) void
assignDbDecorator
(ACMDbDecorator dbDecorator) void
assignDelegateDAO
(ISQLWrapper delegateDAO) Indexed files with totally different formats will sometimes still need to go to same database table.void
assignExpandGTEQSearches
(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 >= ?)void
assignFetchDirectionIsForward
(Boolean direction) 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.void
assignFileName
(String newName) This method does not do anything on this class.void
assignFileOpened
(boolean fileOpened) void
assignGDGCondition
(String gdgProperty) Additional SQL statement to be read from gdg.properties file.void
assignGDGProperty
(String setgdgProperty) Additional SQL statement to be read from gdg.properties file.void
assignGenerate_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.void
assignIgnoreOriginalKeys
(boolean newValue) for internal usevoid
assignKeyIsUnique
(boolean keyUnique) used primarily in CICS Queues.void
assignKeyValue
(int value) Used only used by CicsPersistent Subclasses.void
assignKeyValue
(AbstractDataObject keyValueField) Used only used by CicsPersistent Subclasses.protected void
assignKeyValue
(String value) Used only used by CicsPersistent Subclasses.void
assignLastSeekCondition
(int lastSeekCondition) void
assignLastSeekConditionLookedForEquality
(boolean lastSeekConditionLookedForEquality) void
assignLowerLimitForExpandGTEQSearches
(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 generatedvoid
assignOpenMode
(int openMode) void
assignRecordKey
(ISMObject recordKey) Used only used by CicsPersistent Subclasses.void
assignRecordKey
(ISMObject[] recordKeys) Used only used by CicsPersistent Subclasses.void
assignRelativeKey
(AbstractCBLNumeric relativeKey) void
assignResultSet
(ResultSet resultSet) void
assignResultSetFetchSize
(int resultSetFetchSize) void
assignRowFacade
(RowFacade rowFacade) void
assignSequentialKeyGeneration
(boolean sequentialKeyGeneration) void
assignSQLConditions
(String condition) Define you own SQLConditions - e.g.void
assignSQLTableName
(String newName) Called by "persistence" Classes themselves allows overriding the default table name.void
assignStatus
(ISMObject status) set the status objectvoid
assignStatusValue
(int value) Used internally to set the IO operation status-values.void
assignSuppressSeek
(boolean newValue) for internal use only - For VSAM SEEK / READ / ...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.void
assignThrowInvalidKeyException
(boolean newValue) for internal use onlyvoid
assignTopRowSelectStrategyCount
(int count) (Default = -1) When set to 0 or 1 , the Object-Relation SQL Generator will produce:void
assignTopRowSelectStrategyRange
(int startRowNumber, int count) Similar to assignTopRowSelectStrategyCount - but aslso defines starting pointsvoid
assignTreatAsSQLWrapper
(boolean treatAsSQLWrapper) Used only used by CicsPersistent Subclasses.void
assignUpperLimitForExpandGTEQSearches
(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 generatedint
clear()
clear the result-sets and statements ...int
close()
void
commit()
int
delete()
Equivalent of COBOL delete (for VSAM).int
equivalant of COBOL delete (for VSAM)protected ISMObject[]
Stub method to be over-written by LinkedSQLWrapper class.int
insert()
Insert a record - populate the values from the existing fieldsint
Insert a record - populate the values from the existing fieldsboolean
internal use only.boolean
The system can replace GE searches to LIKE statements.boolean
For internal Use only.boolean
boolean
boolean
boolean
boolean
isKept()
boolean
boolean
boolean
used in AS400 / DB400 to increase speed of searchesboolean
for internal use only - For VSAM SEEK / READ / ...boolean
boolean
int
next()
read the next record from file.int
Translation of COBOL Read Next ...int
open
(int openMode) int
prev()
] Equivalent of COBOL VSAM READ PREVint
Translation of COBOL Read Next ...int
read()
READ is used in conjuction with SEEK statements.protected void
readCurrent
(boolean useNativeKeys) Used in DMS and ILE DAOint
Equivalant of COBOL READ , at end throw exception If AccessMode is not SEQUENTIAL, a seek() will be performed before the read.int
void
reduceGEorEQ
(boolean newValue) used in AS400 / DB400 to increase speed of searchesvoid
this is called internally - after a program is CANCEL'ed.void
releaseResources
(boolean forceRelease) this is called internally - after a program is CANCEL'ed.protected void
restoreResultSet
(int conditionType, ISMObject[] searchKeys) int
int
int
Similar 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.boolean
for internal useNative Keys refer to either a.int
Native Keys refer to either a.int
for internal use onlyUsed only used by CicsPersistent Subclasses.int
For internal use onlyint
Used internally to set the IO operation status-values.boolean
for internal use onlyint
For internal use only (Default = -1) When set to 0 or 1 , the Object-Relation SQL Generator will produce:int
for internal use onlyvoid
rollback()
int
translation of COBOL START The method will open a result-set, read the information and then Close the result-set.int
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;int
seekRecord
(ISMObject[] keys, int conditionType) translation of COBOL START The method will open a result-set, read the information and then Close the result-set.int
seekRecord
(ISMObject key, int conditionType) translation of COBOL START The method will open a result-set, read the information and then Close the result-set.void
setLock
(boolean kept) void
unlock()
int
update()
Update the current record with the current record structure.int
Translation of COBOL REWRITE statementboolean
Stub method to be over-written by LinkedSQLWrapper class.int
validateConditionType
(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, trim
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods 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:
retrieveOpenMode
in interfaceISQLWrapper
-
retrieveFirstLevelEntry
-
retrieveFileName
returns the table-name associated with this database table.- Specified by:
retrieveFileName
in interfaceISQLWrapper
-
assignRecordKey
Description copied from interface:ISQLWrapper
Used only used by CicsPersistent Subclasses.- Specified by:
assignRecordKey
in interfaceISQLWrapper
-
assignRecordKey
Description copied from interface:ISQLWrapper
Used only used by CicsPersistent Subclasses.- Specified by:
assignRecordKey
in interfaceISQLWrapper
-
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 interfaceISQLWrapper
-
addRecordKey
Allows adding single or composite record keys - one at a time invalid input: '&' specifying the Ascending/Descending order- Parameters:
recordKey
- - ACMOBjectascendDescend
- - IPersistence.DESCENDING or IPersistence.ASCENDING
-
retrieveAscentDescendOrder
- Specified by:
retrieveAscentDescendOrder
in interfaceISQLWrapper
-
assignAlternateKey
-
assignRelativeKey
-
retrieveRowFacade
- Specified by:
retrieveRowFacade
in 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:
retrieveNativeKeys
in 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:
retrieveImplicitDatabaseKey
in interfaceISQLWrapper
- Returns:
-
open
- Throws:
IOCriticalException
-
close
- Specified by:
close
in 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:
seekRecord
in 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:
seekRecord
in 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:
unlock
in 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:
retrieveDbDecorator
in interfaceISQLWrapper
-
isKeyUnique
public boolean isKeyUnique()- Specified by:
isKeyUnique
in interfaceISQLWrapper
-
assignKeyIsUnique
public void assignKeyIsUnique(boolean keyUnique) used primarily in CICS Queues.- Specified by:
assignKeyIsUnique
in interfaceISQLWrapper
- 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 becomeSELECT ... from TABLE WHERE KEY_1 LIKE 'A%' AND KEY_2 LIKE 'B%'
This makes a significant performance improvements.- Specified by:
isChangeGEConditonToLIKE
in interfaceISQLWrapper
-
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 becomeSELECT ... from TABLE WHERE KEY_1 LIKE 'A%' AND KEY_2 LIKE 'B%'
This makes a significant performance improvements.- Specified by:
assignChangeGEConditonToLIKE
in interfaceISQLWrapper
-
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 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:
isChangeGTEQ2EQForLIKECondition
in interfaceISQLWrapper
-
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 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:
assignChangeGTEQ2EQForLIKECondition
in 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:
isSeekSuppressed
in 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:
assignSuppressSeek
in 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:
assignTopRowSelectStrategyCount
in interfaceISQLWrapper
-
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 interfaceISQLWrapper
-
retrieveTopRowSelectStrategyStartingRow
public int retrieveTopRowSelectStrategyStartingRow()Description copied from interface:ISQLWrapper
for internal use only- Specified by:
retrieveTopRowSelectStrategyStartingRow
in interfaceISQLWrapper
-
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 interfaceISQLWrapper
- Parameters:
startRowNumber
-count
-
-
retrieveAdditionalSQLOrderBy
- Specified by:
retrieveAdditionalSQLOrderBy
in interfaceISQLWrapper
-
assignAdditionalSQLOrderBy
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 interfaceISQLWrapper
-
retrieveAdditionalSQLCondition
Hierarchical tables will define additional SQLConditions - e.g. INDX_FLD_TABLE_1 = 12- Specified by:
retrieveAdditionalSQLCondition
in interfaceISQLWrapper
- Returns:
-
assignAdditionalSQLConditions
Hierarchical tables will define additional SQLConditions - e.g. INDX_FLD_TABLE_1 = 12- Specified by:
assignAdditionalSQLConditions
in interfaceISQLWrapper
- Parameters:
condition
-
-
assignSQLConditions
Define you own SQLConditions - e.g. (A = ?) and (B = ?)- Specified by:
assignSQLConditions
in interfaceISQLWrapper
- Parameters:
condition
-
-
assignAdditionalSQLConditions
Hierarchical tables will define additional SQLConditions - e.g. INDX_FLD_TABLE_1 = 12- Specified by:
assignAdditionalSQLConditions
in interfaceISQLWrapper
- 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
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 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:
releaseResources
in 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:
releaseResources
in interfaceISMBean
- Overrides:
releaseResources
in classAbstractContainerBean
- Parameters:
forceRelease
-
-
assignAdditionalKeyPosition
Support for Tandem START .... AFTER POSITON ...- Parameters:
theField
-position
-
-
retrieveSessionId
Description copied from class:AbstractContainerBean
For internal use only- Specified by:
retrieveSessionId
in interfaceISMBean
- Specified by:
retrieveSessionId
in interfaceISQLWrapper
- Overrides:
retrieveSessionId
in classAbstractContainerBean
-
isSequentialKeyGeneration
public boolean isSequentialKeyGeneration()- Specified by:
isSequentialKeyGeneration
in interfaceISQLWrapper
-
assignSequentialKeyGeneration
public void assignSequentialKeyGeneration(boolean sequentialKeyGeneration) - Specified by:
assignSequentialKeyGeneration
in interfaceISQLWrapper
-
retrieveResultSet
- Specified by:
retrieveResultSet
in interfaceISQLWrapper
-
assignResultSet
- Specified by:
assignResultSet
in interfaceISQLWrapper
-
isKept
public boolean isKept()- Specified by:
isKept
in interfaceISQLWrapper
-
setLock
public void setLock(boolean kept) - Specified by:
setLock
in interfaceISQLWrapper
-
isFileOpened
public boolean isFileOpened()- Specified by:
isFileOpened
in interfaceISQLWrapper
-
assignFileOpened
public void assignFileOpened(boolean fileOpened) - Specified by:
assignFileOpened
in interfaceISQLWrapper
-
retrieveLastSeekCondition
public int retrieveLastSeekCondition()- Specified by:
retrieveLastSeekCondition
in interfaceISQLWrapper
-
assignLastSeekCondition
public void assignLastSeekCondition(int lastSeekCondition) - Specified by:
assignLastSeekCondition
in interfaceISQLWrapper
-
isSuppressNextReadCurrent
public boolean isSuppressNextReadCurrent()- Specified by:
isSuppressNextReadCurrent
in interfaceISQLWrapper
-
isLastSeekConditionLookedForEquality
public boolean isLastSeekConditionLookedForEquality()- Specified by:
isLastSeekConditionLookedForEquality
in interfaceISQLWrapper
-
assignLastSeekConditionLookedForEquality
public void assignLastSeekConditionLookedForEquality(boolean lastSeekConditionLookedForEquality) - Specified by:
assignLastSeekConditionLookedForEquality
in interfaceISQLWrapper
-
retrieveResultSetFetchSize
public int retrieveResultSetFetchSize()- Specified by:
retrieveResultSetFetchSize
in interfaceISQLWrapper
-
assignResultSetFetchSize
public void assignResultSetFetchSize(int resultSetFetchSize) - Specified by:
assignResultSetFetchSize
in interfaceISQLWrapper
-
assignRowFacade
- Specified by:
assignRowFacade
in interfaceISQLWrapper
-
assignDbDecorator
- Specified by:
assignDbDecorator
in interfaceISQLWrapper
-
assignOpenMode
public void assignOpenMode(int openMode) - Specified by:
assignOpenMode
in 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:
assignTableName
in 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:
assignSQLTableName
in interfaceISQLWrapper
- Parameters:
newName
-
-
retrieveTableName
- Specified by:
retrieveTableName
in interfaceISQLWrapper
-
read
public int read()READ is used in conjuction with SEEK statements. Read the next record, trapping at end exceptions ....- Specified by:
read
in interfaceISQLWrapper
-
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 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:
insert
in 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:
update
in interfaceISQLWrapper
-
delete
public int delete()Equivalent of COBOL delete (for VSAM).- Specified by:
delete
in interfaceISQLWrapper
-
prev
public int prev()] Equivalent of COBOL VSAM READ PREV- Specified by:
prev
in 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:
retrieveStatusValue
in 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:
assignStatusValue
in interfaceISQLWrapper
- Parameters:
value
- - .. one of ACMBasePersistent.STATUS_xxxx
-
assignStatus
set the status object- Specified by:
assignStatus
in interfaceISQLWrapper
- Parameters:
status
-
-
assignAccessMode
public void assignAccessMode(int accessMode) Similar to the COBOL ACCESS Mode- Specified by:
assignAccessMode
in 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:
retrieveAccessMode
in 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:ISQLWrapper
used in AS400 / DB400 to increase speed of searches- Specified by:
reduceGEorEQ
in interfaceISQLWrapper
-
isReduceGEorEQ
public boolean isReduceGEorEQ()Description copied from interface:ISQLWrapper
used in AS400 / DB400 to increase speed of searches- Specified by:
isReduceGEorEQ
in interfaceISQLWrapper
-
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 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:
assignExpandGTEQSearches
in interfaceISQLWrapper
-
assignIgnoreOriginalKeys
public void assignIgnoreOriginalKeys(boolean newValue) Description copied from interface:ISQLWrapper
for internal use- Specified by:
assignIgnoreOriginalKeys
in interfaceISQLWrapper
- Parameters:
newValue
-
-
isIgnoreOriginalKeys
public boolean isIgnoreOriginalKeys()- Specified by:
isIgnoreOriginalKeys
in interfaceISQLWrapper
-
retrieveGenerate_OrderBy_ForReadStatements
public boolean retrieveGenerate_OrderBy_ForReadStatements()Description copied from interface:ISQLWrapper
for internal use- Specified by:
retrieveGenerate_OrderBy_ForReadStatements
in interfaceISQLWrapper
-
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 interfaceISQLWrapper
-
assignCachedSeekValues
- Specified by:
assignCachedSeekValues
in interfaceISQLWrapper
-
retrieveCachedSeekValues
- Specified by:
retrieveCachedSeekValues
in 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:
assignGDGProperty
in 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:
assignGDGCondition
in 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:
assignDelegateDAO
in 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:
retrieveDelegateDAO
in 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: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 interfaceISQLWrapper
-
retrieveRecordKey
for internal use only- Specified by:
retrieveRecordKey
in interfaceISQLWrapper
- Returns:
-
retrieveRecordKeyValue
Used only used by CicsPersistent Subclasses.- Specified by:
retrieveRecordKeyValue
in interfaceISQLWrapper
- Parameters:
value
-
-
validateConditionType
For internal use only reverts to defaults for CONDITION_TYPE_NO_CONDITION and CONDITION_TYPE_NOT_ASSIGNED- Specified by:
validateConditionType
in interfaceISQLWrapper
- Parameters:
conditionType
-- Returns:
-
retrieveThrowInvalidKeyException
public boolean retrieveThrowInvalidKeyException()for internal use only- Specified by:
retrieveThrowInvalidKeyException
in interfaceISQLWrapper
- Returns:
-
assignThrowInvalidKeyException
public void assignThrowInvalidKeyException(boolean newValue) for internal use only- Specified by:
assignThrowInvalidKeyException
in 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 invalid input: '<'> (A > ?)
or (A = ? and B > ?)- Specified by:
assignLowerLimitForExpandGTEQSearches
in interfaceISQLWrapper
-
retreiveLowerLimitForExpandGTEQSearches
public int retreiveLowerLimitForExpandGTEQSearches()- Specified by:
retreiveLowerLimitForExpandGTEQSearches
in 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:
assignUpperLimitForExpandGTEQSearches
in interfaceISQLWrapper
-
retreiveUpperLimitForExpandGTEQSearches
public int retreiveUpperLimitForExpandGTEQSearches()- Specified by:
retreiveUpperLimitForExpandGTEQSearches
in interfaceISQLWrapper
-
assignConnection
- Specified by:
assignConnection
in interfaceISQLWrapper
-
retrieveConnection
- Specified by:
retrieveConnection
in interfaceISQLWrapper
-
assignFetchDirectionIsForward
- Specified by:
assignFetchDirectionIsForward
in interfaceISQLWrapper
-
isFetchDirectionForward
public boolean isFetchDirectionForward()- Specified by:
isFetchDirectionForward
in interfaceISQLWrapper
-
isFetchDirectionBackward
public boolean isFetchDirectionBackward()- Specified by:
isFetchDirectionBackward
in interfaceISQLWrapper
-
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 interfaceISQLWrapper
- Returns:
-