anchor.diff:  
   Sequence-based generators are represented by nodes in the following form:
   
  -.Example of a sequence-based generator using Cypher
  -====
  -[subs="verbatim,attributes"]
  -----
  -(:SEQUENCE { sequence_name = 'ExampleSequence', next_val : 3 })
  -----
  +.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+.
  
positive.code: 
  Table-based generators are represented by nodes in the following form:
  
  .Example of a table-based generator using Cypher
  ====
  [subs="verbatim,attributes"]
  ----
  (:hibernate_sequences:TABLE_BASED_SEQUENCE { sequence_name = 'ExampleSequence', current_value : 3 })
  ----
  ====
  
  Each table generator node is labelled with +TABLE_BASED_SEQUENCE+
  
negative.code: 
  An additional label +ENTITY+ is added to the node. 
  
  .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 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
  
  