[hibernate-issues] [Hibernate-JIRA] Commented: (ANN-672) Missing @Entity silently fails

Hontvári József (JIRA) noreply at atlassian.com
Mon Oct 29 19:07:38 EDT 2007


    [ http://opensource.atlassian.com/projects/hibernate/browse/ANN-672?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_28628 ] 

Hontvári József commented on ANN-672:
-------------------------------------

Not annotation specific, but related: while a HQL query fails runtime because of the unknown entity, a Criteria query doesn't. It simply returns an empty list. It can be argued that this is the correct behaviour ("I tried all day, still I wasn't able to find a single java.awt.SystemTray in that database"), but at least it would worth a more honest warning message too ("I couldn't eve try to find it, because I have no idea how a java.awt.SystemTray can be placed into a database").

> Missing @Entity silently fails
> ------------------------------
>
>                 Key: ANN-672
>                 URL: http://opensource.atlassian.com/projects/hibernate/browse/ANN-672
>             Project: Hibernate Annotations
>          Issue Type: Bug
>    Affects Versions: 3.3.0.ga
>         Environment: 3.2.5
>            Reporter: Hontvári József
>            Priority: Minor
>
> Hibernate config.xml contains a class in a <mapping class=... element. The class has no @Entity annotation by mistake. There is no exception thrown and I haven't find any log entry even on trace level, other then the usual
> o.h.c.AnnotationConfiguration null<-org.dom4j.tree.DefaultAttribute at 1f4cf6f [Attribute: name class value "...
> which appears for all (valid) classes too. The problem is manifested only runtime, when Hibernate complains that the entity is undefined.

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