[hibernate-issues] [Hibernate-JIRA] Closed: (HHH-2250) Create an appropriate error message if Query.setEntity is passed a NULL value
Steve Ebersole (JIRA)
noreply at atlassian.com
Tue Nov 21 19:07:04 EST 2006
[ http://opensource.atlassian.com/projects/hibernate/browse/HHH-2250?page=all ]
Steve Ebersole closed HHH-2250:
-------------------------------
Resolution: Fixed
trunk / 3.2
> Create an appropriate error message if Query.setEntity is passed a NULL value
> -----------------------------------------------------------------------------
>
> Key: HHH-2250
> URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-2250
> Project: Hibernate3
> Type: Improvement
> Components: query-hql
> Versions: 3.2.0.ga, 3.2.1
> Reporter: Jonas Maurus
> Assignee: Steve Ebersole
> Priority: Trivial
> Fix For: 3.2.2
>
>
> setEntity(xyz, null) ends in a NPE in SessionImpl.guessEntityName(). This previously came up as HHH-675. I just spent hours tracking this NPE in our application, then upgrading Hibernate because I thought it might be a Hibernate bug :-/. The offending line read:
> .setEntity("customer", user.getCustomer())
> "user" being an entity managed by Hibernate with user.customer being a nullable ManyToOne-relation. The current mode of "crash-and-burn" really looks like a Hibernate bug and not like expected behavior. I'd like to recommend that setEntity() should explicitly check for null-values.
--
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