Issue Type: Bug Bug
Affects Versions: 4.3.0.Beta3
Assignee: Unassigned
Components: entity-manager
Created: 01/Jun/13 8:25 AM
Description:

IMHO Chapter 3.7.4.2 of the JPA spec says that @NamedEntityGraph can be used instead of fetch joins. For instance:
@Entity
@Table(name = "kunde")
@DiscriminatorColumn(name = "art", length = 1)
@NamedQueries(

{...})
@NamedEntityGraphs({ @NamedEntityGraph(name = "bestellungen", attributeNodes = @NamedAttributeNode("bestellungen"))})
public abstract class AbstractKunde implements Serializable, Cloneable {...}

// 2 concrete classes are derived from the abstract class
@PersistenceContext
private EntityManager em;
...
List<AbstractKunde> kunden =
em.createNamedQuery("...", AbstractKunde.class)
.setParameter("...", "...")
.setHint("javax.persistence.loadgraph", "bestellungen");
.getResultList();

When I try to access the attribute "bestellungen" after committing the transaction, then I get a LazyInitializationException.

Project: Hibernate ORM
Priority: Major Major
Reporter: Juergen Zimmermann
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira