April 27, 2006

Some more hibernate thingies

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 :)

- 4 comments by 2 or more people Not publicly viewable

  1. Phil Wilson

    No one will ever understand all of Hibernate completely, that's part of its magic :)

    05 May 2006, 10:45

  2. :)

    05 May 2006, 11:02

  3. Nick Howes

    We've just been having a terrible time of getting SiteImpl objects with null properties; should have remembered your blog entry sooner! Bloody Hibernate.

    21 Aug 2006, 12:04

  4. Deepak Kumar


    Visit: http://www.roseindia.net/struts/hibernate-spring/index.shtml

    This tutorial shows how to develop User Registration and Login Application using Spring, Hibernate and Spring technologies.

    Deepak Kumar

    19 Nov 2006, 16:31

Add a comment

You are not allowed to comment on this entry as it has restricted commenting permissions.

April 2006

Mo Tu We Th Fr Sa Su
Mar |  Today  | May
               1 2
3 4 5 6 7 8 9
10 11 12 13 14 15 16
17 18 19 20 21 22 23
24 25 26 27 28 29 30

Search this blog



Most recent comments

  • Interesting… While I'm not completely convinced in such microbenchmarks, I'm pretty sure that 1ms … by Alexander Snaps on this entry
  • Hello. I bought the book yesterday. I was trying to find the source code for chapter 11 and chapter … by Suleman on this entry
  • http://woosight.net/account/login?username=demo by live mashup demo on this entry
  • Thanks mate ….. This blog was really helpful. by Maaz Hurzuk on this entry
  • Ty. Not directly helpful for my problem, but pointed me in the right direction. You will also get th… by Mike E. on this entry

Blog archive

Not signed in
Sign in

Powered by BlogBuilder