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.

0

2 Answers 2

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)

Sign up to request clarification or add additional context in comments.

1 Comment

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?
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.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.