Try OpenEdge Now
skip to main content
Java Open Clients
Accessing ABL ProDataSets : ProDataSets and using ProDataGraphs to access them : ProDataGraph function and foundations : Java SDO Foundations
 
Java SDO Foundations
The ProDataGraph class is based on the DataGraph interface specified by the Java Service Data Objects (Java SDO) specification published jointly by BEA and IBM as Java Specification Request (JSR) 235. The OpenEdge class is an extension of the Java SDO reference implementation included as part of the IBM Eclipse Modeling Framework (EMF 2.0.1).
Note: If the work of the JSR 235 Expert Group supersedes the current Java SDO API, the OpenEdge ProDataGraph implementation might have to change in the future.
The Java SDO interface specification consists of several interface objects, including the DataGraph, which closely model the ABL ProDataSet. Like the ProDataSet, it provides:
*Relationship support
*A detached data source
*XML serialization
*Data introspection (meta data or schema support)
*Change tracking
The DataObject is the fundamental interface of Java SDO and is the Java SDO representation of structured data. It encapsulates a specified set of properties (Property objects). Each property has a Type object, which can specify one of the following data types:
*A primitive or derived type, such as int (primitive) or Date (derived), typically representative of a column property.
*A reference type, which refers to the type of another DataObject, and is representative of a reference property.
Each DataObject provides read and write access methods for all its properties. (For more information on using the Java SDO Property and Type interfaces, see Using Java SDO classes to access Property meta data.)
A DataGraph encapsulates a tree of DataObject instances starting with a single root DataObject. The reference properties of each DataObject link to other DataObject instances in the tree. In a DataGraph of relational data, a DataObject commonly represents a row of data, where its column properties represent the data fields of the row and its reference properties link to ordered or otherwise related rows. Foreign keys are represented by references to DataObject instances representing a row or rows in another table. Thus, reference properties can maintain relationships between parent and child tables. The rows of a single table are represented by a DataObject list (java.util.List).
The Property and Type interfaces that define data fields in a table row represented by a DataObject also provide the Java SDO meta data API. This API provides access to the DataObject schema, allowing the client to introspect the DataObject to get its type information.
Thus, the whole character of a DataGraph depends on the specific definitions of the DataObject instances in its tree. While this tree seems to imply a hierarchical structure, it can be used to model many other complex data structures, depending on how its DataObject instances are defined and interrelated. In order to more closely map a ProDataSet, the OpenEdge ProDataGraph represents a constraint on the standard DataGraph. A ProDataGraph encapsulates a tree of DataObject instances, starting with a specially-defined root DataObject. This root DataObject essentially references the temp-tables (DataObject lists) contained by the ProDataGraph and its corresponding ProDataSet. Each DataObject in a list is implemented as an OpenEdge ProDataObject class, which is a DataObject extension designed to map a temp-table record (table row). (For more information on this tree structure, see the ProDataGraphobject model.)
A DataGraph also encapsulates a ChangeSummary object whose interface tracks changes to any of its underlying DataObject instances. The ChangeSummary object is initially empty and populated as the DataGraph is modified. This ChangeSummary allows Java SDO to apply changes back to the data source of a DataGraph by comparing changed properties and DataObject instances with the current state of the data source. The ProDataGraph class encapsulates a corresponding ProChangeSummary object, which extends the ChangeSummary interface to more closely model the operation of the corresponding ProDataSet.
Java SDO also provides components called Data Mediator Services, which provide access to heterogeneous data sources for a DataGraph. They enable the DataGraph to function independently of any one data source so it can serve as a common unit of transfer for data throughout an application. The OpenEdge ProDataGraph does not require Data Mediator Services, as the data source for a ProDataGraph (and its corresponding ProDataSet) is typically managed by the OpenEdge application service.
For more information on:
*Documentation for the Service Data Objects in EMF 2.0.1, see http://eclipse.org/emf/docs.php
*JSR 235, see http://www.jcp.org/en/jsr/detail?id=235