[hibernate-issues] [Hibernate-JIRA] Closed: (HHH-908) CLONE -NullPointerException when using BigInteger in a query

Steve Ebersole (JIRA) noreply at atlassian.com
Mon Mar 21 13:01:09 EDT 2011


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

Steve Ebersole closed HHH-908.
------------------------------


Closing stale resolved issues

> CLONE -NullPointerException when using BigInteger in a query
> ------------------------------------------------------------
>
>                 Key: HHH-908
>                 URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-908
>             Project: Hibernate Core
>          Issue Type: Bug
>          Components: core
>    Affects Versions: 3.0.5
>         Environment: Hibernate 3.0.5, Oracle 9.2.0.6
>            Reporter: Karl Wettin
>            Assignee: Gavin King
>            Priority: Minor
>             Fix For: 3.1 rc 1
>
>   Original Estimate: 0.5h
>  Remaining Estimate: 0.5h
>
> When I'm using a BigInteger in a query like
> Query query = session.createQuery("from Antrag as antrag where
> antrag.m_kreditId = (:kreditId)");
> query.setBigInteger("kreditId", new BigInteger(kreditId));
> I get the following Exception:
> java.lang.ClassCastException
>         at org.hibernate.type.BigDecimalType.set(BigDecimalType.java:28)
>         at org.hibernate.type.NullableType.nullSafeSet(NullableType.java:62)
>         at org.hibernate.type.NullableType.nullSafeSet(NullableType.java:44)
>         at org.hibernate.hql.classic.QueryTranslatorImpl.bindNamedParameters(QueryTranslatorImpl.java:877)
>         at org.hibernate.loader.Loader.prepareQueryStatement(Loader.java:1178)
>         at org.hibernate.loader.Loader.doQuery(Loader.java:390)
>         at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:218)
>         at org.hibernate.loader.Loader.doList(Loader.java:1593)
>         at org.hibernate.loader.Loader.list(Loader.java:1577)
>         at org.hibernate.hql.classic.QueryTranslatorImpl.list(QueryTranslatorImpl.java:890)
> I believe that this bug be caused by a typo in org.hibernate.hql.ast.ArithmeticNode:
> if ( x==Hibernate.BIG_DECIMAL || y==Hibernate.BIG_DECIMAL ) return Hibernate.BIG_DECIMAL;
> if ( x==Hibernate.BIG_INTEGER || y==Hibernate.BIG_INTEGER ) return Hibernate.BIG_DECIMAL;
> should actually be:
> if ( x==Hibernate.BIG_DECIMAL || y==Hibernate.BIG_DECIMAL ) return Hibernate.BIG_DECIMAL;
> if ( x==Hibernate.BIG_INTEGER || y==Hibernate.BIG_INTEGER ) return Hibernate.BIG_INTEGER;

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