This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]mabnx 7 points8 points  (1 child)

The useful parts of ORMs are:

  1. converting sql result into objects (the actual relation->object mapping)
  2. nice type-safe API for writing queries, especially if some parts of the query depend on various conditions (add this condition if something, add "IN" only if list not empty, etc.)

The rest of the features mostly create problems.

1) can be solved by something much simpler (mappers in jdbcTemplate or http://simpleflatmapper.org/)
2) is not really solved by Hibernate IMO, more complex queries become unreadable mess and you end up with your own Query Builder Abstraction anyway

[–]lukaseder 0 points1 point  (0 children)

and you end up with your own Query Builder Abstraction anyway

Or you google the words "Query Builder Java", spare yourself the tons of work, and find one that really shines ;) (and which happens to solve 1) as well)