Package com.softwaremining.sql
Class AbstractIndexedFile
java.lang.Object
com.softwaremining.wrappers.CBLBean
com.softwaremining.wrappers.AbstractBasePersistence
com.softwaremining.sql.AbstractIndexedFile
- All Implemented Interfaces:
IPersistence
,ISQLWrapper
,AbstractDataObject
,ICBLBeanNGroup
,ICBLContainer
,IFieldContainer
,ISMBean
,ISMDataType
- Direct Known Subclasses:
SQLWrapper
public abstract class AbstractIndexedFile
extends AbstractBasePersistence
implements ISQLWrapper, IPersistence
Subclasses of this type can talk to either Indexed-Files, or Database tables
-
Field Summary
FieldsFields inherited from class com.softwaremining.wrappers.AbstractBasePersistence
fileName, ownerClassName, status
Fields inherited from class com.softwaremining.wrappers.CBLBean
EBCDIC_JIT_PD_SUPPORT_FOR_SEQ_FILES, INDEX_FOR_NON_ARRAY_VERSION_OF_FIELD, INDEX_ZERO, log, tmp_lengthofAssignedValue, totalRuntime_allocate, totalRuntime_calcFieldOffsets, totalRuntime_getMemoryPosition, totalRuntime_setFieldFormatted
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
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected static void
_assignKeyValue
(ISQLWrapper me, String value) protected abstract int
_clear
(ISQLWrapper wrapper) protected abstract int
_close
(ISQLWrapper wrapper) protected abstract void
_commit
(ISQLWrapper wrapper) protected abstract int
_deleteAllRecord
(ISQLWrapper wrapper) protected abstract int
_deleteRecord
(ISQLWrapper wrapper) protected abstract int
_insertRecord
(ISQLWrapper wrapper) protected abstract int
_nextRecord
(ISQLWrapper wrapper) protected abstract int
_open
(ISQLWrapper wrapper, int openMode) protected abstract int
_prevRecord
(ISQLWrapper wrapper) protected abstract int
_readRecord
(ISQLWrapper wrapper) protected abstract int
_readWithLock
(ISQLWrapper wrapper) protected abstract void
_rollback
(ISQLWrapper wrapper) protected abstract int
_seekRecord
(ISMObject[] keys, int conditionType) protected abstract void
_unlock
(ISQLWrapper wrapper) protected abstract int
_updateRecord
(ISQLWrapper wrapper) void
assignAccessMode
(int accessMode) Similar to the COBOL ACCESS Modefinal void
assignDelegateDAO
(ISQLWrapper delegateDAO) Indexed files with totally different formats will sometimes still need to go to same database table.final void
assignStatus
(ISMObject status) set the status objectint
clear()
clear the result-sets and statements ...int
close()
Close the filefinal void
commit()
int
delete()
Equivalent of COBOL delete (for VSAM).int
int
when operation is Unsuccessful throw Exception (e.g KeyNotFountException).int
insert()
Insert a record - populate the values from the existing fieldsint
Insert a record - populate the values from the existing fieldsint
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 Prev ...int
read()
READ is used in conjuction with SEEK statements.int
Equivalent of COBOL READ , at end throw exception If AccessMode is not SEQUENTIAL, a seek() will be performed before the read.int
protected void
final ISQLWrapper
Indexed files with totally different formats will sometimes still need to go to same database table.final void
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 : IPersistence.CONDITION_TYPE_NO_CONDITION = 0; IPersistence.CONDITION_TYPE_EQUALS = 1; IPersistence.CONDITION_TYPE_GREATER = 2; IPersistence.CONDITION_TYPE_LESS = 3; IPersistence.CONDITION_TYPE_GREATER_OR_EQUALS = 4; IPersistence.CONDITION_TYPE_LESS_OR_EQUALS = 5;final int
seekRecord
(ISMObject key) int
seekRecord
(ISMObject[] keys, int conditionType) 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
unlock()
int
update()
Update the current record with the current record structure.int
Translation of COBOL REWRITE statementMethods inherited from class com.softwaremining.wrappers.AbstractBasePersistence
assignFileName, assignLock, assignStatus, assignStatusAsPrimitive, assignStatusValue, assignStatusValue, assignTableName, readRow, retrieveAccessMode, retrieveFileName, retrieveFileName, retrieveFirstLevelEntry, retrieveOpenMode, retrieveSessionId, retrieveStatusField, retrieveStatusValue
Methods inherited from class com.softwaremining.wrappers.CBLBean
addCorrespondingValue, addCorrespondingValue, allocate, assignAddressTo, assignAddressTo, assignBean, assignBytesEncoded, assignCachedInitializationValue, assignCorrespondingValue, assignCorrespondingValue, assignDefaultValue, assignDependingField, assignEbcdicBytes, assignEbcdicJIT_PdSupportForSequentialFiles, assignEncodedValue, assignExemptFromMemRelease, assignExternal, assignHighValues, assignInternalVars, assignLowValues, assignRawEbcdicBytes, assignRecordSize, assignRedefines, assignRedefines, assignSessionId, assignStringFormatted, assignSubstring, assignSubstring, assignToAddressOf, assignToAddressOf, assignToAddressOf, assignToAddressOf, assignToAllFields, assignValue, assignValue, assignValue, assignValue, assignValue, assignValue, assignValue, calculateStorageSize, containsPointers, equals, equals, equals, equals, equalsRightTrimmed, fieldsCount, fill, fill, fill, fill, fill, getValue, hasPackedDecimalFields, initDefaultValues, initialize, initialize, isExemptFromMemRelease, isFilled, isFilled, isFilled, isFilled, isGreaterThan, isGreaterThan, isGreaterThan, isHighValues, isInvolvedInDependency, isInvolvedInExternalDependency, isLessOrEqualTo, isLessOrEqualTo, isLessOrEqualTo, isLessOrEqualTo, isLessOrEqualTo, isLessThan, isLessThan, isLessThan, isLessThan, isLessThan, isLowValues, isRedefinedByAnotherClass, isResourceAlreadyReleased, lengthOf, printFieldPosition, printFieldValues, printOrderedFieldPosition, PrintOrderedFieldPositionsAndValue, releaseResources, releaseResources, resetCachedValues, resetCompressedFieldList, resetStructure, resize, retrieveActualLength, retrieveAsInt, retrieveAsString, retrieveCachedInitializationValue, retrieveCompressedFields, retrieveDependedFieldsList, retrieveEbcdicBytes, retrieveEbcdicValue, retrieveEncodedValue, retrieveField, retrieveField, retrieveFieldAtMemoryPosition, retrieveFieldFormatted, retrieveFields, retrieveIsTargetOfPointers, retrievePrimitiveFields, retrieveRawEbcdicBytes, retrieveSQLObject, retrieveStorageCellSize, retrieveStorageChars, retrieveSubstring, retrieveSubstring, retrieveTopLevelField, retrieveValue, retrieveValue, setValue, stringValue, subtractCorrespondingValue, subtractCorrespondingValue, toString
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, releaseResources, resetStructure, retrieveActualLength, retrieveAsString, retrieveField, retrieveField, retrieveTopLevelField, retrieveValue, stringValue
Methods inherited from interface com.softwaremining.sql.ISQLWrapper
assignAdditionalSQLConditions, assignAdditionalSQLConditions, assignAdditionalSQLOrderBy, assignCachedSeekValues, assignChangeGEConditonToLIKE, assignChangeGTEQ2EQForLIKECondition, assignConnection, assignDbDecorator, assignExpandGTEQSearches, assignFetchDirectionIsForward, assignFileOpened, assignGDGCondition, assignGDGProperty, assignGenerate_OrderBy_ForReadStatements, assignIgnoreOriginalKeys, assignKeyIsUnique, assignKeyValue, assignLastSeekCondition, assignLastSeekConditionLookedForEquality, assignLowerLimitForExpandGTEQSearches, assignOpenMode, assignRecordKey, assignRecordKey, assignResultSet, assignResultSetFetchSize, assignRowFacade, assignSequentialKeyGeneration, assignSQLConditions, assignSQLTableName, assignStatusValue, assignSuppressSeek, assignTableName, assignThrowInvalidKeyException, assignTopRowSelectStrategyCount, assignTopRowSelectStrategyRange, assignTreatAsSQLWrapper, assignUpperLimitForExpandGTEQSearches, isAllowedToExpandGTEQSearches, isChangeGEConditonToLIKE, isChangeGTEQ2EQForLIKECondition, isFetchDirectionBackward, isFetchDirectionForward, isFileOpened, isIgnoreOriginalKeys, isKept, isKeyUnique, isLastSeekConditionLookedForEquality, isReduceGEorEQ, isSeekSuppressed, isSequentialKeyGeneration, isSuppressNextReadCurrent, reduceGEorEQ, retreiveLowerLimitForExpandGTEQSearches, retreiveUpperLimitForExpandGTEQSearches, retrieveAccessMode, retrieveAdditionalSearchParameters, retrieveAdditionalSQLCondition, retrieveAdditionalSQLOrderBy, retrieveAscentDescendOrder, retrieveCachedSeekValues, retrieveConnection, retrieveDbDecorator, retrieveFileName, retrieveGenerate_OrderBy_ForReadStatements, retrieveImplicitDatabaseKey, retrieveLastSeekCondition, retrieveNativeKeys, retrieveOpenMode, retrieveRecordKey, retrieveRecordKeyValue, retrieveResultSet, retrieveResultSetFetchSize, retrieveRowFacade, retrieveSessionId, retrieveStatusValue, retrieveTableName, retrieveThrowInvalidKeyException, retrieveTopRowSelectStrategyCount, retrieveTopRowSelectStrategyStartingRow, setLock, useOidTableForKeyGeneration, validateConditionType
-
Field Details
-
delegateDAO
-
-
Constructor Details
-
AbstractIndexedFile
public AbstractIndexedFile() -
AbstractIndexedFile
-
-
Method Details
-
_seekRecord
- Throws:
IOStatusException
-
seekRecord
-
seekRecord
- Specified by:
seekRecord
in interfaceISQLWrapper
- Throws:
IOStatusException
-
seek
Go to the record identified by key Condition type is one of : IPersistence.CONDITION_TYPE_NO_CONDITION = 0; IPersistence.CONDITION_TYPE_EQUALS = 1; IPersistence.CONDITION_TYPE_GREATER = 2; IPersistence.CONDITION_TYPE_LESS = 3; IPersistence.CONDITION_TYPE_GREATER_OR_EQUALS = 4; IPersistence.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
-
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
-
_assignKeyValue
-
_nextRecord
- Throws:
IOStatusException
-
_prevRecord
- Throws:
IOStatusException
-
_readRecord
- Throws:
IOStatusException
-
_open
-
_close
-
_commit
-
_rollback
-
_readWithLock
-
_unlock
-
_insertRecord
-
_updateRecord
-
_deleteRecord
-
_deleteAllRecord
-
_clear
-
open
- Specified by:
open
in classAbstractBasePersistence
- Throws:
IOCriticalException
-
close
Description copied from class:AbstractBasePersistence
Close the file- Specified by:
close
in interfaceISQLWrapper
- Specified by:
close
in classAbstractBasePersistence
- Returns:
- when successful it returns IPersistence.STATUS_SUCCESS
- Throws:
IOCriticalException
-
nextRecord
Translation of COBOL Read Next ...- Specified by:
nextRecord
in classAbstractBasePersistence
- Returns:
- IPersistence.STATUS_SUCCESS if records are found, Otherwise returns other values from IPersistence;
- Throws:
IOStatusException
-
prevRecord
Translation of COBOL Read Prev ...- Specified by:
prevRecord
in classAbstractBasePersistence
- Returns:
- IPersistence.STATUS_SUCCESS if records are found, Otherwise returns other values from IPersistence;
- Throws:
IOStatusException
-
readRecord
Equivalent of COBOL READ , at end throw exception If AccessMode is not SEQUENTIAL, a seek() will be performed before the read.- Specified by:
readRecord
in classAbstractBasePersistence
- Returns:
- IPersistence.STATUS_SUCCESS if records are found, Otherwise returns other values from IPersistence;
- Throws:
IOStatusException
-
readWithLock
public int readWithLock() -
insertRecord
Insert a record - populate the values from the existing fields- Specified by:
insertRecord
in classAbstractBasePersistence
- Returns:
- when successful it returns IPersistence.STATUS_SUCCESS
- Throws:
IOStatusException
-
unlock
public void unlock()- Specified by:
unlock
in interfaceISQLWrapper
-
deleteRecord
Description copied from class:AbstractBasePersistence
when operation is Unsuccessful throw Exception (e.g KeyNotFountException). See com.softwaremining.wrappers.exceptions- Specified by:
deleteRecord
in classAbstractBasePersistence
- Returns:
- when successful it returns IPersistence.STATUS_SUCCESS
- Throws:
IOStatusException
-
deleteAllRecord
- Throws:
IOStatusException
-
clear
clear the result-sets and statements ...- Specified by:
clear
in classAbstractBasePersistence
- Returns:
- when successful it returns IPersistence.STATUS_SUCCESS
- Throws:
IOStatusException
-
updateRecord
Translation of COBOL REWRITE statement- Specified by:
updateRecord
in classAbstractBasePersistence
- Returns:
- when successful it returns IPersistence.STATUS_SUCCESS
- Throws:
IOStatusException
-
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
- Overrides:
read
in classAbstractBasePersistence
- Returns:
- IPersistence.STATUS_SUCCESS if records are found, Otherwise returns other values from IPersistence;
-
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
- Overrides:
next
in classAbstractBasePersistence
- Returns:
- IPersistence.STATUS_SUCCESS if records are found, Otherwise returns other values from IPersistence;
-
insert
public int insert()Insert a record - populate the values from the existing fields- Specified by:
insert
in interfaceISQLWrapper
- Overrides:
insert
in classAbstractBasePersistence
-
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
- Overrides:
update
in classAbstractBasePersistence
-
delete
public int delete()Equivalent of COBOL delete (for VSAM).- Specified by:
delete
in interfaceISQLWrapper
- Overrides:
delete
in classAbstractBasePersistence
-
prev
public int prev()] Equivalent of COBOL VSAM READ PREV- Specified by:
prev
in interfaceISQLWrapper
- Overrides:
prev
in classAbstractBasePersistence
- Returns:
- IPersistence.STATUS_SUCCESS if records are found, Otherwise returns other values from IPersistence;
-
resetCicsDelegate
protected void resetCicsDelegate() -
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:
-
assignAccessMode
public void assignAccessMode(int accessMode) Similar to the COBOL ACCESS Mode- Specified by:
assignAccessMode
in interfaceISQLWrapper
- Overrides:
assignAccessMode
in classAbstractBasePersistence
- Parameters:
accessMode
- : types are defined in IPersistence.ACCESS_MODE_xxx : Sequential, Random or Dynamic
-
commit
- Throws:
IOCriticalException
-
rollback
- Throws:
IOCriticalException
-
assignStatus
Description copied from class:AbstractBasePersistence
set the status object- Specified by:
assignStatus
in interfaceISQLWrapper
- Overrides:
assignStatus
in classAbstractBasePersistence
- Parameters:
status
-
-