Seriously.�Why Hibernate?
Java User Group
(Silesia)
Hypothesis
Hibernate is always suboptimal solution
but before ...
SQL
JDBC + SQL
Experiment
Hibernate vs JdbcTemplate
Hibernate
Myths
JDBC Template + SQL
JDBC Template + SQL
JDBC Template + SQL
JDBC Template + SQL
JDBC Template + SQL
Hibernate
Idiomatic persistence
Idiomatic persistence
Idiomatic persistence
Portability
Portability²
EntityManager vs SessionFactory
EntityManager vs SessionFactory
Gotchas
I recommend watching full video: https://www.youtube.com/watch?v=UPWkpl5PL_w
I recommend watching full video: https://www.youtube.com/watch?v=UPWkpl5PL_w
I recommend watching full video: https://www.youtube.com/watch?v=UPWkpl5PL_w
Effort
SQL
Mappings and object abstractions
SQL
Boilerplate
SQL
Boilerplate
Hibernate
Plain JDBC
JDBC�Template
Warning! Extra complex, we have TWO tables here! Only DBA experts please!
Mapping
Xml Mapping
Vanilla Hibernate
jOOQ
jOOQ
no entity definition
no additional mapping def.
typesafe
no weird indexation
Stored procedures [JDBC]
Stored procedures [JPA]
jOOQ
Recap
Hibernate
Myths
Hibernate
Cons
Hibernate
Why?
“An expert is a person who avoids small error as he sweeps on to the grand fallacy”
- Benjamin Stolberg
Survey
<External/>
Hibernate
Pros
* I really tried hard to find ones (:
Q/A
Thanks!