Joel Stevick
Joel Stevick

Reputation: 2038

neo4j: How to get PropertyContainer from an instance of Node; using core API

I am implementing a user defined procedure and I need to be able to get the PropertyContainer from a Node instance; so that I can acquire a lock.

It is not clear to me from the documentation for Node how to do this. The inherited methods such as getAllProperties() simply return a Map for the properties.

Any guidance is very appreciated.

Upvotes: 2

Views: 59

Answers (2)

Stefan Armbruster
Stefan Armbruster

Reputation: 39925

A Node is a PropertyContainer since Node extends Entity and Entity extends PropertyContainer.

Upvotes: 2

František Hartman
František Hartman

Reputation: 15086

org.neo4j.graphdb.Node extends org.neo4j.graphdb.PropertyContainer (in 3.0.x) or org.neo4j.graphdb.Entity which itself extends PropertyContainer (in 3.1.x) so you don't need to do anything, just use the node instance you have.

See the javadoc you linked

All Superinterfaces: Entity, PropertyContainer

http://neo4j.com/docs/java-reference/current/javadocs/org/neo4j/graphdb/Node.html

Upvotes: 2

Related Questions