Package com.softwaremining.wrappers
Class AbstractBasePersistence
java.lang.Object
com.softwaremining.wrappers.CBLBean
com.softwaremining.wrappers.AbstractBasePersistence
- All Implemented Interfaces:
IPersistence
,AbstractDataObject
,ICBLBeanNGroup
,ICBLContainer
,IFieldContainer
,ISMBean
,ISMDataType
- Direct Known Subclasses:
AbstractFile
,AbstractIndexedFile
,IndexedFileSingleProcess
For internal use only
-
Field Summary
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
ConstructorDescriptiondefault constructorstandard constructor -
Method Summary
Modifier and TypeMethodDescriptionvoid
assignAccessMode
(int accessMode) Similar to the COBOL ACCESS Mode - defaults to ACCESS_MODE_RANDOMvoid
assignFileName
(String fileName) In Sequential File Processing - it overwrites the default name of an input/output file automatically assigned by the system.void
assignLock
(boolean value) void
assignStatus
(CBLBean wrapper) set the status objectvoid
assignStatus
(ISMObject status) set the status objectvoid
assignStatusAsPrimitive
(int newStatus) Used internally to set the IO operation status-values.void
assignStatusValue
(int value) Used internally to set the IO operation status-values.protected void
assignStatusValue
(String value) Method for assigning a string to the status.void
assignTableName
(String fileName) In Sequential File Processing - it overwrites the default name of an input/output file automatically assigned by the system.abstract int
clear()
abstract int
close()
Close the fileint
delete()
equivalent of COBOL delete (for VSAM).abstract int
when operation is Unsuccessful throw Exception (e.g KeyNotFountException).int
insert()
Insert a record - populate the values from the existing fieldsabstract int
when operation is Unsuccessful throw Exception (e.g DuplicateKeyException).int
next()
read the next record from file.abstract int
when operation is Unsuccessful throw Exception (e.g AtEndException).abstract int
open
(int openMode) int
prev()
abstract int
when operation is Unsuccessful throw Exception (e.g AtEndException).int
read()
READ is used in conjunction with SEEK statements.abstract int
Typically called repeatedly to read next record sequentially from a file.boolean
readRow()
Similar to read() - but returns true or false rather than an integer from IPersistenceint
Similar to the COBOL ACCESS ModeretrieveFileName
(boolean prefixFileNameWithCallingProgram) In Sequential File Processing - it returns the default name of an input/output fileabstract AbstractCBLField
abstract int
final Long
For internal use onlyUsed internally to set the IO operation status-values.int
Used internally to set the IO operation status-values.int
update()
Update the current record with the current record structure.abstract int
when operation is Unsuccessful throw Exception (e.g DuplicateKeyException).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
-
Field Details
-
fileName
-
ownerClassName
-
status
-
-
Constructor Details
-
AbstractBasePersistence
public AbstractBasePersistence()default constructor -
AbstractBasePersistence
standard constructor- Parameters:
owner
-
-
-
Method Details
-
assignFileName
In Sequential File Processing - it overwrites the default name of an input/output file automatically assigned by the system.- Parameters:
fileName
-
-
assignTableName
In Sequential File Processing - it overwrites the default name of an input/output file automatically assigned by the system.- Parameters:
fileName
-
-
retrieveFileName
In Sequential File Processing - it returns the default name of an input/output file- Parameters:
fileName
-
-
retrieveFileName
-
assignAccessMode
public void assignAccessMode(int accessMode) Similar to the COBOL ACCESS Mode - defaults to ACCESS_MODE_RANDOM- Parameters:
accessMode
- : types are defined in IPersistence.ACCESS_MODE_xxx : Sequential, Random or Dynamic
-
retrieveAccessMode
public int retrieveAccessMode()Similar to the COBOL ACCESS Mode- Parameters:
accessMode
- : types are defined in IPersistence.ACCESS_MODE_xxx : Sequential, Random or Dynamic
-
assignStatus
set the status object- Parameters:
status
-
-
assignStatus
set the status object- Parameters:
status
-
-
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.- Parameters:
value
- - .. one of ACMBasePersistent.STATUS_xxxx
-
assignStatusValue
Method for assigning a string to the status. Note that in MicroFOcus, the LOCK status is represented bt "9D", ie the 2nd value is a String- Parameters:
value
-
-
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.- Returns:
- - the status value .. one of ACMBasePersistent.STATUS_xxxx
-
retrieveStatusField
Used internally to set the IO operation status-values. -
assignStatusAsPrimitive
public void assignStatusAsPrimitive(int newStatus) Used internally to set the IO operation status-values. -
assignLock
public void assignLock(boolean value) -
retrieveFirstLevelEntry
-
open
- Throws:
IOCriticalException
-
close
Close the file- Returns:
- when successful it returns IPersistence.STATUS_SUCCESS
- Throws:
IOCriticalException
-
retrieveOpenMode
public abstract int retrieveOpenMode() -
nextRecord
when operation is Unsuccessful throw Exception (e.g AtEndException). See com.softwaremining.wrappers.exceptions- Returns:
- Throws:
IOStatusException
-
prevRecord
when operation is Unsuccessful throw Exception (e.g AtEndException). See com.softwaremining.wrappers.exceptions- Returns:
- when successful it returns IPersistence.STATUS_SUCCESS
- Throws:
IOStatusException
-
readRecord
Typically called repeatedly to read next record sequentially from a file. Otherwise, it performs a SEEK on the current RecordKey - and then reads the file. when operation is Unsuccessful throw Exception (e.g AtEndException). See com.softwaremining.wrappers.exceptions- Returns:
- Throws:
IOStatusException
-
updateRecord
when operation is Unsuccessful throw Exception (e.g DuplicateKeyException). See com.softwaremining.wrappers.exceptions- Returns:
- when successful it returns IPersistence.STATUS_SUCCESS
- Throws:
IOStatusException
-
insertRecord
when operation is Unsuccessful throw Exception (e.g DuplicateKeyException). See com.softwaremining.wrappers.exceptions- Returns:
- when successful it returns IPersistence.STATUS_SUCCESS
- Throws:
IOStatusException
-
deleteRecord
when operation is Unsuccessful throw Exception (e.g KeyNotFountException). See com.softwaremining.wrappers.exceptions- Returns:
- when successful it returns IPersistence.STATUS_SUCCESS
- Throws:
IOStatusException
-
clear
- Returns:
- when successful it returns IPersistence.STATUS_SUCCESS
- Throws:
IOStatusException
-
readRow
public boolean readRow()Similar to read() - but returns true or false rather than an integer from IPersistence- Returns:
-
read
public int read()READ is used in conjunction with SEEK statements. Read the next record, trapping at end exceptions ....- Returns:
- when successful it returns IPersistence.STATUS_SUCCESS
-
next
public int next()read the next record from file. DOES NOT THROW AtEndException ... instead only the FileStatus will be changed.- 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 -
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 -
delete
public int delete()equivalent of COBOL delete (for VSAM). -
prev
public int prev() -
retrieveSessionId
Description copied from class:CBLBean
For internal use only- Specified by:
retrieveSessionId
in interfaceISMBean
- Overrides:
retrieveSessionId
in classCBLBean
-