File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Spring and the fly likes Help: Spring Data JPA Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Spring
Bookmark "Help: Spring Data JPA " Watch "Help: Spring Data JPA " New topic

Help: Spring Data JPA

Daniel Ross

Joined: Nov 26, 2010
Posts: 10
I hope this is the right section.

I have been searching for examples, tutorials that can give step by step instructions on how to use JPA data in spring, however I didn't find anything so far.
Most of the examples are incomplete and I'm pretty new to spring.

Is it there any good example that shows how to use spring data jpa with maven possibly?

Mark Spritzler

Joined: Feb 05, 2001
Posts: 17276

What do you mean incomplete? There isn't much you need to do in configuration and in code. That is the greatest thing about all the Spring Data projects. Why not use the documentation directly on the Spring Data JPA website.

For dependencies above core Spring there is the Spring Data Commons jar and Spring Data JPA jar to include. Then you create a Repository interface extending one of Spring Data JPA interfaces. If you have unique queries that use @Query on top of one of your custom interface method declarations, in the xml file define <jpa:repositories base-package="package where those repository interfaces are"/> Had a bean for your datasource, transactionManager, EntityManager container. That's about it.


Perfect World Programming, LLC - iOS Apps
How to Ask Questions the Smart Way FAQ
I agree. Here's the link:
subject: Help: Spring Data JPA
jQuery in Action, 3rd edition