[hibernate-issues] [Hibernate-JIRA] Commented: (HHH-4743) Bug in BooleanLiteralNode with CustomType

Jean-Francois Larouche (JIRA) noreply at atlassian.com
Mon Jan 4 12:27:29 EST 2010


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

Jean-Francois Larouche commented on HHH-4743:
---------------------------------------------

Yeah, maybe i exagerated. I just really dont like modifying hibernate. In this case we have no choice.

> Bug in BooleanLiteralNode with CustomType
> -----------------------------------------
>
>                 Key: HHH-4743
>                 URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-4743
>             Project: Hibernate Core
>          Issue Type: Bug
>          Components: core
>    Affects Versions: 3.3.2
>            Reporter: Jean-Francois Larouche
>            Assignee: Steve Ebersole
>            Priority: Minor
>             Fix For: 3.3.x, 3.5
>
>   Original Estimate: 5 minutes
>  Remaining Estimate: 5 minutes
>
> We override a lot of our Hibernate types to support Dual databases.
> Ive come upon a bug with boolean Primitives types wich lead me to this part of code in BooleanLiteralNode.
> Why casting the type in this method to BooleanType instead of the interface LiteralType? Its used internally and for the objectToSQLString() method anyway, for getRenderText().
> {code}
> 	public String getRenderText(SessionFactoryImplementor sessionFactory) {
> 		try {
> 			return getTypeInternal().objectToSQLString( getValue(), sessionFactory.getDialect() );
> 		}
> 		catch( Throwable t ) {
> 			throw new QueryException( "Unable to render boolean literal value", t );
> 		}
> 	}
> {code}
> This lead to a hidden ClassCastException because our boolean custom type inherits AbstractType and implements the interfaces.
> {code}
> 	public BooleanType getTypeInternal() {
> 		return ( BooleanType ) getDataType();
> 	}
> {code}
> Looks like some more people loose time with this.
> Here is a link to a wich is directly in relation:
> https://forum.hibernate.org/viewtopic.php?p=2362554

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