[hibernate-issues] [Hibernate-JIRA] Commented: (HHH-3000) Allow a TypeDef to be associated with a class

Emmanuel Bernard (JIRA) noreply at atlassian.com
Tue Sep 22 09:21:50 EDT 2009


    [ http://opensource.atlassian.com/projects/hibernate/browse/HHH-3000?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=34012#action_34012 ] 

Emmanuel Bernard commented on HHH-3000:
---------------------------------------

After discussing with Sarath,

It's a three steps process
1. do execute fillSimpleValue in a SecondPass (but it has to be the first type of secondpass processed)
and make sure every operations that use SimpleValue.getType / SimpleValue.getTypeParameters / SimpleValue.getTypeName() are executed *after* these secondPass have been processed (either because that's naturally the case or by using a SecondPass approach as well)
2. (optional I guess) is to make Hibernaqte Core (and not only annotation) aware of these global TypeDefs
3. we can decide if targetClass is mandatory or not but that's really the easy bit
BTW when doing 1. we need to make sure the error report is not crippled, ie we keep all the relevant data (ie class name, property name)
Do you want to give this pathc a try?

> Allow a TypeDef to be associated with a class
> ---------------------------------------------
>
>                 Key: HHH-3000
>                 URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-3000
>             Project: Hibernate Core
>          Issue Type: Improvement
>            Reporter: Darren Bell
>
> This would allow you to just define it once and not have to worry about adding extra details to the mapping file or by annotating a field.
> For instance:
> 	@TypeDef(
> 		name="internalHeaderType",
> 		typeClass=com.dolby.mapics.GenericEnumUserType.class,
>                 targetClass=com.dolby.mapics.InternalHeaderType,
> 		parameters= {
> 			@Parameter(name="enumClass", value="com.dolby.mapics.InternalHeaderType"),
> 			@Parameter(name="identifierMethod", value="toString"),
> 			@Parameter(name="valueOfMethod", value="fromString")
> 	})
> by adding the targetClass attribute would enable this.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://opensource.atlassian.com/projects/hibernate/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        


More information about the hibernate-issues mailing list