I'm getting this exception anytime I try to load a table that has an associated transient table. The strange thing is I only see this if I load a single entry, if I load all I don't get the error.
getHibernateTemplate().get(entityClass, id) FAILS
getHibernateTemplate().find(String.format("from %s", entityClass.getName() WORKS (it loads all entries but they are all correct and complete..
The class I'm querying is...
@Entity public class MetaDatabaseGroup extends DatabaseGroup { @ManyToMany(cascade = CascadeType.ALL, fetch = FetchType.EAGER) @JoinTable(name = "DATABASE_GROUP_MAP") private Set<DatabaseGroup> databaseGroups; ...
The transient class is...
@Entity public class StaticDatabaseGroup extends DatabaseGroup { @ElementCollection( fetch = FetchType.EAGER ) @CollectionTable( name = "DB_GROUP_ELEMENT_MAP", joinColumns = @JoinColumn(name="DATABASE_GROUP_ID")) @javax.persistence.Column( name="ElEMENT") private Set<Long> externalIds; ...
So why might I be getting the lazy init error? Its not clear.
-Robert
|