Author author = new Author();
author.setFirstName("JRR");
author.setLastName("Tolkein");
Book hobbit = new Book();
hobbit.setAuthor(author);
hobbit.setTitle("The Hobbit");
hobbit.setPublicationDate(new GregorianCalendar(1937, 11, 1).getTime());
em.persist(hobbit);
Book fotr = new Book();
fotr.setAuthor(author);
fotr.setTitle("Fellowship of the Ring");
fotr.setPublicationDate(new GregorianCalendar(1954, 06, 24).getTime());
em.persist(fotr);
Book twoTowers = new Book();
twoTowers.setAuthor(author);
twoTowers.setTitle("The Two Towers");
twoTowers.setPublicationDate(new GregorianCalendar(1954, 10, 11).getTime());
em.persist(twoTowers);
Book rotk = new Book();
rotk.setAuthor(author);
rotk.setTitle("Return of the King");
rotk.setPublicationDate(new GregorianCalendar(1955, 9, 20).getTime());
em.persist(rotk);
Author rowling = new Author();
rowling.setFirstName("J.K");
rowling.setLastName("Rowling");
Book hpps = new Book();
hpps.setAuthor(rowling);
hpps.setTitle("Harry Potter and the Philosophers Stone");
hpps.setPublicationDate(new GregorianCalendar(1997, 5, 30).getTime());
em.persist(hpps);
Book hpcs = new Book();
hpcs.setAuthor(rowling);
hpcs.setTitle("Harry Potter and the Chamber of Secrets");
hpcs.setPublicationDate(new GregorianCalendar(1998, 6, 2).getTime());
em.persist(hpcs);
Book hppa = new Book();
hppa.setAuthor(rowling);
hppa.setTitle("Harry Potter and the Prisoner of Azkaban");
hppa.setPublicationDate(new GregorianCalendar(1999, 6, 8).getTime());
em.persist(hppa);
}