Class ODocumentHelper
java.lang.Object
com.orientechnologies.orient.core.record.impl.ODocumentHelper
Helper class to manage documents.
- Author:
- Luca Garulli (l.garulli--(at)--orientdb.com)
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic interfacestatic interface -
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic ObjectcloneValue(ODocument iCloned, Object fieldValue) static booleancompareBags(ODatabaseDocumentInternal iMyDb, ORidBag myFieldValue, ODatabaseDocumentInternal iOtherDb, ORidBag otherFieldValue, ODocumentHelper.RIDMapper ridMapper) static booleancompareCollections(ODatabaseDocumentInternal iMyDb, Collection<?> myFieldValue, ODatabaseDocumentInternal iOtherDb, Collection<?> otherFieldValue, ODocumentHelper.RIDMapper ridMapper) static booleancompareMaps(ODatabaseDocumentInternal iMyDb, Map<Object, Object> myFieldValue, ODatabaseDocumentInternal iOtherDb, Map<Object, Object> otherFieldValue, ODocumentHelper.RIDMapper ridMapper) static booleancompareSets(ODatabaseDocumentInternal iMyDb, Set<?> myFieldValue, ODatabaseDocumentInternal iOtherDb, Set<?> otherFieldValue, ODocumentHelper.RIDMapper ridMapper) static <RET> RETconvertField(ODocument iDocument, String iFieldName, OType type, Class<?> iFieldType, Object iValue) static ObjectevaluateFunction(Object currentValue, String iFunction, OCommandContext iContext) protected static ObjectfilterItem(String iConditionFieldName, Object iConditionFieldValue, Object iValue) static <RET> RETgetFieldValue(Object value, String iFieldName) static <RET> RETgetFieldValue(Object value, String iFieldName, OCommandContext iContext) static ObjectgetIdentifiableValue(OIdentifiable iCurrent, String iFieldName) protected static ObjectgetIndexPart(OCommandContext iContext, String indexPart) static ObjectgetMapEntry(Map<String, ?> iMap, Object iKey) Retrieves the value crossing the map with the dotted notationstatic booleanhasSameContentItem(Object iCurrent, ODatabaseDocumentInternal iMyDb, Object iOther, ODatabaseDocumentInternal iOtherDb, ODocumentHelper.RIDMapper ridMapper) static booleanhasSameContentOf(ODocument iCurrent, ODatabaseDocumentInternal iMyDb, ODocument iOther, ODatabaseDocumentInternal iOtherDb, ODocumentHelper.RIDMapper ridMapper) Makes a deep comparison field by field to check if the passed ODocument instance is identical as identity and content to the current one.static booleanhasSameContentOf(ODocument iCurrent, ODatabaseDocumentInternal iMyDb, ODocument iOther, ODatabaseDocumentInternal iOtherDb, ODocumentHelper.RIDMapper ridMapper, boolean iCheckAlsoIdentity) Makes a deep comparison field by field to check if the passed ODocument instance is identical in the content to the current one.static <T> TmakeDbCall(ODatabaseDocumentInternal databaseRecord, ODocumentHelper.ODbRelatedCall<T> function) static voidsort(List<? extends OIdentifiable> ioResultSet, List<OPair<String, String>> iOrderCriteria, OCommandContext context)
-
Field Details
-
ATTRIBUTE_THIS
- See Also:
-
ATTRIBUTE_RID
- See Also:
-
ATTRIBUTE_RID_ID
- See Also:
-
ATTRIBUTE_RID_POS
- See Also:
-
ATTRIBUTE_VERSION
- See Also:
-
ATTRIBUTE_CLASS
- See Also:
-
ATTRIBUTE_TYPE
- See Also:
-
ATTRIBUTE_SIZE
- See Also:
-
ATTRIBUTE_FIELDS
- See Also:
-
ATTRIBUTE_FIELS_TYPES
- See Also:
-
ATTRIBUTE_RAW
- See Also:
-
-
Constructor Details
-
ODocumentHelper
public ODocumentHelper()
-
-
Method Details
-
getReservedAttributes
-
sort
public static void sort(List<? extends OIdentifiable> ioResultSet, List<OPair<String, String>> iOrderCriteria, OCommandContext context) -
convertField
-
getFieldValue
-
getFieldValue
-
getIndexPart
-
filterItem
-
getMapEntry
Retrieves the value crossing the map with the dotted notation- Parameters:
iMap-iKey- Field(s) to retrieve. If are multiple fields, then the dot must be used as separator- Returns:
-
getIdentifiableValue
-
evaluateFunction
public static Object evaluateFunction(Object currentValue, String iFunction, OCommandContext iContext) -
cloneValue
-
hasSameContentItem
public static boolean hasSameContentItem(Object iCurrent, ODatabaseDocumentInternal iMyDb, Object iOther, ODatabaseDocumentInternal iOtherDb, ODocumentHelper.RIDMapper ridMapper) -
hasSameContentOf
public static boolean hasSameContentOf(ODocument iCurrent, ODatabaseDocumentInternal iMyDb, ODocument iOther, ODatabaseDocumentInternal iOtherDb, ODocumentHelper.RIDMapper ridMapper) Makes a deep comparison field by field to check if the passed ODocument instance is identical as identity and content to the current one. Instead equals() just checks if the RID are the same.- Parameters:
iOther- ODocument instance- Returns:
- true if the two document are identical, otherwise false
- See Also:
-
hasSameContentOf
public static boolean hasSameContentOf(ODocument iCurrent, ODatabaseDocumentInternal iMyDb, ODocument iOther, ODatabaseDocumentInternal iOtherDb, ODocumentHelper.RIDMapper ridMapper, boolean iCheckAlsoIdentity) Makes a deep comparison field by field to check if the passed ODocument instance is identical in the content to the current one. Instead equals() just checks if the RID are the same.- Parameters:
iOther- ODocument instance- Returns:
- true if the two document are identical, otherwise false
- See Also:
-
compareMaps
public static boolean compareMaps(ODatabaseDocumentInternal iMyDb, Map<Object, Object> myFieldValue, ODatabaseDocumentInternal iOtherDb, Map<Object, Object> otherFieldValue, ODocumentHelper.RIDMapper ridMapper) -
compareCollections
public static boolean compareCollections(ODatabaseDocumentInternal iMyDb, Collection<?> myFieldValue, ODatabaseDocumentInternal iOtherDb, Collection<?> otherFieldValue, ODocumentHelper.RIDMapper ridMapper) -
compareSets
public static boolean compareSets(ODatabaseDocumentInternal iMyDb, Set<?> myFieldValue, ODatabaseDocumentInternal iOtherDb, Set<?> otherFieldValue, ODocumentHelper.RIDMapper ridMapper) -
compareBags
public static boolean compareBags(ODatabaseDocumentInternal iMyDb, ORidBag myFieldValue, ODatabaseDocumentInternal iOtherDb, ORidBag otherFieldValue, ODocumentHelper.RIDMapper ridMapper) -
makeDbCall
public static <T> T makeDbCall(ODatabaseDocumentInternal databaseRecord, ODocumentHelper.ODbRelatedCall<T> function)
-