anchor.diff:  
   The property is set to `100` as an example; you may experiment with the batch size to see what works best for your application.
   
  -=== Query Optimization
  +==== Use Interleaved Tables for Parent-Child Entities
  +
  +Cloud Spanner offers the concept of https://cloud.google.com/spanner/docs/schema-and-data-model#creating-interleaved-tables[Interleaved Tables] which allows you to co-locate the rows of an interleaved table with rows of a parent table for efficient retrieval.
  +This feature enforces the one-to-many relationship and provides efficient queries and operations on entities of a single domain parent entity.
  +
  +If you would like to generate interleaved tables in Cloud Spanner, you must annotate your entity with the `@Interleaved` annotation.
  +The primary key of the interleaved table must also include at least all of the primary key attributes of the parent.
  +This is typically done using the `@IdClass` or `@EmbeddedId` annotation.
  +
  +The https://github.com/GoogleCloudPlatform/google-cloud-spanner-hibernate/tree/master/google-cloud-spanner-hibernate-samples/basic-hibernate-sample[Hibernate Basic Sample] contains an example of using `@Interleaved` for the https://github.com/GoogleCloudPlatform/google-cloud-spanner-hibernate/blob/master/google-cloud-spanner-hibernate-samples/basic-hibernate-sample/src/main/java/com/example/entities/Singer.java[Singer] and https://github.com/GoogleCloudPlatform/google-cloud-spanner-hibernate/blob/master/google-cloud-spanner-hibernate-samples/basic-hibernate-sample/src/main/java/com/example/entities/Album.java[Album] entities.
  +The code excerpt of the `Album` entity below demonstrates how to declare an interleaved entity in the `Singer` table.
  +
  +[source, java]
  +----
  +@Entity
  +@Interleaved(parentEntity = Singer.class, cascadeDelete = true)
  +@IdClass(AlbumId.class)
  +public class Album {
  +
  +  @Id
  +  @GeneratedValue(strategy = GenerationType.AUTO)
  +  @Type(type = "uuid-char")
  +  private UUID albumId;
  +
  +  @Id
  +  @ManyToOne
  +  @JoinColumn(name = "singerId")
  +  @Type(type = "uuid-char")
  +  private Singer singer;
  +
  +  // Constructors, getters/setters
  +
  +  public static class AlbumId implements Serializable {
  +
  +    // The primary key columns of the parent entity
  +    // must be declared first.
  +    Singer singer;
  +
  +    @Type(type = "uuid-char")
  +    UUID albumId;
  +
  +    // Getters and setters
  +  }
  +}
  +----
  +
  +The parent entity should define a `@OneToMany` relationship with the child entity as well.
  +Use the `mappedBy` setting to specify which field in the child maps back to the parent.
  +
  +[source, java]
  +----
  +@Entity
  +public class Singer {
  +
  +  @OneToMany(mappedBy = "singer")
  +  List<Album> albums;
  +
  +  // continued...
  +}
  +----
  +
  +==== Tune JDBC Driver Parameters
  +
  +The Spanner JDBC driver allows you to set the number of GRPC channels initialized through the JDBC connection URL.
  +Each channel can support up to 100 concurrent requests; for applications that require a high amount of concurrency this value can be increased (from the default of 4).
  +
  +----
  +jdbc:cloudspanner:/projects/PROJECT_ID/instances/INSTANCE_ID/databases/DATABASE_ID;numChannels=8
  +----
  +
  +The full list of configurable properties can be found in the https://github.com/googleapis/java-spanner-jdbc/blob/master/src/main/java/com/google/cloud/spanner/jdbc/JdbcDriver.java[Spanner JDBC Driver Java docs].
  +
  +==== Use Spanner Query Optimization
   
   The https://cloud.google.com/spanner/docs/query-syntax[Cloud Spanner SQL syntax] offers a variety of query hints to tune and optimize the performance of queries.
   If you find that you need to take advantage of this feature, you can achieve this in Hibernate using native SQL queries.
  
positive.code: 
  == User Guide
  
  The following section describes recommendations and best practices for how to best use the Cloud Spanner Hibernate Dialect.
  
  === Use Generated UUIDs for ID Generation
  
  The Universally Unique Identifier (UUID) is the preferred ID type in Cloud Spanner because it avoids hotspots as the system divides data among servers by key ranges.
  A monotonically increasing integer key would also work, but can be less performant.
  
  For this reason, if you are using generated IDs in your code, you should configure UUID generation like this:
  
  [source, java]
  ----
  
negative.code: :toc:
  :toclevels: 4
  
  = Google Cloud Spanner Dialect for Hibernate ORM
  
  This is a dialect compatible with https://hibernate.org/orm/releases/5.4/[Hibernate 5.4] for the https://cloud.google.com/spanner/[Google Cloud Spanner] database service.
  