Class ObjectGraphMappingService
- java.lang.Object
-
- org.neotropic.kuwaiba.core.persistence.reference.neo4j.util.ObjectGraphMappingService
-
@Service public class ObjectGraphMappingService extends Object
Provides methods to map nodes into Java objects, mostly BusinessObject and BusinessObjectLight instances.- Author:
- Johny Andres Ortega Ruiz <johny.ortega@kuwaiba.org>
-
-
Constructor Summary
Constructors Constructor Description ObjectGraphMappingService()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description BusinessObject
createObjectFromNode(org.neo4j.graphdb.Node instance)
BusinessObject
createObjectFromNode(org.neo4j.graphdb.Node instance, ClassMetadata classMetadata)
Builds a RemoteBusinessObject instance from a node representing a business objectBusinessObjectLight
createObjectLightFromNode(org.neo4j.graphdb.Node instance)
boolean
isObjectAttributeUnique(String className, String attributeName, Object attributeValue)
Check if the value of the given attribute name is unique across other objects in the class and its subclassesChangeDescriptor
updateObject(String id, ClassMetadata classMetadata, HashMap<String,String> attributes)
-
-
-
Method Detail
-
createObjectLightFromNode
public BusinessObjectLight createObjectLightFromNode(org.neo4j.graphdb.Node instance)
-
updateObject
public ChangeDescriptor updateObject(String id, ClassMetadata classMetadata, HashMap<String,String> attributes) throws InvalidArgumentException, MetadataObjectNotFoundException
-
createObjectFromNode
public BusinessObject createObjectFromNode(org.neo4j.graphdb.Node instance) throws InvalidArgumentException
- Throws:
InvalidArgumentException
-
createObjectFromNode
public BusinessObject createObjectFromNode(org.neo4j.graphdb.Node instance, ClassMetadata classMetadata) throws InvalidArgumentException
Builds a RemoteBusinessObject instance from a node representing a business object- Parameters:
instance
- The object as a Node instance.classMetadata
- The class metadata to map the node's properties into a RemoteBussinessObject.- Returns:
- The business object.
- Throws:
InvalidArgumentException
- If an attribute value can't be mapped into value.
-
isObjectAttributeUnique
public boolean isObjectAttributeUnique(String className, String attributeName, Object attributeValue)
Check if the value of the given attribute name is unique across other objects in the class and its subclasses- Parameters:
className
- the class nameattributeName
- attribute nameattributeValue
- attribute value- Returns:
- true if the attribute value is unique
-
-