-->
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.  [ 4 posts ] 
Author Message
 Post subject: java.lang.NullPointerException in hibernate
PostPosted: Wed Aug 11, 2010 5:32 pm 
Newbie

Joined: Wed Aug 11, 2010 5:27 pm
Posts: 5
Hibernate seems to be keeping the details behind my problem a secret, not sure how to uncover some helpful debugging info.
Anyone know how to get more info than this out of hibernate (IMHO it should provide this by default) ?


java.lang.NullPointerException
org.hibernate.persister.entity.AbstractPropertyMapping.toColumns(AbstractPropertyMapping.java:65)
org.hibernate.persister.entity.BasicEntityPropertyMapping.toColumns(BasicEntityPropertyMapping.java:31)
org.hibernate.persister.entity.AbstractEntityPersister.toColumns(AbstractEntityPersister.java:1354)
org.hibernate.loader.criteria.CriteriaQueryTranslator.getColumns(CriteriaQueryTranslator.java:434)
org.hibernate.loader.criteria.CriteriaQueryTranslator.getColumnsUsingProjection(CriteriaQueryTranslator.java:394)
org.hibernate.criterion.SimpleExpression.toSqlString(SimpleExpression.java:45)
org.hibernate.loader.criteria.CriteriaQueryTranslator.getWhereCondition(CriteriaQueryTranslator.java:334)
org.hibernate.loader.criteria.CriteriaJoinWalker.(CriteriaJoinWalker.java:90)
org.hibernate.loader.criteria.CriteriaJoinWalker.(CriteriaJoinWalker.java:59)
org.hibernate.loader.criteria.CriteriaLoader.(CriteriaLoader.java:67)
org.hibernate.impl.SessionImpl.list(SessionImpl.java:1550)
org.hibernate.impl.CriteriaImpl.list(CriteriaImpl.java:283)


Top
 Profile  
 
 Post subject: Re: java.lang.NullPointerException in hibernate
PostPosted: Thu Aug 12, 2010 12:33 am 
Regular
Regular

Joined: Fri Aug 06, 2010 1:49 am
Posts: 102
Location: shynate26@gmail.com
Hello warren@wgoldman.com,

This seems the object is null in the criteria . To be clearer trying to set the value in the query from an property of the foreign entity.

ex : class Parent{
private ForeignKey f;
}

class ForeignKey {
private int count;
}

("from Parent p where f.count=:value").setString("value",f.getCount());

The column might be null-able. So try checking not null when deriving the values.

Code:
try {

Criteria ...query

}catch(NullPointerException e)
{
e.printStackTrace();
}

_________________

Cheers!
Shynate
mailto:shynate26@gmail.com
www.CSSCORP.com


Top
 Profile  
 
 Post subject: Re: java.lang.NullPointerException in hibernate
PostPosted: Thu Aug 12, 2010 9:57 am 
Newbie

Joined: Wed Aug 11, 2010 5:27 pm
Posts: 5
Thanks for the reply, I am really looking more for suggestions on how to get hibernate to display more useful information to be able to better understand the issue.


Top
 Profile  
 
 Post subject: Re: java.lang.NullPointerException in hibernate
PostPosted: Thu Aug 12, 2010 1:27 pm 
Hibernate Team
Hibernate Team

Joined: Fri Oct 05, 2007 4:47 pm
Posts: 2536
Location: Third rock from the Sun
warren, please post your questions in the right forum: https://forum.hibernate.org/viewforum.php?f=1

_________________
Sanne
http://in.relation.to/


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 4 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.