Hibernate version:
3.2.2ga, Hibernate Annotations
I'm calling session.load(Category.class, id), but it appears that I'm being given a fully initialized entity, although I only want the proxy as to avoid the database hit. In what circumstance does session.load() behave like this? Here's the debug output:
17:19:20,797 - nsactionProtectionWrapper - DEBUG - allowing proxied method [load] to proceed to real session
17:19:20,803 - .DefaultLoadEventListener - DEBUG - loading entity: [test.Category#4]
17:19:20,810 - .DefaultLoadEventListener - DEBUG - attempting to resolve: [test.Category#4]
17:19:20,816 - .DefaultLoadEventListener - DEBUG - object not resolved in any cache: [test.Category#4]
17:19:20,823 - y.AbstractEntityPersister - DEBUG - Fetching entity: [test.Category#4]
17:19:20,830 - g.hibernate.loader.Loader - DEBUG - loading entity: [test.Category#4]
17:19:20,838 - nate.jdbc.AbstractBatcher - DEBUG - about to open PreparedStatement (open PreparedStatements: 0, globally: 0)
* query is executed here *
I even tried placing the
@org.hibernate.annotations.Proxy(lazy = true)
annotation on the top of my Category class, but I'm still getting the same results.
Any ideas? Thanks.
|