Your SlideShare is downloading. ×
0
Why do I hate Hibernate?
Why do I hate Hibernate?
Why do I hate Hibernate?
Why do I hate Hibernate?
Why do I hate Hibernate?
Why do I hate Hibernate?
Why do I hate Hibernate?
Why do I hate Hibernate?
Why do I hate Hibernate?
Why do I hate Hibernate?
Why do I hate Hibernate?
Why do I hate Hibernate?
Why do I hate Hibernate?
Why do I hate Hibernate?
Why do I hate Hibernate?
Why do I hate Hibernate?
Why do I hate Hibernate?
Why do I hate Hibernate?
Why do I hate Hibernate?
Why do I hate Hibernate?
Why do I hate Hibernate?
Why do I hate Hibernate?
Why do I hate Hibernate?
Why do I hate Hibernate?
Why do I hate Hibernate?
Why do I hate Hibernate?
Why do I hate Hibernate?
Why do I hate Hibernate?
Why do I hate Hibernate?
Why do I hate Hibernate?
Why do I hate Hibernate?
Why do I hate Hibernate?
Upcoming SlideShare
Loading in...5
×

Thanks for flagging this SlideShare!

Oops! An error has occurred.

×
Saving this for later? Get the SlideShare app to save on your phone or tablet. Read anywhere, anytime – even offline.
Text the download link to your phone
Standard text messaging rates apply

Why do I hate Hibernate?

17,087

Published on

Presentation from JEEConf conference (Kiev, May 2012) about issues in Hibernate usage and tricks to avoid them.

Presentation from JEEConf conference (Kiev, May 2012) about issues in Hibernate usage and tricks to avoid them.

Published in: Technology
2 Comments
16 Likes
Statistics
Notes
  • I agree and I'd like to add two other issues. The first one is that Hibernate generates Proxy Classes that consumes lots of memory (-XX:MaxPermSize) on large projects crashing the server: its fine for 'Hello World'. The second one is that Lazy strategy is useless for service oriented projects like a Rest API because serialization causes all getters to be invoked.
       Reply 
    Are you sure you want to  Yes  No
    Your message goes here
  • True history! congrats
       Reply 
    Are you sure you want to  Yes  No
    Your message goes here
No Downloads
Views
Total Views
17,087
On Slideshare
0
From Embeds
0
Number of Embeds
14
Actions
Shares
0
Downloads
0
Comments
2
Likes
16
Embeds 0
No embeds

Report content
Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
No notes for slide

Transcript

  • 1. Why do I hate Hibernate? Mikalai Alimenkou http://xpinjection.com 19.05.2012
  • 2. CRUD*R – read by ID
  • 3. Why Hibernate is so popular? 1. EJB 2 sucks! + 2. New “standard”
  • 4. WTF #1. Nobody understand howequals and hashCode must look like
  • 5. Comparison context is very important Hard to select real“unique business key”Performance issues with collections Auto-generated fields in Set
  • 6. WTF #2. Mutable objects are evil
  • 7. Default constructor must present Fields can’t be finalInconsistent object state is possibleOr… reflectionmagic happens
  • 8. POJO bullshit game
  • 9. WTF #3. DTO is evil patternwith Hibernate
  • 10. Lots of code DTO maintenance duplications is nightmare Many solutions: - transformers - beanutils - reflection - librariesCrazy DTO “don’tforget” checklist
  • 11. WTF #4. Lazy loading
  • 12. Nightmare for Everything is stupidly newcomers slow without it Almost nobody understand how it works Persistent collections are not serializable
  • 13. WTF #5. Criteria API or HQL? =
  • 14. WTF?!?No need to know SQL??? Bullshit!!!
  • 15. Different features set in HQL and Criteria API Hand made query builders in HQL No check for NULL in HQLCriteria API only for READ
  • 16. WTF #6. To update single fieldyou should read full entity
  • 17. Children and large Not everybody fields are loadedunderstand how ‘lazy loading’ works HQL update is not object-oriented At least 2 SQL queries for simple update
  • 18. WTF #7. Temporary table usageon update or delete
  • 19. WTF #8. Composite key requiresseparate class
  • 20. WTF #9. Entity state can be managedonly from one side in parent-childrelationship
  • 21. WTF #10. Flush on commit istoo unpredictable
  • 22. Entity changes are persisted Collections operations are ‘live’ Constraints arechecked on commitNo control for SQL queries order
  • 23. WTF #11. Dirty entity aftertransaction rollback can’t be reused
  • 24. WTF #12. Documentation issimple but primitive
  • 25. Only basic samples For complex are coveredthings you need books Bug reports are ignored Debug hell tounderstand how things work
  • 26. WTF #13. Hibernate makesdevelopers stupid Are you joking???
  • 27. People don’t learn JDBC and SQL Nobody countSQL queries andcare about their structure Developersdon’t tune JDBC properties
  • 28. When we really need to use ORM?
  • 29. Is CQRS more actual now?
  • 30. Useful books
  • 31. @xpinjection http://xpinjection.commikalai.alimenkou@xpinjection.com

×