anchor.diff:  
   An additional label +ENTITY+ is added to the node. 
   
  -.Example of entity and the corresponding representation using Cypher
  -====
  -[source, JAVA]
  -----
  -@Entity
  -class Account {
  -
  -    @Id
  -    String login;
  -
  -    String password;
  -
  -}
  -----
  -
  -[subs="verbatim,attributes"]
  -----
  -Using Cypher:
  -
  -(n:Account:ENTITY {login: '...', password: '...'})
  -----
  -====
  -
  -.Example of enitty with @Embaddable
  -====
  -[source, JAVA]
  -----
  -@Entity
  -class Account {
  -	String login;
  -	String password;
  -	Address homeAddress;
  -	...
  +.Default JPA mapping for an entity
  +====
  +[source, JAVA]
  +----
  +@Entity
  +public class News {
  +
  +    @Id
  +    private String id;
  +    private String title;
  +
  +    // getters, setters ...
  +}
  +----
  +
  +image::images/neo4j-single-node-example.png[align="center", depth="", scalefit="1"]
  +====
  +
  +.Rename node label and properties using @Table and @Column
  +====
  +[source, JAVA]
  +----
  +@Entity
  +@Table(name="ARTICLE")
  +public class News {
  +
  +    @Id
  +    private String id;
  +
  +    @Column(name = "headline")
  +    private String title;
  +
  +    // getters, setters ...
  +}
  +----
  +
  +image::images/neo4j-@Column-@Table-example.png[align="center", depth="", scalefit="1"]
  +====
  +
  +====== Identifiers and unique constraints
  +
  +[WARNING]
  +====
  +Neo4j does not support constraints on more than one property.
  +For this reason, Hibernate OGM will create a unique constraint ONLY when it spans
  +a single property and it will ignore the ones spanning multiple properties.
  +
  +The lack of unique constraints on node properties might result in the creation of multiple
  +nodes with the same identifier.
  +====
  +
  +Hibernate OGM will create unique constraints for the identifier of entities and for the properties 
  +annotated with:
  +
  +* +@Id+
  +* +@EmbeddedId+
  +* +@NaturalId+
  +* +@Column( unique = true )+
  +* +@Table( uniqueConstraints = @UniqueConstraint(columnNames = { "column_name" } ) )+
  +
  +Embedded identifiers are currently stored as dot separated properties.
  +
  +.Entity with @EmbeddedId
  +====
  +[source, JAVA]
  +----
  +@Entity
  +public class News {
  +
  +    @EmbeddedId
  +    private NewsID newsId;
  +
  +    private String content
  +
  +    // getters, setters ...
   }
   
   @Embeddable
  -public class Address {
  -	String street1;
  -	String street2;
  -	String city;
  -	String country;
  -
  -	@Column(name = "postal_code")
  -	String zipCode;
  -}
  -----
  -
  -[subs="verbatim,attributes"]
  -----
  -(n:Account:ENTITY {login: ..., 
  -                   , password: ...
  -                   , `homeAddress.street1`: ...
  -                   , `homeAddress.city`: ...
  -                   , `homeAddress.country`: ...
  -                   , postal_code`: ...})
  -----
  -
  -====
  -
  -Currently an embeddable element is stored saving the values on the node that represents the entity.
  -
  -Hibernate OGM will create unique constraints for the identifier of entities and for the properties defined
  -as unique using:
  -
  -* @NaturalId
  -* @Column(unique = true)
  -* @Table(uniqueConstraints = @UniqueConstraint(columnNames = { "column_name" }
  -
  -  Neo4j does not support constraints on more than one property.
  -  For this reason, Hibernate OGM will create a unique constraint only when
  -  defined on a single column and it will ignore the ones defined on multiple columns.
  +public class NewsID implements Serializable {
  +
  +    private String title;
  +    private String author;
  +
  +    // getters, setters ...
  +}
  +----
  +
  +image::images/neo4j-@EmbeddedId-example.png[align="center", depth="", scalefit="1"]
  +====
  +
  +====== Embedded objects and collections
  +
  +The properties of an +@Emebddable+ element are stored as dot-separated properties in the owner node.
  +
  +.Embedded object
  +====
  +[source, JAVA]
  +----
  +@Entity
  +public class News {
  +
  +    @EmbeddedId
  +    private NewsID newsId;
  +
  +    @Embedded
  +    private NewsPaper paper;
  +
  +    // getters, setters ...
  +}
  +
  +@Embeddable
  +public class NewsID implements Serializable {
  +
  +    private String title;
  +    private String author;
  +
  +    // getters, setters ...
  +}
  +
  +@Embeddable
  +public class NewsPaper {
  +
  +    private String name;
  +    private String owner;
  +
  +    // getters, setters ...
  +}
  +----
  +
  +image::images/neo4j-@Embedded-example.png[align="center", depth="", scalefit="1"]
  +====
  +
  +.@ElementCollection
  +====
  +[source, JAVA]
  +----
  +@Entity
  +public class GrandMother {
  +
  +    @Id
  +    private String id;
  +
  +    @ElementCollection
  +    private List<GrandChild> grandChildren = new ArrayList<GrandChild>();
  +
  +    // getters, setters ...
  +}
  +
  +@Embeddable
  +public class GrandChild {
  +
  +    private String name;
  +
  +    // getters, setters ...
  +}
  +----
  +
  +image::images/neo4j-@ElementCollection-example.png[align="center", depth="", scalefit="1"]
  +====
  +
  +Note that in the previous example no property is added to the relationships;
  +in the following one, one property is added to keep track of the order of the elements in the list.
  +
  +.@ElementCollection with @OrderColumn
  +====
  +[source, JAVA]
  +----
  +@Entity
  +public class GrandMother {
  +
  +    @Id
  +    private String id;
  +
  +    @ElementCollection
  +    @OrderColumn( name = "birth_order" )
  +    private List<GrandChild> grandChildren = new ArrayList<GrandChild>();
  +
  +    // getters, setters ...
  +}
  +
  +@Embeddable
  +public class GrandChild {
  +
  +    private String name;
  +
  +    // getters, setters ...
  +}
  +----
  +
  +image::images/neo4j-@ElementCollection-@OrderColumn-example.png[align="center", depth="", scalefit="1"]
  +====
   
   ===== Associations
   
  
positive.code: To ease migration between stores, it is recommended to reference these constants directly from there.
  ====
  
  [[ogm-neo4j-storage-principles]]
  ==== Storage principles
  
  
negative.code: 
  Sequence-based generators are represented by nodes in the following form:
  
  .GenerationType.SEQUENCE
  ====
  [source, JAVA]
  ----
  @Entity
  public class Song {
  
      ...
  
      @Id
      @GeneratedValue( strategy = GenerationType.SEQUENCE, generator = "songSequenceGenerator" )
      @SequenceGenerator(
              name = "songSequenceGenerator",
              sequenceName = "song_sequence",
              initialValue = INITIAL_VALUE,
              allocationSize = 10)
      public Long getId() {
          return id;
      }
  
      ...
  ----
  
  image::images/neo4j-sequence-example.png[align="center", depth="", scalefit="1"]
  ====
  
  Each sequence generator node is labelled with +SEQUENCE+.
  