Interface Entity

All Superinterfaces:
MapAccessor
All Known Subinterfaces:
Node, Relationship

@Immutable public interface Entity extends MapAccessor
A uniquely identifiable property container that can form part of a Neo4j graph.
Since:
1.0
  • Method Details

    • id

      @Deprecated long id()
      Deprecated.
      superseded by elementId()
      A unique id for this Entity. Ids are guaranteed to remain stable for the duration of the session they were found in, but may be re-used for other entities after that. As such, if you want a public identity to use for your entities, attaching an explicit 'id' property or similar persistent and unique identifier is a better choice.

      Please note that depending on server configuration numeric id might not be available and accessing it will result in IllegalStateException.

      Returns:
      the id of this entity
    • elementId

      String elementId()
      A unique id for this Entity.

      It is recommended to attach an explicit 'id' property or similar persistent and unique identifier if you want a public identity to use for your entities.

      Returns:
      the id of this entity