-
Notifications
You must be signed in to change notification settings - Fork 38.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
No way to add hibernate type definitions to a LocalSessionFactoryBean [SPR-885] #5612
Comments
matthew inger commented Patch for LocalSessionFactoryBean to add the TypeDef objects. |
matthew inger commented TypeDefinitionBean which holds type type name, type class, and parameters for a type definition. |
matthew inger commented Newer version. The "typeClass" on TypeDefinitionBean is now a string. |
matthew inger commented Change "typeClass" to a string |
matthew inger commented |
matthew inger commented fixed one issue |
matthew inger commented |
Juergen Hoeller commented I'm reluctant to add this to LocalSessionFactoryBean. Typedefs are usually defined in Hibernate mapping files, not in the Hibernate configuration file. But LocalSessionFactoryBean's local properties are mainly intended as replacement for "hibernate.cfg.xml"... Wouldn't it be good enough to define the typedefs with the standard Hibernate <typedef> tag in some core mapping file of your application? Juergen |
matthew inger commented On the contrary, I think typedef makes more sense in the |
matthew inger commented PS: I realize that hibernate itself doesn't allow the "typedef" |
Juergen Hoeller commented OK, I agree that it makes sense to specify those at the SessionFactory level. Effectively, this is the same issue as with filter definitions, which we already support at the SessionFactory level too. Juergen |
matthew inger opened SPR-885 and commented
There is currently no way to add a TypeDef instance to a LocalSessionFactory bean. I am including a patch which will allow the addition of TypeDef objects. There will be a "typeDefinitions"
property on the LocalSessionFactoryBean:
public void setTypeDefinitions(TypeDefinitionBean typeDefinitions[]);
The "TypeDefinitionBean" class contains the name, type class, and parameters for the type definition:
<bean class="org.springframework.orm.hibernate3.TypeDefinitionBean">
<property name="name"><value>myType</value></property>
<property name="typeClass"><value>MyTypeFQCN</value></property>
</bean>
Affects: 1.2 RC2
Attachments:
The text was updated successfully, but these errors were encountered: