Hi All,
I am trying to fetch the differences between a child version and its parent version which is the Default Version through ArcObjects SDK for JAVA. I am not getting any results into objectIDs and differenceRows when I called "differences" function as below...
....
differenceCursor = versionedTable.differences(commonAncestorTable, esriDifferenceType.esriDifferenceTypeInsert, null);
.....
differenceCursor.next(objectIDs, differenceRows);
....
Followed the sample code given in below help document. We are using V 10.2.1
However, when I used "Versioning" tool bar and used "Version Changes" tool, I am able to see the changes. Could some one please help me with this.
Thanks & Regards,
Vara Prasad.
Solved! Go to Solution.
I could able to solve this. By assigning empty arrays to out parameters of "next" method instead of null object.
Thanks & Regards,
Vara Prasad.
Here is my code in JAVA. I tried same approach in .NET and it worked perfect. However, in JAVA ArcObjects, I am not getting any results, always giving 'null' for both "objectID" and "differenceRow". Could someone please help me.
IVersionedWorkspace versionedWorkspace = new VersionedWorkspace(workspace);
IVersion childVersion = versionedWorkspace.findVersion("SDE.Test");
IVersion parentVersion = versionedWorkspace.getDefaultVersion();
// Cast to the IVersion2 interface to find the common ancestor.
IVersion2 childVersion2 = new IVersion2Proxy(childVersion);
commonAncestorVersion = childVersion2.getCommonAncestor(parentVersion);
// Cast the child version to IFeatureWorkspace and open the table.
IFeatureWorkspace childFWS = new IFeatureWorkspaceProxy(childVersion);
ITable childTable = childFWS.openTable(tableName);
// Cast the common ancestor version to IFeatureWorkspace and open the table.
commonAncestorFWS = new IFeatureWorkspaceProxy(commonAncestorVersion);
commonAncestorTable = commonAncestorFWS.openTable(tableName);
// Cast to the IVersionedTable interface to create a difference cursor.
IVersionedTable versionedTable = new IVersionedTableProxy(childTable);
differenceCursor = versionedTable.differences(commonAncestorTable, esriDifferenceType.esriDifferenceTypeInsert, null);
int countChildRecords = childTable.rowCount(null);
int countParentRecords = commonAncestorTable.rowCount(null);
// Create output variables for the IDifferenceCursor.Next method and a FID set.
IFIDSet fidSet = new FIDSet();
IRow[] differenceRow = null;
int[] objectID = null;
// Step through the cursor, showing the ID of each modified row.
differenceCursor.next(objectID, differenceRow);
Thanks & Regards,
Vara Prasad.
I could able to solve this. By assigning empty arrays to out parameters of "next" method instead of null object.
Thanks & Regards,
Vara Prasad.