• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

JPA Drawbacks

 
Ranch Hand
Posts: 49
1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
In some test on Java I found that as correct answer for

"Which statement identifies a risk of adopting JPA?"

the correct answer is

"JPA’s query language relies on a container to manage the persistence layer."

Why it coukd be a drawback?
 
Marshal
Posts: 79177
377
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Welcome to the Ranch

Please always tell us where such questions come from. And remind us what JPA means.
 
Mimmo Ludovico
Ranch Hand
Posts: 49
1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

thanks for the fast answer. I fuon the quesiton here:

https://coderanch.com/t/639200/Mock-Exam-Errata/certification/Errors-SelfTest-Engine-Demo
 
Java Cowboy
Posts: 16084
88
Android Scala IntelliJ IDE Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I can see why that could be considered a risk compared to using plain JDBC: to use JPA, you need a container or library that implements JPA, because JPA is not implemented in the standard JDK. You'd for example need to include Hibernate or some other implementation of JPA into your project.

However, in my opinion using JPA is still much better than using plain JDBC. With plain JDBC, you'll have to write a lot of low-level code by hand to convert from objects to SQL statements and back. In any non-trivial application, it will be much more work to use plain JDBC than JPA, and using JDBC will become a maintenance nightmare. Using JDBC vs using JPA is like programming in assembly language vs programming in a higher-level language.
 
Mimmo Ludovico
Ranch Hand
Posts: 49
1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Indeed I agree with you, but I don't understand why the test give that answer and identify it like a drawback
 
Jesper de Jong
Java Cowboy
Posts: 16084
88
Android Scala IntelliJ IDE Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Having to include external libraries, such as Hibernate, can be considered a risk - if there's a bug in Hibernate or whatever other JPA implementation you use, then that could affect your project. The more code and libraries you put into a project, the bigger the chance is that there's a bug somewhere that might affect the project. (But the risk is limited, and for example Hibernate is used by many thousands of companies around the world - if there would be some major bug in it, somebody most likely would have discovered it already).
 
Mimmo Ludovico
Ranch Hand
Posts: 49
1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Ok, I understood it. But the following could be consider risk?

A. JPA only works with well-known data models.
B. JPA may be able to model every table as a class.


I need to choice only one answer. I need to choice the best
reply
    Bookmark Topic Watch Topic
  • New Topic