[hibernate-dev] CGLIBLazyInitializer and proxy= configuration

Benjamin Lerman hibernate-dev at ambre.net
Mon Jan 28 04:39:38 EST 2008

 Hi all,

 The line 118 of CGLIBLazyInitializer is:
e.setSuperclass( interfaces.length == 1 ? persistentClass : null );

 That means that, when a proxy="foo" is added on the hibernate
configuration, the proxy generated do not anymore extends the concrete

 Is there a particular reason for this ?

 The reason I ask, is because in particular circumstances, I can have:
 session.createQuery("FROM Foo").list()
 returns a List of objects that are not of class Foo.

 I change the line in question with:
and I can use my proxy as well as the expected base class in my code,
so I'd like to know why this is not the default comportment and what is
the disadvantage to always have the proxy extends the base class.

	Benjamin LERMAN

More information about the hibernate-dev mailing list