I am using Hibernate 4.2, JPA 2.0 & Postgres 9.2
The code gets stuck at Persistence.createEntityManagerFactory(\"peristence_unit_name\");
O
I have the same problem and for some reason it takes long time to extract JDBC metadata for hibernate. You can just turn off using jsbc metadata for hibernate and it will become very fast. But remember that hibernate is not using jdbc metadata and will use some defaults instead.
To try this out set hibernate.temp.use_jdbc_metadata_defaults
to false.
<prop key="hibernate.temp.use_jdbc_metadata_defaults">false</prop>