|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--com.ibm.ims.db.DLIDatabaseView
DLIDatabaseView
is a container for segment information in a DL/I database.
During static initialization of a DLIDatabaseView subclass, the subclass should
create an array of DLISegmentInfo objects. The subclass constructor then provides
both the array and the name of the view to the DLIDatabaseView constructor.
DLISegmentInfo contains a DLISegment instance and the 0-based offset of the parent
instance within the array.
DLIDatabaseView stores the array of DLISegmentInfo objects and also creates a
Hashtable for fast lookup by segment class name.
The following shows code typical of a DLIDatabaseView subclass:
class MyDatabaseView extends DLIDatabaseView {
static DLISegmentInfo[] warehouseSegments = {
new DLISegmentInfo(new Warehouse(), DLIDatabaseView.ROOT),
new DLISegmentInfo(new Stock(), 0),
new DLISegmentInfo(new Stock11(), 1),
new DLISegmentInfo(new Stock12(), 1),
};
static DLISegmentInfo[] districtSegments {
new DLISegmentInfo(new District(), DLIDatabaseView.ROOT),
};
static DLISegmentInfo[] customerSegments {
new DLISegmentInfo(new Customer(), DLIDatabaseView.ROOT),
new DLISegmentInfo(new CustomerOrder(), 0),
};
public MyDatabaseView ( ) {
super ("PSBNO", "WarehouseDB", "WAREDB", warehouseSegments);
addDatabase("DistrictDB", "DISTDB", districtSegments);
addDatabase("CustomerDB", "CUSTDB", customerSegments);
}
}
Field Summary | |
static int |
ROOT
Used to identify that the root segment in a DLIDatabaseView has no parent. |
Constructor Summary | |
protected |
DLIDatabaseView(java.lang.String dbPCBNameInPSB,
DLISegmentInfo[] segments)
Deprecated. use overloaded constructor with version |
protected |
DLIDatabaseView(java.lang.String version,
java.lang.String dbPCBNameInPSB,
DLISegmentInfo[] segments)
Constructs a DLIDatabaseView object from the view name and an
array of DLISegmentInfo objects that define the segments
contained in the view. |
|
DLIDatabaseView(java.lang.String psbName,
java.lang.String dbPCBNameReference,
java.lang.String dbPCBNameInPSB,
DLISegmentInfo[] segments)
Deprecated. use overloaded constructor with version |
|
DLIDatabaseView(java.lang.String version,
java.lang.String psbName,
java.lang.String dbPCBNameReference,
java.lang.String dbPCBNameInPSB,
DLISegmentInfo[] segments)
Constructs a DLIDatabaseView object from the PSB name and the
information for the first database view (PCB) in the view. |
Method Summary | |
void |
addDatabase(java.lang.String dbPCBNameReference,
java.lang.String dbPCBNameInPSB,
DLISegmentInfo[] segments)
Adds another database to the view by providing the reference name for the view, the DB PCB name for that database view, and the array of DLISegmentInfo objects
that define the segments contained in the database view. |
java.lang.Object |
clone()
Creates and returns a shallow copy of this object. |
DLISegment |
cloneSegment(java.lang.String dbPCBNameReference,
java.lang.String segmentName)
This method will return a copy of any segment stored in the database view. |
java.lang.String |
getActualPCBName(java.lang.String dbPCBNameReference)
This method resolves a PCB alias to the 8 character IMS PCB name. |
java.util.Vector |
getChildren(java.lang.String dbPCBNameReference,
java.lang.String parentNameReference)
Returns the parent DLISegment object of the specified segment
class name. |
DLISegment |
getParent(java.lang.String dbPCBNameReference,
DLISegment segment)
Returns the parent DLISegment object of the specified segment. |
DLISegment |
getParent(java.lang.String dbPCBNameReference,
java.lang.String segmentNameReference)
Returns the parent DLISegment object of the specified segment
class name. |
java.lang.String |
getPSBName()
Returns the PSBName for this database view. |
java.lang.String |
getVersion()
Returns the version number that this DLIDatabaseView conforms to. |
protected void |
setVersion(java.lang.String version)
This sets the version number that the DLIDatabaseView conforms to. |
Methods inherited from class java.lang.Object |
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final int ROOT
Constructor Detail |
protected DLIDatabaseView(java.lang.String version, java.lang.String dbPCBNameInPSB, DLISegmentInfo[] segments) throws java.lang.RuntimeException
DLIDatabaseView
object from the view name and an
array of DLISegmentInfo
objects that define the segments
contained in the view.version
- the version of DLIDatabaseView interface coded to.dbPCBNameInPSB
- the name of the database PCB as listed in the PSBsegments
- the array of segments contained in the view identifying
the segment hierarchypublic DLIDatabaseView(java.lang.String version, java.lang.String psbName, java.lang.String dbPCBNameReference, java.lang.String dbPCBNameInPSB, DLISegmentInfo[] segments) throws java.lang.RuntimeException
DLIDatabaseView
object from the PSB name and the
information for the first database view (PCB) in the view. This includes
the database view name, the actual DB PCB name, and the array of DLISegmentInfo
objects that define the segments contained in the first database.version
- the version of DLIDatabaseView interface coded to.psbName
- the name of the PSB defining this viewdbPCBNameReference
- the name of the first database view. The database
view name is a reference for the PCB name that doesn't
have the naming restrictions of a PCB name (upper case,
maximum length of 8 characters)dbPCBNameInPSB
- the PCB name of the first PCB in the PSBsegments
- the array of segments identifying the segment fields and
hierarchy of the first database viewprotected DLIDatabaseView(java.lang.String dbPCBNameInPSB, DLISegmentInfo[] segments) throws java.lang.RuntimeException
DLIDatabaseView
object from the view name and an
array of DLISegmentInfo
objects that define the segments
contained in the view.dbPCBNameInPSB
- the name of the database PCB as listed in the PSBsegments
- the array of segments contained in the view identifying
the segment hierarchypublic DLIDatabaseView(java.lang.String psbName, java.lang.String dbPCBNameReference, java.lang.String dbPCBNameInPSB, DLISegmentInfo[] segments) throws java.lang.RuntimeException
DLIDatabaseView
object from the PSB name and the
information for the first database view (PCB) in the view. This includes
the database view name, the actual DB PCB name, and the array of DLISegmentInfo
objects that define the segments contained in the first database.version
- the version of DLIDatabaseView interface coded to.psbName
- the name of the PSB defining this viewdbPCBNameReference
- the name of the first database view. The database
view name is a reference for the PCB name that doesn't
have the naming restrictions of a PCB name (upper case,
maximum length of 8 characters)dbPCBNameInPSB
- the PCB name of the first PCB in the PSBsegments
- the array of segments identifying the segment fields and
hierarchy of the first database viewMethod Detail |
public void addDatabase(java.lang.String dbPCBNameReference, java.lang.String dbPCBNameInPSB, DLISegmentInfo[] segments) throws java.lang.RuntimeException
DLISegmentInfo
objects
that define the segments contained in the database view.dbPCBNameReference
- the name of the database view. The database
view name is a reference for the PCB name that doesn't
have the naming restrictions of a PCB name (upper case,
max length of 8 characters)dbPCBNameInPSB
- the PCB name of the first PCB in the PSBsegments
- the array of segments identifying the segment fields and
hierarchypublic java.lang.String getPSBName()
public DLISegment getParent(java.lang.String dbPCBNameReference, DLISegment segment) throws DLIException
DLISegment
object of the specified segment.dbPCBNameReference
- the reference to the actual DB PCB namesegment
- the DLISegment
instanceDLISegment
object, or null if either
the segment class name does not exist or there is no parentpublic DLISegment getParent(java.lang.String dbPCBNameReference, java.lang.String segmentNameReference) throws DLIException
DLISegment
object of the specified segment
class name.dbPCBNameReference
- the reference to the actual DB PCB namesegmentNameReference
- the reference name of the segmentDLISegment
object, or null if either
the segment class name does not exist or there is no parentpublic java.util.Vector getChildren(java.lang.String dbPCBNameReference, java.lang.String parentNameReference) throws DLIException
DLISegment
object of the specified segment
class name.dbPCBNameReference
- the reference to the actual DB PCB nameparentNameReference
- the reference name of the segment, null will return a vector of just the root nodepublic java.lang.String getActualPCBName(java.lang.String dbPCBNameReference) throws DLIException
public DLISegment cloneSegment(java.lang.String dbPCBNameReference, java.lang.String segmentName) throws DLIException
DLIConnection
class. Typically, an application would use this method in the following manner:
DLISegment mySegment = myDBView.cloneSegment("pcbReference", "segmentReference");
myConnection.getUniqueSegment(mySegment);
where pcbReference
is the reference name of the database view (PCB) passed in to
either the database view constructor or the DLIDatabaseView.addDatabase()
method.
The segmentReference
can be either the reference name or actual name of the segment.
It is recommended to use the reference name and the name is the one passed in to the
DLISegment
constructor via the segmentNameReference
parameter.dbPCBNameReference
- the name of the database view. The database
view name is a reference for the PCB name that doesn't
have the naming restrictions of a PCB name (upper case,
max length of 8 characters)segmentName
- either the reference name or actual name of the segmentDLIException
- if the segment does not exist in the database viewDLISegment.DLISegment(String, String, DLITypeInfo[], int)
,
DLIDatabaseView(String, String, String, DLISegmentInfo[])
,
addDatabase(String, String, DLISegmentInfo[])
public java.lang.Object clone()
clone
in class java.lang.Object
protected void setVersion(java.lang.String version)
public java.lang.String getVersion()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |