Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie
Hi there,
There is an issue with role permissions that is being worked on at the moment.
If you are having trouble with access or permissions on regional forums please post here to get access: https://www.boards.ie/discussion/2058365403/you-do-not-have-permission-for-that#latest

Disadvantages of using Hibernate ORM

  • 06-09-2016 10:11am
    #1
    Closed Accounts Posts: 6,075 ✭✭✭


    Can anyone tell me why one would not use Hibernate ORM?

    My take:
    • Slower - if I just want the age column from the Person table, I must retrieve the entire Person object (same with persisting)
    • Slower than JDBC


Comments

  • Closed Accounts Posts: 2,267 ✭✭✭h57xiucj2z946q


    Can anyone tell me why one would not use Hibernate ORM?

    My take:
    • Slower - if I just want the age column from the Person table, I must retrieve the entire Person object (same with persisting)
    • Slower than JDBC

    For small use-cases (simple selects only, no updates, inserts, deletes), using an ORM solution might be considered over engineering.


  • Closed Accounts Posts: 6,075 ✭✭✭IamtheWalrus


    For small use-cases (simple selects only, no updates, inserts, deletes), using an ORM solution might be considered over engineering.

    In Hibernate, does HQL solve the problem in my first point above?


  • Registered Users, Registered Users 2 Posts: 159 ✭✭magooly


    If you choose to use an ORM you should to stick with JPA as its a standard with hibernate as the implementation. (TiP: JPA + Hibernate with Spring Data)

    Negatives for an ORM:

    The DB is abstracted away from the developer so in many cases you will not be sure (and surprised!) what querys are executing and more worrying how many (n+1 problem). TRACE query logging is a valuable here.

    The devs become lazy and any SQL skills quickly wane when not in use

    When a performance issue comes up its more than likely solveable with a custom JPQL.

    A certain level lf expertise will be needed once you start mapping complex relationships.

    For simple web based apples and oranges an ORM is not a bad idea and its a good skill to have in the industry.

    As a counter - without an ORM any refactoring of tables and columns will most likely break multiple queries. Spring data and JPA will give some protection against this.


Advertisement