A blog mainly about Java

HelloWorld with JPA, Hibernate and MySql

I love Hello Worlds. So when I read the blog HelloWorld with JPA, TopLink and MySql I’ve quickly copied/pasted the code, downloaded everyhting and made it work. Good. But because I’m more a Hibernate user, I thought, let’s give it a try with the same example but using Hibernate EntityManager instead of Toplink.

So here is the same simple example of standalone java application using Java Persistence API (JPA), Hibernate, and MySql 5. Here is what you have to do :