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

Sharath Reddy (JIRA) noreply at atlassian.com
Wed Sep 30 10:08:50 EDT 2009


     [ http://opensource.atlassian.com/projects/hibernate/browse/HHH-3000?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Sharath Reddy updated HHH-3000:
-------------------------------

    Attachment: HHH-3000-2nd.patch

Hi,

Here is my use-case:

I have an Entity with 1 or more properties of class PhoneNumber. 

By default, I would like to delegate to the Hibernate UserType PhoneNumberType to
persist and retrieve properties of this class. 

But if the property happens to refer to an Overseas (International) number, in this specific 
case I would like to delegate to OverseasPhoneNumberType instead. 

(Look at the class ContactDetails)



> 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
>         Attachments: HHH-3000-2nd.patch, HHH-3000.patch, HHH-3000.patch
>
>
> 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