Design PatternsEvery tool or framework has its limitations. When you run up against such a limitation, its good to know how other people have worked around it. This section documents various design patterns that were not necessarily intended by the original creators of Hibernate. Lightweight Class Delegate Hibernate Aware Action Thread Local Session AspectJ Hibernate aspect Root Persistent Class Codegeneration with Root Persistent Class Open Session in View Session Bean Hi/Lo Generator Page View and User Tracking via Interceptors non-default TimeZone Using Clobs with Oracle and Hibernate Mapping a Blob to a byte[] Mapping a Clob to a String Composite Pattern Chained Interceptor Long Strings/CLOB/TEXT for MySQL NativeHiloGenerator UserType for empty String escaping UserType for Polymorphic Associations UserType for persisting a Typesafe Enumeration with a VARCHAR column UserType for persisting Typesafe Enumerations with a single class UserType to persist Boolean as CHAR UserType for a byte[] identifier property UserType for audit info logging Bidirectional one-to-many with an indexed collection QueryCache
|