Notice: This Wiki is now read only and edits are no longer possible. Please see: https://gitlab.eclipse.org/eclipsefdn/helpdesk/-/wikis/Wiki-shutdown-plan for the plan.
Difference between revisions of "EclipseLink/Examples/SDO/BasicAPI"
< EclipseLink | Examples | SDO
m |
(→EqualityHelper - Compare DataObjects) |
||
Line 14: | Line 14: | ||
==EqualityHelper - Compare DataObjects== | ==EqualityHelper - Compare DataObjects== | ||
+ | EqualityHelper provides a convenient means of comparing DataObjects. | ||
+ | <source lang="java"> | ||
+ | EqualityHelper equalityHelper = helperContext.getEqualityHelper(); | ||
+ | </source> | ||
+ | |||
+ | ===Shallow Equal=== | ||
+ | Two DataObjects are considered shallow equal if the data objects are of the same type and all the values of all dataType=true properties (excluding the ChangeSummary property) are equal. | ||
+ | <source lang="java"> | ||
+ | boolean isShallowEqual = equalityHelper.equalShallow(dataObject1, dataObject2); | ||
+ | </source> | ||
+ | |||
+ | ===Deep Equal=== | ||
+ | Two DataObjects are considered deep equal if the data objects and the trees that they belong to are both equal. | ||
+ | <source lang="java"> | ||
+ | boolean isDeepEqual = equalityHelper.equal(dataObject1, dataObject2); | ||
+ | </source> |
Revision as of 15:37, 25 February 2009
Contents
HelperContext
TypeHelper - Access Metadata
XSDHelper - Access XML Schema Metadata
DataFactory - Create DataObjects
DataHelper - Convert Simple Values
XMLHelper - Handle XML Data as DataObjects
CopyHelper - Create Copies of DataObjects
EqualityHelper - Compare DataObjects
EqualityHelper provides a convenient means of comparing DataObjects.
EqualityHelper equalityHelper = helperContext.getEqualityHelper();
Shallow Equal
Two DataObjects are considered shallow equal if the data objects are of the same type and all the values of all dataType=true properties (excluding the ChangeSummary property) are equal.
boolean isShallowEqual = equalityHelper.equalShallow(dataObject1, dataObject2);
Deep Equal
Two DataObjects are considered deep equal if the data objects and the trees that they belong to are both equal.
boolean isDeepEqual = equalityHelper.equal(dataObject1, dataObject2);