[hibernate-issues] [Hibernate-JIRA] Created: (EJB-346) Hibernate is not JPA compliant when using multiple EAGER OneToMany relationships

Doug Bateman (JIRA) noreply at atlassian.com
Mon Mar 24 17:01:33 EDT 2008


Hibernate is not JPA compliant when using multiple EAGER OneToMany relationships
--------------------------------------------------------------------------------

                 Key: EJB-346
                 URL: http://opensource.atlassian.com/projects/hibernate/browse/EJB-346
             Project: Hibernate Entity Manager
          Issue Type: Bug
    Affects Versions: 3.3.0.ga
            Reporter: Doug Bateman


JPA compatibility is broken when mapping a JPA object with multiple eagerly loaded one-to-many mappings.  Specifically, Hibernate's behavior is as follows:

+ If a JPA persistent object has multiple fields with "@OneToMany(fetch=FetchType.EAGER)" Hibernate throws "HibernateException: cannot simultaneously fetch multiple bags"
+ This issue is fixed only when the user adds the Hibernate specific annotation @Fetch(FetchMode.SUBSELECT)

To be JPA compliant, Hibernate must be able to map any JPA compliant object, without requiring additional Hibernate specific annotations.  JPA expressly allows multiple one-to-many mappings (with the implied assumption that subselects are used by default in this case).

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