Wednesday, 24 August 2016

hibernate jpa

Hibernate is the first solution for ORM, not the JPA. Later on, Sun makes it included in the java technique.

So there is no big difference between Hibernate and JPA actually, but Hibernate owned by the JBoss individually.  JPA is a Java community standard.

Hibernate implement oracle JPA standard now, just like many other vendors which offer the JPA implementations. However, Hibernate is the most popular JPA implementation so far.  Normally we call it Hibernate-JPA.

there is a slight difference between classical Hibernate and Hibernate JPA.  The main part is much easier to declare a context in the JPA. there is no session any more, but only need the Persistence to create EntityFactory in line with persistence.xml, and via which we may easily build Entity manager.

The entity manager is the core part of implementing ORM persisting and retrieving data between objects in java and database tables.

From the Entity manager we may declare a transaction to start, and then do data crude operations, and commit transactions. Finally, the entity manager needs to close.

The mapping annotation actually there is no difference, and crud method names have been renamed. for instance, in classical Hibernate session save has been renamed as entity manager persist; and session get has been renamed as entity manager find.

No comments:

Can Jackson Deserialize Java Time ZonedDateTime

Yes, but must include JSR310. Thus ZonedDateTime can be deserialized directly from JSON response to POJO field. <dependency> <g...