|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--com.ibm.ims.base.DLIBaseSegment | +--com.ibm.ims.db.DLISegment
DLISegment is the base class for objects representing
segments in a DL/I database. These DLISegment subclasses provide
the mapping between the data in the segment and access functions
on the class.
To provide the mapping, the subclasses must register their DLITypeInfo with
this class by providing it as the argument to the constructor. By doing so,
the DLISegment class knows the layout of each segment in the database and can
access as well as update each of the fields within a segment. Note that when
creating the DLITypeInfo objects to register with a DLISegment the offsets are
1-based. In the example below, the first paramter is an alias for the key and
search fields. This alias would then be used throughout the application when
referring to the key or search field. The key and search fields are given as
the last paramter and must be defined exactly as they are defined in the DBD
source file. The reason for this is that in the DBD source the field names are
limited to 8 characters, whereas the alias has no such limitations.
The following shows code typical of a DLISegment subclass:
class MySegment extends DLISegment {
static DLITypeInfo[] typeInfo = {
new DLITypeInfo("FieldAlias1", DLITypeInfo.CHAR, 1, 6, "Field1"),
new DLITypeInfo("FieldAlias2", DLITypeInfo.INTEGER, 7, 4, "Field2"),
new DLITypeInfo("FieldAlias3", DLITypeInfo.BIGINT, 11, 8, "Field3"),
};
public MySegment() {
super ("SegmentReference", "SEGNAME", typeInfo, 18);
}
}
DLITypeInfo
, Serialized FormFields inherited from class com.ibm.ims.base.DLIBaseSegment |
ioArea, ioAreaLength, ioAreaOffset |
Constructor Summary | |
protected |
DLISegment(java.lang.String segmentNameInDBD,
DLITypeInfo[] typeInfo,
int length)
Constructs a DL/I Segment object. |
|
DLISegment(java.lang.String segmentNameReference,
java.lang.String segmentNameInDBD,
DLITypeInfo[] typeInfo,
int length)
Constructs a DL/I Segment object. |
Method Summary | |
void |
clearWarnings()
Clears the warning chain for this DLISegment. |
byte[] |
getIOArea()
Provides package-level access to DLIBaseSegment.ioArea. |
int |
getIOAreaLength()
Provides package-level access to DLIBaseSegment.ioAreaLength. |
int |
getIOAreaOffset()
Provides package-level access to DLIBaseSegment.ioAreaOffset. |
byte[] |
getSegmentKey()
Returns the key of the current Segment. |
java.lang.String |
getSegmentNameReference()
|
DLIWarning |
getWarnings()
The first warning reported by calls on this DLISegment is returned. |
void |
setIOArea(byte[] ioArea)
Sets the IO area of this segment |
void |
setIOAreaOffset(int ioAreaOffset)
Provides package-level access to DLIBaseSegment.ioAreaOffset. |
Methods inherited from class com.ibm.ims.base.DLIBaseSegment |
clone, getBigDecimal, getBigDecimal, getBigDecimal, getBigDecimal, getBoolean, getBoolean, getByte, getByte, getBytes, getBytes, getBytes, getDate, getDate, getDefaultEncoding, getDouble, getDouble, getFloat, getFloat, getInt, getInt, getLong, getLong, getOffset, getSegmentName, getShort, getShort, getString, getString, getTime, getTime, getTimestamp, getTimestamp, getTypeInfo, getTypeInfo, getTypeInfo, setBigDecimal, setBigDecimal, setBoolean, setBoolean, setByte, setByte, setBytes, setBytes, setBytes, setDate, setDate, setDefaultEncoding, setDouble, setDouble, setFloat, setFloat, setInt, setInt, setLong, setLong, setShort, setShort, setString, setString, setTime, setTime, setTimestamp, setTimestamp |
Methods inherited from class java.lang.Object |
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
protected DLISegment(java.lang.String segmentNameInDBD, DLITypeInfo[] typeInfo, int length)
segmentNameInDBD
- the name of the segment in the database as defined in the DBDtypeInfo
- an array of DLITypeInfo objects, which tells this class
the layout of the segmentlength
- the length of the I/O area of the segmentpublic DLISegment(java.lang.String segmentNameReference, java.lang.String segmentNameInDBD, DLITypeInfo[] typeInfo, int length)
segmentNameReference
parameter was
segmentA
then a query will look as follows:
SELECT segmentA.field1 FROM segmentAsegmentNameReference
- the alias for the actual name of the segment that does
not have the naming restrictions of segment names in a DBD
(upper case, maximum length of 8 characters)segmentNameInDBD
- the name of the segment in the database as defined in the DBDtypeInfo
- an array of DLITypeInfo objects, which tells this class
the layout of the segmentlength
- the length of the I/O area of the segmentMethod Detail |
public void clearWarnings()
clearWarnings
in class DLIBaseSegment
public final byte[] getIOArea()
public final int getIOAreaLength()
public final int getIOAreaOffset()
public DLIWarning getWarnings()
getWarnings
in class DLIBaseSegment
public final void setIOArea(byte[] ioArea)
public final void setIOAreaOffset(int ioAreaOffset)
public final java.lang.String getSegmentNameReference()
public byte[] getSegmentKey() throws DLIException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |