'Declaration
Public Overloads Overridable Function CreateGeneric( _ ByVal rootObjID As Integer, _ ByVal rootObject As String, _ ByVal relFromParent As String _ ) As ClarifyGeneric
public virtual ClarifyGeneric CreateGeneric( int rootObjID, string rootObject, string relFromParent )
This method sets a query for a generic object, given a root object table name, the objid for a row in that table, and the relation to follow from that row to this generic obj. This method saves querying the root object (as a parent object) when it is not needed otherwise. This method requires that you already have the objid of the object from which you wish to traverse. For example, the current user's objid is cached in the current ClarifySession data. It would be inefficient to make a special query to the user table to retrieve the row simply to retrieve the objid when it's already available in the session data. Instead, this method will allow you to traverse straight to child objects knowing only the user's objid.
NOTE: There is no parent/child relationship set up since there is no parent generic available.
// Create the DataSet ClarifyDataSet dataSet = new ClarifyDataSet(session); // Traverse from the user's objid ClarifyGeneric gQueue = dataSet.CreateGeneric( (int)session["user.id"], "user", "user_assigned2queue" ); // Query the data and print it to the console gQueue.Query(); foreach( ClarifyDataRow row in gQueue ) { Console.WriteLine("Queue title: {0}", row["title"] ); }
' Create the DataSet Dim dataSet As New ClarifyDataSet(session) ' Traverse from the user's objid Dim gQueue As ClarifyGeneric = session.CreateGeneric( _ session("user.id"), "user", "user_assigned2queue" ) ' Query the data and print it to the console gQueue.Query() For Each row As ClarifyDataRow In gQueue Console.WriteLine("Queue title: {0}", row("title") ) Next
Platforms: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family