I'm migrating from hibernate 3 to hibernate 4, In hibernate 3 the way I was registering a custom type was:
I'm now trying to do the same operation but using hibernate 4, my question is how is the best way to do this? since I dont have access do change configuration when using "org.springframework.orm.hibernate4.LocalSessionFa ctoryBean" instead of "org.springframework.orm.hibernate3.annotation.Ann otationSessionFactoryBean".Code:public class AnnotationSessionFactoryBean extends org.springframework.orm.hibernate3.annotation.AnnotationSessionFactoryBean { private Collection<? extends BasicType> customTypes; public Collection<? extends BasicType> getCustomTypes() { return customTypes; } public void setCustomTypes(Collection<? extends BasicType> customTypes) { this.customTypes = customTypes; } @Override protected Configuration newConfiguration() throws HibernateException { Configuration configuration = super.newConfiguration(); if (CollectionUtils.hasEntries(customTypes)) { for (BasicType customType:customTypes) { configuration.registerTypeOverride(customType); } } return configuration; } }
Thanks


Reply With Quote
