[hibernate-issues] [Hibernate-JIRA] Commented: (HSEARCH-149) Default FieldBridge for enums passing wrong class to EnumBridge constructor

Emmanuel Bernard (JIRA) noreply at atlassian.com
Wed Jan 16 08:24:56 EST 2008


    [ http://opensource.atlassian.com/projects/hibernate/browse/HSEARCH-149?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_29336 ] 

Emmanuel Bernard commented on HSEARCH-149:
------------------------------------------

Thanks

> Default FieldBridge for enums passing wrong class to EnumBridge constructor
> ---------------------------------------------------------------------------
>
>                 Key: HSEARCH-149
>                 URL: http://opensource.atlassian.com/projects/hibernate/browse/HSEARCH-149
>             Project: Hibernate Search
>          Issue Type: Bug
>          Components: mapping
>    Affects Versions: 3.0.0.GA
>            Reporter: Marcio Silva
>             Fix For: 3.0.1
>
>
> Default FieldBridge for enums introduced in HSEARCH-2 added the following block to BridgeFactory:
> 119	+	                        if ( bridge == null && returnType.isEnum() ) {
> 120	+	                                bridge = new TwoWayString2FieldBridgeAdaptor(
> 121	+	                                                new EnumBridge( (Class<? extends Enum>) returnType.getClass() )
> 122	+	                                );
> 123	+	                        }
> This results in errors unmarshalling as the class passed to the EnumBridge constructor will be the XClass implementation class for the returnType variable.
> The code probably needs to load the class by name from returnType, or cast returnType to a JavaXClass to utilize the toClass() method instead of getClass()

-- 
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