1

If I am using spring JPA, then should I use any ORM frameworks such as hibernate or toplink in order to save the data to the database? I was trying to find out without using ORM frameworks. But I could not find out any link for that. I saw many articles regarding spring jpa. Request you to post some links. I have already posted a thread last week regarding annotated entity manager.

annotated entity manager null pointed exception

As I am new to spring, did not get the idea properly.

Community
  • 1
  • 1
user414967
  • 5,225
  • 10
  • 40
  • 61

2 Answers2

3

JPA is a standard. The standard is implemented by multiple frameworks - Hibernate, EclipseLink, OpenJPA. You must choose one of those. JPA itself only defines the interfaces and annotations, while the framework performs all the orm mapping.

Spring's JPA is not an implementation - just a set of classes meant to make it easy to use JPA (and is agnostic of the underlying framework)

Bozho
  • 588,226
  • 146
  • 1,060
  • 1,140
  • thanks.actually My requirement is to save the entities to the database using annotated EntityManager. I came to know that those annotated EntityManagers are worked when The client is either a web component or another enterpise bean. So I have to use spring framework in order to access the service layer. Because I am not using any webclient. For that when I try to do the configuration,the orm jars and hibernate jars also included, which I dont want. so Is there any way without using the hibernate or anhy other orm? – user414967 Feb 13 '12 at 18:48
0

The only thing that you can do is that use JPA specific annotation not hibernate or other ORM frame works annotation and just choose one of them as you jpaVendorAdapter. It hase some benefits such as you don' t bind your code to these ORM and you choose other vendors at the middle of the development, but you should know that you use JPA annotations but you really use the ORM for example you youse @PersistenceContext to inject EntityManager but you use the ORM specefic implementation of EntityManager.