[hibernate-issues] [Hibernate-JIRA] Commented: (HHH-4467) hibernate should throw exception differentiating between null and transient

Paul Benedict (JIRA) noreply at atlassian.com
Wed Sep 30 10:45:50 EDT 2009


    [ http://opensource.atlassian.com/projects/hibernate/browse/HHH-4467?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=34085#action_34085 ] 

Paul Benedict commented on HHH-4467:
------------------------------------

I agree. It requires more work to track down what the real cause is. Was it null or transient? Good suggestion, Dean.

> hibernate should throw exception differentiating between null and transient
> ---------------------------------------------------------------------------
>
>                 Key: HHH-4467
>                 URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-4467
>             Project: Hibernate Core
>          Issue Type: Bug
>          Components: core
>    Affects Versions: 3.3.2
>            Reporter: Dean Hiller
>
> some teams report this as a usabiliy bug, others a feature...you can move to a feature if you like.  
> Hibernate should change the exception message 
> "not-null property references a null or transient value: net.voicelog.entities.scripts.CompareExpression.expression" 
> to be
> 1. not-null property is referencing a null value
> AND
> 2. not-null property is referencing a transient value
> Just do a quick if(property != null) throw 1 else throw 2
> I have ran into many users being confused and users should not have to go check if the property is null, hibernate can do a quick check instead and throw 2 different exceptions to make our lives just a little bit easier.  I personally have been tripped up by this a few times myself assuming it was transient or null on accident whereas if it just spit out the right exception to begin with, that would rock for such an easy change!
> thanks,
> Dean

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