[hibernate-issues] [Hibernate-JIRA] Commented: (HBX-893) "Can't create session factory" if any @NamedQuery annotations on entities have errors in them

Joseph Marques (JIRA) noreply at atlassian.com
Thu Feb 22 16:19:31 EST 2007


    [ http://opensource.atlassian.com/projects/hibernate/browse/HBX-893?page=comments#action_26225 ] 

Joseph Marques commented on HBX-893:
------------------------------------

Just to make sure we're on the same page...I received the "Can't create session factory" when the JPQL in one of my @NamedQuery annotation was incorrect.  In THIS case, I think you should be able to gracefully mark the class because the @NamedQuery doesn't affect the mapping - it simplies relies on it.

If there is a larger problem, such as errors in the mappings like you mentioned, then that's certainly bound to cause more issues in general.  However, perhaps you can still try to recover from this.  You can start scanning from the problematic entity and find the connected component it is a part of.  A connected component is essentially anything that that entity can traverse to by following its valid mappings.  because not all domain models are a single connected component.

Then, you can "disable" all of these connected entities - in other words, don't even try to load them in the session factory proper.  However, you could still show them in the session factory portion of the Hibernate Configuration view as "greyed out" entities.  This lets the user know which connected component has an error in it, and you can STILL try to color the entity that started the mapping cascade failure red.

> "Can't create session factory" if any @NamedQuery annotations on entities have errors in them
> ---------------------------------------------------------------------------------------------
>
>          Key: HBX-893
>          URL: http://opensource.atlassian.com/projects/hibernate/browse/HBX-893
>      Project: Hibernate Tools
>         Type: Bug

>     Versions: 3.2beta8
>     Reporter: Joseph Marques

>
>
> This seems to be a pretty big restriction - especially if you want to be able to cater to those that try to adopt Hibernate Tools part of the way through development, where some annotations may already have errors in them.
> Instead, it should be much more user-friendly to expand the session factory anyway, but just not load those entities - perhaps even marking them with a little red 'X' to indicate that the user needs to fix something in them.

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