I have recently changed an object to have a @OneToMany
mapping to another object, with the FetchType.LAZY
. But when I try to load a list of these objects using a @NamedNativeQuery
, which calls an Oracle function, it throws a java.sql.SQLException: Invalid column name
for this new OneToMany mapping. But being marked as LAZY
, it shouldn't try to populate this variable should it?
In theory I could change the function to return an empty value for this column (basically a hack), but I would have to roll that out to everywhere that uses a @NamedNativeQuery
to populate one of these objects.
This seems like a bug to me. Is there a workaround, something I'm missing or possibly fixed in a later version of Hibernate?
I'm using hibernate-core 3.3.2.GA, hibernate-entitymanager 3.4.0.GA, hibernate-annotations 3.4.0.GA and hibernate-commons-annotations 3.3.0.ga.