Author author3 = new Author();
author3.setFirstName("J-K");
author3.setLastName("Rowling");
entityManager.persist(author3);
Book book = new Book();
book.setTitle("HTML 5 et CSS 3");
book.setCategory(category1);
book.setPrice(new java.math.BigDecimal("10.50"));
book.setDate(now);
book.addAuthor(author1);
File f = new File("WebContent/resources/images/html.jpg");
byte[] photo = new byte[(int) (f.length())];
FileInputStream fi = new FileInputStream(f);
fi.read(photo);
book.setPhoto(photo);
entityManager.persist(book);
book = new Book();
book.setTitle("Hibernate in action");
book.setCategory(category1);
book.setPrice(new java.math.BigDecimal("30.50"));
book.setDate(now);
book.addAuthor(author1);
book.addAuthor(author2);
f = new File("WebContent/resources/images/hibernate.jpg");
photo = new byte[(int) (f.length())];
fi = new FileInputStream(f);
fi.read(photo);
book.setPhoto(photo);
entityManager.persist(book);
book = new Book();
book.setTitle("Harry Potter");
book.setCategory(category2);
book.setPrice(new java.math.BigDecimal("20.50"));
book.setDate(now);
book.addAuthor(author3);
f = new File("WebContent/resources/images/harry.jpg");
photo = new byte[(int) (f.length())];
fi = new FileInputStream(f);
fi.read(photo);
book.setPhoto(photo);
entityManager.persist(book);
Client user = new Client();
user.setLogin("galland");
user.setPassword("dauphine");