Access a ProDataGraph with a known schema
- Last Updated: January 16, 2024
- 3 minute read
- OpenEdge
- Version 12.8
- Documentation
ProDataGraph. If you do not know the schema, see Access the ProDataGraph meta data for an unknown schema.
To access the data in a ProDataGraph:
-
Return the
ProDataObjectlist from theProDataGraphthat maps to a specified temp-table using the followingProDataGraphmethod, where tableName is the ABL name of the temp-table:java.util.List getProDataObjects(String tableName) -
Iterate through the
ProDataObjectlist returned in Step 1 and locate aProDataObjectinstance that contains data that you want. - Use the appropriate
ProDataObjectproperty access methods to return the values of specified column properties of theProDataObjectfound in Step 2, where propertyIndex is the index into theProDataObjectcolumn property list, and name is the ABL name of the temp-table field that the property maps to.Note: For more information on determining the propertyIndex of a column property and other information about column properties of aProDataObject, see the Use Java SDO classes to access Property meta data.- To return the value of a specified single-valued column property in the form of the
Propertydata type, use one of the followingProDataObjectmethods:DataType getDataTypeName(int propertyIndex) DataType getDataTypeName(String name)Where DataType is the full Java classname or intrinsic type name of the property data type and DataTypeName is a name that closely matches the name of the data type that the method returns:
To identify the Java intrinsic data type or class of the column property that maps to the ABL data type of the temp-table field, see Map single-valued fields. For example, the following two methods return values for an
intproperty (mapped to anINTEGERfield) and aBigDecimalproperty (mapped to aDECIMALfield):int getInt(String name) java.math.BigDecimal getBigDecimal(String name) - To return the value of a specified many-valued property (which maps to a temp-table
array field), use one of the following
ProDataObjectmethods:
The objects in thejava.util.List getList(int propertyIndex) java.util.List getList(String name)Listall have the data type of the columnProperty.Note: You can check that a columnPropertyis many-valued, and therefore returns aList, by testing the value returned by itsisMany()method. - To return the value of a specified column property in the form of the
java.lang.Objectclass, use one of the followingProDataObjectmethods:
The returnedjava.lang.Object get(int propertyIndex) java.lang.Object get(String name)Objecthas the data type of the specified column property, includingjava.util.Listif the property is many-valued.
- To return the value of a specified single-valued column property in the form of the
-
If you need to access parent or child relations of the
ProDataObjectthat you access in Step 3, you can use the following methods:To return a list of child rows for the specified
ProDataObject, use the followingProDataObjectmethod:java.util.List getChildRows(java.lang.String relationName)The method returns a list of child rows (
ProDataObjectinstances) for this parentProDataObjectaccording to the data-relation specified by name (relationName). Iterate through the list to locate aProDataObjectthat you want to access.- To return a parent row for the specified
ProDataObject, use the followingProDataObjectmethod:ProDataObject getParentRow(java.lang.String relationName)The method returns a parent
ProDataObjectfor this childProDataObjectaccording to the data-relation specified by name (relationName).Note: For aProDataGraph, the relationName identifies aDATA-RELATIONdefined in the corresponding ProDataSet parameter of the application service, and this name is identical to the ABL name of the specifiedDATA-RELATION.Once you have a child or parent
ProDataObject, you can continue with Step 3 to access its data.
ProDataObject methods, see ProDataObject class.