-
1. Re: Best JPA Solution for Wildfly
mayerw01 Jul 12, 2016 4:59 AM (in response to royibernthal)Spring Data JPA is on top of JPA by adding another layer of abstraction. java - Spring Data-JPA versus JPA: Whats the difference? - Stack Overflow
Are you already using Spring? If yes then this might be an option.if you don't use spring yet I'd go for pure JPA. To follow the JPA standard might also make migrations easier in case your company decides to change the environment.
At it will also be easier to find some expertise for your JPA questions. So support is certainly also another aspect which should be considered.
-
2. Re: Best JPA Solution for Wildfly
smarlow Jul 12, 2016 9:06 AM (in response to royibernthal)Whether you choose to stick with the EE standard JPA technology or something else, JPA is not a casual technology. What I mean is that you should definitely read up on how to use JPA and then decide for yourself, which technology fits best with the needs of your application. When you choose a database server, also spend time reading up on how to deal with that database, so you understand how you will do different things with it, which impacts your application code.
Also consider buying some JPA books to read.
Scott
-
3. Re: Best JPA Solution for Wildfly
royibernthal Jul 12, 2016 6:18 PM (in response to royibernthal)Wolfgang Mayer - I don't use Spring at the moment I'm starting from scratch. How would I start developing in pure JPA? Can you please point me in the right direction?
Scott Marlow - Are there any online articles you can suggest that can help me decide what direction I should take?
-
4. Re: Best JPA Solution for Wildfly
mayerw01 Jul 13, 2016 5:22 AM (in response to royibernthal)A good starting point might be the Oracle documentation Java EE - Documentation | Oracle Technology Network | Oracle
Part VIII of Java Platform, Enterprise Edition: The Java EE Tutorial Release 7 - Contents explores the Java Persistence API
As suggested by Scott I'd also recommend to get a good understanding as well of the persistence provider
like Hibernate ORM documentation (5.1) - Hibernate ORM
or Table of Contents | EclipseLink 2.6.x Understanding EclipseLink
as of the underlying database like Oracle Database 12c Documentation | Oracle Technology Network | Oracle
or MySQL :: MySQL Documentation
Other aspects that should be taken into considerations are performance (Spring Data versus traditional JPA implementation | AIW Solutions), development time (Top 3 JPA productivity boosters for Java EE developers – Spring Data - JAXenter) or Support of the JPA Specification (Spring data might not support the latest JPA specifications)
-
5. Re: Best JPA Solution for Wildfly
royibernthal Jul 16, 2016 3:38 PM (in response to mayerw01)Thanks for the detailed answer.
I found learning JPA from this tutorial to be far easier than from oracle's cumbersome documentation:
Regarding JPA implementations, Hibernate and Spring looked like the most prominent solutions.
The article regarding Spring being a productivity booster certainly caught my attention.
From what I understand however Spring Data JPA and Hibernate are "complementary rather than competitors". (java - What is the difference between Hibernate and Spring Data JPA - Stack Overflow)
Could you please help me understand this subject a bit more in plain words?
Does Spring Data JPA has to rely on implementations like Hibernate or is it a standalone implementation?
How do Hibernate and Spring Data JPA complement each other? What are the advantages of mixing both? Is it wise?
-
6. Re: Best JPA Solution for Wildfly
mayerw01 Jul 17, 2016 5:15 AM (in response to royibernthal)Of course there is quite a lot of (cumbersome) documentation available. Which one you use depends absolutely on you.
As mentioned in the blog "Hibernate is a JPA implementation while Spring Data JPA is a Data Access Abstraction." "With Spring Data you may use Hibernate, Eclipse Link or any other JPA provider."
In other words Spring Data JPA relies on Hibernate (or another JPA implementation).
But when installing Wildfly you will also have Hibernate installed. So there is no need to install Hipernate separately.
This blog gives also some hints (java - Spring Data-JPA versus JPA: Whats the difference? - Stack Overflow)
The Java Persistence API, sometimes referred to as JPA, is a Java framework managing relational data in applications using the Java Platform, Standard Edition(JavaSE) and Java Platform, Enterprise Edition(JavaEE).
"By using Hibernate you tie yourself to that provider restricting your freedom to switch to another option when required (for example, you want to use EclipseLink or ObjectDB instead because Hibernate has a bug that halts your development process)."
And when using Spring Data JPA you tie this program even more to this (proprietary) Persistence Layer solution.
-
7. Re: Best JPA Solution for Wildfly
royibernthal Jul 23, 2016 12:56 PM (in response to mayerw01)I understand, thanks again for the detailed answer.
I think I'll give Spring Data JPA a try even if it restricts my freedom to switch to another option later, hoping that the productivity boost will be worth it.