@Override
public void findAllBooks() {
Query query = em.createQuery("SELECT e FROM Book e");
List emps = (List<Book>) query.getResultList();
System.out.println("book details---->");
for (Iterator i = emps.iterator(); i.hasNext();) {
Book e = (Book) i.next();
System.out.println("Book ID---> " + e.getBookId() + ",Name--> "
+ e.getName() + ",Author--> " + e.getAuthor()
+ ",price--> " + e.getPrice());
}
}
No comments:
Post a Comment