com.progress.open4gl
Class ProDataGraph

java.lang.Object
  extended byEDataGraphImpl
      extended bycom.progress.open4gl.ProDataGraph

public class ProDataGraph
extends EDataGraphImpl

Maps to either a 4GL DataSet, DataSet-Handle, Temp-Table, or Table-Handle parameter in a Java client. It implements the Java SDO DataGraph interface.

See Also:
Serialized Form

Constructor Summary
ProDataGraph()
           
ProDataGraph(DataGraph dg, java.lang.String dgName, ProDataRelationMetaData[] dataRelList)
          Converts the specified DataGraph object into a ProDataGraph object.
ProDataGraph(ProDataGraph dg)
          Creates a copy of the specified ProDataGraph object.
ProDataGraph(ProDataGraphMetaData dgmd)
          Creates a ProDataGraph object based on the specified metadata.
 
Method Summary
 void acceptChanges()
          Clears out the change list in the ProChangeSummary.
 void addProDataObject(int index, ProDataObject dataObj)
          Adds ProDataObject instance at specified index in its ProDataObject collection within ProDataGraph.
 void addProDataObject(ProDataObject dataObj)
          Adds ProDataObject instance to end of its ProDataObject collection within ProDataGraph.
 ProDataObject createProDataObject(java.lang.String tableName)
          Returns a new ProDataObject
 ProDataGraphMetaData getMetaData()
           
 int getNumTables()
           
 ProChangeSummary getProChangeSummary()
           
 java.lang.String getProDataGraphName()
           
 java.util.List getProDataObjects(int tableIdx)
           
 java.util.List getProDataObjects(java.lang.String tableName)
           
 DataObject getRootObject()
           
 int getTableIndex(java.lang.String tableName)
           
 java.lang.String[] getTableNames()
           
 boolean hasError()
           
 void setChildTableReferences()
          Use this to build ProDataGraph object with data relations.
 void setChildTableReferences(int parentIx)
          Use this to build ProDataGraph object with data relations.
 void setChildTableReferences(java.lang.String tableName)
          Use this to build ProDataGraph object with data relations.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ProDataGraph

public ProDataGraph()

ProDataGraph

public ProDataGraph(DataGraph dg,
                    java.lang.String dgName,
                    ProDataRelationMetaData[] dataRelList)
             throws java.lang.Exception,
                    ProDataException,
                    Open4GLException
Converts the specified DataGraph object into a ProDataGraph object. In the DataGraph's DataObject hierarchy, if a parent-child relationship exists between 2 DataObjects (or temp-tables), a ProDataRelationMetaData object must be provided in the ProDataRelationMetaData array that describes that relationship.

Parameters:
dg - Input DataGraph object
dgName - Name for newly created ProDataGraph
dataRelList - List of parent-child relationships
Throws:
java.lang.Exception
ProDataException
Open4GLException

ProDataGraph

public ProDataGraph(ProDataGraph dg)
             throws ProDataException,
                    java.lang.Exception,
                    Open4GLException
Creates a copy of the specified ProDataGraph object.

Parameters:
dg - ProDataGraph object to copy
Throws:
ProDataException
java.lang.Exception
Open4GLException

ProDataGraph

public ProDataGraph(ProDataGraphMetaData dgmd)
             throws ProDataException,
                    java.lang.Exception
Creates a ProDataGraph object based on the specified metadata.

Parameters:
dgmd - metadata used to create ProDataGraph
Throws:
ProDataException
java.lang.Exception
Method Detail

acceptChanges

public void acceptChanges()
Clears out the change list in the ProChangeSummary. Same behavior as the ChangeSummary.beginLogging().


addProDataObject

public void addProDataObject(int index,
                             ProDataObject dataObj)
                      throws Open4GLException
Adds ProDataObject instance at specified index in its ProDataObject collection within ProDataGraph.

Parameters:
index - 0-based location
dataObj - ProDataObject to add
Throws:
Open4GLException

addProDataObject

public void addProDataObject(ProDataObject dataObj)
                      throws Open4GLException
Adds ProDataObject instance to end of its ProDataObject collection within ProDataGraph.

Parameters:
dataObj - ProDataObject to add
Throws:
Open4GLException

createProDataObject

public ProDataObject createProDataObject(java.lang.String tableName)
                                  throws Open4GLException
Returns a new ProDataObject

Parameters:
tableName - Specified table within the ProDataGraph
Returns:
Newly created ProDataObject instance (row) for tableName.
Throws:
Open4GLException

getMetaData

public ProDataGraphMetaData getMetaData()
Returns:
The ProDataGraphMetaData object

getNumTables

public int getNumTables()
Returns:
The number of ProDataObject collections (temp-tables) in this ProDataGraph object.

getProChangeSummary

public ProChangeSummary getProChangeSummary()
Returns:
ProChangeSummary object associated with this ProDataGraph.

getProDataGraphName

public java.lang.String getProDataGraphName()
Returns:
Name of ProDataGraph

getProDataObjects

public java.util.List getProDataObjects(int tableIdx)
                                 throws java.lang.Exception
Parameters:
tableIdx - 0-based table index within ProDataGraph
Returns:
List of ProDataObject objects (instance data) for the specified tableIdx
Throws:
java.lang.Exception

getProDataObjects

public java.util.List getProDataObjects(java.lang.String tableName)
                                 throws java.lang.Exception,
                                        Open4GLException
Parameters:
tableName -
Returns:
List of ProDataObject objects (instance data) for specified tableName
Throws:
java.lang.Exception
Open4GLException

getRootObject

public DataObject getRootObject()

getTableIndex

public int getTableIndex(java.lang.String tableName)
                  throws Open4GLException
Throws:
Open4GLException

getTableNames

public java.lang.String[] getTableNames()
                                 throws Open4GLException
Returns:
String array of the table names of the ProDataObject collections in this ProDataGraph object.
Throws:
Open4GLException

hasError

public boolean hasError()
Returns:
True if AppServer returned error message for ProDataGraph, else False - returned from AppServer.

setChildTableReferences

public void setChildTableReferences()
                             throws java.lang.Exception
Use this to build ProDataGraph object with data relations. It creates all the references (or relationship info) for each ProDataRelationMetaData. Once done, ProDataObject methods getChildRows() and getParentRow() can be used.

Throws:
java.lang.Exception

setChildTableReferences

public void setChildTableReferences(int parentIx)
                             throws Open4GLException,
                                    java.lang.Exception
Use this to build ProDataGraph object with data relations. It creates all the references (or relationship info) for each ProDataRelationMetaData where the specified table is parent table. Once this is done, ProDataObject methods getChildRows() and getParentRow() can be used.

Parameters:
parentIx - 0-based parent table index
Throws:
Open4GLException
java.lang.Exception

setChildTableReferences

public void setChildTableReferences(java.lang.String tableName)
                             throws Open4GLException,
                                    java.lang.Exception
Use this to build ProDataGraph object with data relations. It creates all the references (or relationship info) for each ProDataRelationMetaData where tableName is parent table. Once done, ProDataObject methods getChildRows() and getParentRow() can be used.

Parameters:
tableName - the parent's table name
Throws:
Open4GLException
java.lang.Exception