This week's book giveaway is in the Cloud/Virtualization forum.
We're giving away four copies of Building Blockchain Apps and have Michael Yuan on-line!
See this thread for details.
Win a copy of Building Blockchain Apps this week in the Cloud/Virtualization forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
  • Campbell Ritchie
  • Paul Clapham
  • Liutauras Vilda
  • Knute Snortum
  • Bear Bibeault
  • Devaka Cooray
  • Jeanne Boyarsky
  • Junilu Lacar
Saloon Keepers:
  • Ron McLeod
  • Stephan van Hulst
  • Tim Moores
  • Carey Brown
  • salvin francis
  • Tim Holloway
  • Piet Souris
  • Frits Walraven

Hibernate lazy property fetching

Posts: 11
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello all -

I have an object/relational mapping defined using hibernate 3.0. The table contains a binary column that I would like to set as a "lazy property".

When listing records from the table, binary data is downloaded for each record returned in the query resulting in a huge performance hit. Setting the mapping element with the attribute lazy="true" does not accomplish the intented "lazy" load.

<class name="com.dana.sealing.itchecklist.TaskFile" table="attachments">
<id name="id" type="integer" column="id">
<generator class="identity"/>

<many-to-one name="parent" column="history_id" not-null="true"/>
<property name="filename" type="string" not-null="true" column="filename" />
<property name="contentType" type="string" not-null="false" column="content_type" />
<property name="content" type="binary" not-null="false" column="content" lazy="true"/>



The documentation states this is possible, however, I have not been able to successfully implement this. Has anyone been able to get this to work and if so, can you provide the details of how to accomplish this?

Best Regards,
R. Alcazar
Posts: 18
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
try this .may be it works out

see the following url:
[ December 06, 2005: Message edited by: Mohd. Yakub ]
Posts: 10336
Hibernate Eclipse IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Have you done the necessary bytecode instrumentation of your persistant class? Lazy property fetching won't work with a class that is compiled normally.
[ December 05, 2005: Message edited by: Paul Sturrock ]
You can't expect to wield supreme executive power just because
Java file APIs (DOC, XLS, PDF, and many more)
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!