2008/04/20

10 Ways to use Hibernate Effectively, by Brian Sam Bodden

Brian Sam Bodden on the Seattle NFJS Java Conference. 


- Inheritance, Table per Concrete Class, Table per Class Hierarchy, Table per Subclass
- Identify and use Components in the Mapping
- Dynamic Data Filtering can be enabled in either HBM file or use Annotation
- While generated SQL is good enough in most case, Hibernate does support Customer SQL as well as native SQL with direct JDBC connection. iBATIS alike but you only require to customize the SQL when needed.
- Bulk Operations - Enable JDBC Batching & Be mindful of Session and 2nd Level Cache
- Cache - Session Cache & 2nd Level Cache, Read-Only, Read/Write & Query Cache
- Terracotta - Claims of performance gains in the range of 2-4x when integrating with second level cache
- Hibernate Search - Free text search with Lucene, Annotation driven, luceneQuery = parser.parse("name:beckham or name:galaxy")
- Profiling/Debugging - beware of the Write behind fact of Hibernate. p6spy, Jahia's SQL Profiler, Hibernate Statistics
- Hibernate/Jboss Tools - http://www.hibernate.org/255.html
- Hibernate Tips & Tricks Page: http://www.hibernate.org/118.html

No comments:

Well well... why another J2EE blog? I benefited from other people's technical blogs, and guess what, it's a good idea to contribute some of my works too. Hope it's helpful and useful, to all of your folks.