-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 
Author Message
 Post subject: QueryException in "select new Bla(a.b.name)" when
PostPosted: Sat Feb 25, 2006 4:19 am 
Newbie

Joined: Sat Dec 25, 2004 4:33 am
Posts: 2
Hibernate version:
3.0.5

Full stack trace of any exception that occurs:
[java] org.springframework.orm.hibernate3.HibernateQueryException: could not instantiate: ...Bla; nested exception is org.hibernate.QueryException: could not instantiate: ...Bla
[java] org.hibernate.QueryException: could not instantiate: ...Bla
[java] at org.hibernate.hql.HolderInstantiator.instantiate(HolderInstantiator.java:45)
[java] at org.hibernate.loader.hql.QueryLoader.getResultList(QueryLoader.java:376)
...

Happens in this query:
select new com....Bla(a.id, ap.accountCode) From AccAccountValue as a left join fetch a.accAccount as ap

AccAccountValue has a many-to-one association to AccAccountValue as accAccount (private com...AccAccountValue accAccount;). For some records this association is null and leads to the above exception.

For a row with a null association, HolderInstantiator has a "Object[] row" with only 1 item, instead of 2 ("select new com....Bla(a.id, ap.accountCode)").

Am I doing something wrong? Shouldn't hibernate set fields of a null association to null? Or is this simply not possible currently? Should I file an enhancement request?

Ara.


Top
 Profile  
 
 Post subject:
PostPosted: Sat Feb 25, 2006 8:36 am 
Newbie

Joined: Sat Feb 25, 2006 8:08 am
Posts: 2
Hi, could you post your mapping file, your class and the query code sample, because using left join work fine for me.


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.