[hibernate-issues] [Hibernate-JIRA] Updated: (HHH-3128) NullPointerException while building SessionFactory when using native sql query for loading many-to-many mapped collections

Anthony Patricio (JIRA) noreply at atlassian.com
Wed Apr 15 12:41:20 EDT 2009


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

Anthony Patricio updated HHH-3128:
----------------------------------

    Attachment: HHH-2745.zip

based on 3.2.4 SP 1 test suite.
run NativeSQLQueriesTest.testAddJoinForManyToMany

> NullPointerException while building SessionFactory when using native sql query for loading many-to-many mapped collections
> --------------------------------------------------------------------------------------------------------------------------
>
>                 Key: HHH-3128
>                 URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-3128
>             Project: Hibernate Core
>          Issue Type: Bug
>    Affects Versions: 3.2.5, 3.2.6
>         Environment: Hibernate 3.2.6
>            Reporter: Juergen Denzel
>         Attachments: HHH-2745.zip, src.zip
>
>
> Hi,
> I am trying to load a many-to-many mapped collection using a sql query like this:
>    <sql-query name="loadItems">
>         <load-collection alias="item" role="test.Test.items"/>
>         select {item.*} from Items item where item.id = :id
>     </sql-query>
> This always fails due to a NullPointerException:
> java.lang.NullPointerException
> 	at org.hibernate.loader.custom.sql.SQLQueryParser.resolveProperties(SQLQueryParser.java:182)
> 	at org.hibernate.loader.custom.sql.SQLQueryParser.resolveCollectionProperties(SQLQueryParser.java:135)
> 	at org.hibernate.loader.custom.sql.SQLQueryParser.substituteBrackets(SQLQueryParser.java:98)
> 	at org.hibernate.loader.custom.sql.SQLQueryParser.process(SQLQueryParser.java:51)
> 	at org.hibernate.loader.custom.sql.SQLCustomQuery.<init>(SQLCustomQuery.java:110)
> 	at org.hibernate.engine.query.NativeSQLQueryPlan.<init>(NativeSQLQueryPlan.java:43)
> 	at org.hibernate.engine.query.QueryPlanCache.getNativeSQLQueryPlan(QueryPlanCache.java:114)
> 	at org.hibernate.impl.SessionFactoryImpl.checkNamedQueries(SessionFactoryImpl.java:446)
> 	at org.hibernate.impl.SessionFactoryImpl.<init>(SessionFactoryImpl.java:352)
> 	at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1300)
> 	at test.HibernateTest.testSessionFactory(HibernateTest.java:18)
> I provided a very simple TestCase + Mappings to illustrate the problem. The exception does not occur for one-to-many mappings.
> Just for your information, we need this functionality in order to deal with DB2 problems we have.
> I ran this TestCase against 3.2.5 and 3.2.6 and both failed.
> Thanks.
> Juergen Denzel

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