All entries for Thursday 27 April 2006
April 27, 2006
Writing about web page http://hibernate.org
Some more hibernate observations, although I haven't got time to prove via unit tests:
– if you specify an interface="" then the laziness is ignored; it is always lazy (not documented AFAICS)
– if you have final methods/class then regardless of access (field|property) you will get null values. This is because CGLIB cannot subclass/override final classes/methods (well known), but why doesn't hibernate throw an exception?
– if you specify non-lazy for a class, then the class is fully formed, even if it is using CGLIB with final classes/methods irrespective of access (property|field). I suspect in this case CGLIB isn't involved and hibernate is simply instantiating your implementation class and updating the fields via reflection.
– if you specify an outer join in the mapping, laziness will be ignored; it won't be lazy. This of course is intuitive; join makes no sense if it is not lazy.
When I have more time I will unit test all these combinations, but this is a reminder to me do so.
Will I ever understand hibernate completely :)