This really is something I deal periodically with, and very first time it had been me who needed conviction. Fortunately, I simply attempted, made extra effort to understand and because of this book, Spring support, and Hibernate I will not begin a project without thinking about JPA. Although not everybody would like to visit one step further that frequently (just in anything we cope with I suppose). Just how and things to say/present/explain/argument to a minimum of change their attitude toward ORM?

Related: Convincing a die hard DBA to make use of an ORM for almost all CRUD versus Saved Methods, View, and processes

Just how and things to say/present/explain/argument to a minimum of change their attitude toward ORM?

Request if they would like to keep writing exactly the same boilerplate SQL JDBC CRUD code for each new entity type you supplment your application.

With no ORM solution within the data layer, each new entity class requires N models of labor to create that entity available with the data layer (DAOs, CRUD code, saved methods, writing queries, etc.).

ORM transforms that N into a small fraction of itself, presuming that adding new organizations then requires you to definitely just add another mapping for your entity in metadata.

I'll think that you really come with an object model that's more potent than mere DTOs and not single:1 correspondence together with your relational schema. Otherwise, you do not win the argument.

Won by you when the SQL produced by Hibernate reaches least as efficient because the hands-coded stuff that's within the saved procs.

You lose when the saved procs could be enhanced to do much better than Hiberate-produced SQL.

You lose when the database is shared by other applications that rely on the saved procs. You cannot slowly move the logic to Spring and also the middle tier as quickly.

You've got a better situation in case your application is the owner of the database.

Since you are already using Spring, that indicates that you've a DAO layer that uses Spring Validation. PreparedStatements happen to be used underneath, so SQL injection is really as unlikely for Spring because it is for saved procs.

I believe this answer out of your related question link nails the actual problem. When the database's purpose is tightly combined for your application, also it does not genuinely have another identity, then ORM makes a lot of sense.

If, however, your database signifies a bigger picture as well as your application is among the many programs that accesses data, using ORM might have potential negative impacts around the coupling involving the application and also the database and the necessity to alter the database with time.

But to some extent you are able to answer your question yourself - what objections have you have? How had you been convinced the very first time?

OK, I am likely to take part in the devil's advocate here.

Saved methods really are a layer of abstraction. JPA requires you to definitely be aware of underlying table structure. Saved methods/functions mask that you simply only have to know procedure or function to call and what its return type is.

JDBC makes calling saved methods super easy, while using Connection object's prepareCall techniques.

Saved methods include a layer of security: The applying itself usually cannot by hand customize the tables, only call the methods which do the alteration. The SP/SF ought to be validating the arguments passed into it.

The main drawback with saved methods gets data out... you have to make your own facility to map arrays and structs returning to Java objects, usually having a type Map and special programmatically produced objects applying the SQLData interface.