// An entity with a Key ID field. Can have an ancestor set
// in the Key.
Key book3key = new Builder("Publisher", "O'Reilly")
.addChild("BookKeyId", "978-0-596-52272-8")
.getKey();
BookKeyId book3 = new BookKeyId(book3key);
em.persist(book3);
} finally {
em.close();
}