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, statusFields 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_setFieldFormattedFields 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 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) voidassignAccessMode(int accessMode) Similar to the COBOL ACCESS Modefinal voidassignDelegateDAO(ISQLWrapper delegateDAO) Indexed files with totally different formats will sometimes still need to go to same database table.final voidassignStatus(ISMObject status) set the status objectintclear()clear the result-sets and statements ...intclose()Close the filefinal voidcommit()intdelete()Equivalent of COBOL delete (for VSAM).intintwhen operation is Unsuccessful throw Exception (e.g KeyNotFountException).intinsert()Insert a record - populate the values from the existing fieldsintInsert a record - populate the values from the existing fieldsintnext()read the next record from file.intTranslation of COBOL Read Next ...intopen(int openMode) intprev()] Equivalent of COBOL VSAM READ PREVintTranslation of COBOL Read Prev ...intread()READ is used in conjuction with SEEK statements.intEquivalent of COBOL READ , at end throw exception If AccessMode is not SEQUENTIAL, a seek() will be performed before the read.intprotected voidfinal ISQLWrapperIndexed files with totally different formats will sometimes still need to go to same database table.final voidrollback()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 : 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 intseekRecord(ISMObject key) intseekRecord(ISMObject[] keys, int conditionType) 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.voidunlock()intupdate()Update the current record with the current record structure.intTranslation 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, retrieveStatusValueMethods 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, 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, print, printFieldPosition, printFieldValues, printOrderedFieldPosition, releaseResources, releaseResources, resetCachedValues, resetCompressedFieldList, resetStorageManager, resetStructure, resize, retrieveActualLength, retrieveAsInt, retrieveAsString, retrieveCachedInitializationValue, retrieveCompressedFields, retrieveDependedFieldsList, retrieveEbcdicBytes, retrieveEbcdicValue, retrieveEncodedValue, retrieveField, retrieveField, retrieveFieldAtMemoryPosition, retrieveFieldFormatted, retrieveFields, retrieveIsTargetOfPointers, retrievePrimitiveFields, retrieveRawEbcdicBytes, retrieveRedefinesList, retrieveSQLObject, retrieveStorageBytes, retrieveStorageCellSize, retrieveSubstring, retrieveSubstring, retrieveTopLevelField, retrieveValue, retrieveValue, setValue, stringValue, subtractCorrespondingValue, subtractCorrespondingValue, toStringMethods 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, releaseResources, resetStructure, retrieveActualLength, retrieveAsString, retrieveField, retrieveField, retrieveTopLevelField, retrieveValue, stringValueMethods inherited from interface com.softwaremining.sql.ISQLWrapper
assignAdditionalSQLConditions, assignAdditionalSQLConditions, assignAdditionalSQLForeignKeyCondition, assignAdditionalSQLOrderBy, assignCachedSeekValues, assignChangeGEConditonToLIKE, assignChangeGTEQ2EQForLIKECondition, assignConnection, assignDbDecorator, assignExpandGTEQSearches, assignFetchDirectionIsForward, assignFileOpened, assignGDGCondition, assignGDGProperty, assignGenerate_OrderBy_ForReadStatements, assignIgnoreOriginalKeys, assignIncludeRedefinedFieldsInCRUD, assignKeyIsUnique, assignKeyValue, assignLastSeekCondition, assignLastSeekConditionLookedForEquality, assignLowerLimitForExpandGTEQSearches, assignOpenMode, assignRecordKey, assignRecordKey, assignResultSet, assignResultSetFetchSize, assignRowFacade, assignSequentialKeyGeneration, assignSQLConditions, assignSQLTableName, assignStatusValue, assignSuppressSeek, assignTableName, assignThrowInvalidKeyException, assignTopRowSelectStrategyCount, assignTopRowSelectStrategyRange, assignTreatAsSQLWrapper, assignUpperLimitForExpandGTEQSearches, clearAdditionalSQLCondition, 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, retrieveIncludeRedefinedFieldsInCRUD, 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:
seekRecordin 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:
seekRecordin 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:
openin classAbstractBasePersistence- Throws:
IOCriticalException
-
close
Description copied from class:AbstractBasePersistenceClose the file- Specified by:
closein interfaceISQLWrapper- Specified by:
closein classAbstractBasePersistence- Returns:
- when successful it returns IPersistence.STATUS_SUCCESS
- Throws:
IOCriticalException
-
nextRecord
Translation of COBOL Read Next ...- Specified by:
nextRecordin 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:
prevRecordin 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:
readRecordin 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:
insertRecordin classAbstractBasePersistence- Returns:
- when successful it returns IPersistence.STATUS_SUCCESS
- Throws:
IOStatusException
-
unlock
public void unlock()- Specified by:
unlockin interfaceISQLWrapper
-
deleteRecord
Description copied from class:AbstractBasePersistencewhen operation is Unsuccessful throw Exception (e.g KeyNotFountException). See com.softwaremining.wrappers.exceptions- Specified by:
deleteRecordin classAbstractBasePersistence- Returns:
- when successful it returns IPersistence.STATUS_SUCCESS
- Throws:
IOStatusException
-
deleteAllRecord
- Throws:
IOStatusException
-
clear
clear the result-sets and statements ...- Specified by:
clearin classAbstractBasePersistence- Returns:
- when successful it returns IPersistence.STATUS_SUCCESS
- Throws:
IOStatusException
-
updateRecord
Translation of COBOL REWRITE statement- Specified by:
updateRecordin 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:
readin interfaceISQLWrapper- Overrides:
readin 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:
nextin interfaceISQLWrapper- Overrides:
nextin 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:
insertin interfaceISQLWrapper- Overrides:
insertin 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:
updatein interfaceISQLWrapper- Overrides:
updatein classAbstractBasePersistence
-
delete
public int delete()Equivalent of COBOL delete (for VSAM).- Specified by:
deletein interfaceISQLWrapper- Overrides:
deletein classAbstractBasePersistence
-
prev
public int prev()] Equivalent of COBOL VSAM READ PREV- Specified by:
previn interfaceISQLWrapper- Overrides:
previn 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:
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:
-
assignAccessMode
public void assignAccessMode(int accessMode) Similar to the COBOL ACCESS Mode- Specified by:
assignAccessModein interfaceISQLWrapper- Overrides:
assignAccessModein 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:AbstractBasePersistenceset the status object- Specified by:
assignStatusin interfaceISQLWrapper- Overrides:
assignStatusin classAbstractBasePersistence
-