These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 
Author Message
 Post subject: lazy property
PostPosted: Tue Apr 12, 2005 7:46 am 
Newbie

Joined: Tue Apr 12, 2005 7:11 am
Posts: 3
Read the rules before posting!
http://www.hibernate.org/ForumMailingli ... AskForHelp

Hibernate version:
3.0
Mapping documents:
<class name="Function" table="Function" >
<id name="id" type="int" column="id">
<generator class="sequence">
<param name="sequence">Function_Id_seq</param>
</generator>
</id>
<property name="type" type="string" >
<column name="funType" length="20" not-null="true" />
</property>
<property name="stub" type="text" lazy="true">
<column name="stub" />
</property>
</class>
Code between sessionFactory.openSession() and session.close():
Query q = session.createQuery("from Function");
FunctionHB function=(PDFunctionHB)q.setMaxResults(1).uniqueResult();
System.out.println(Hibernate.isPropertyInitializedfunction,"stub"));

The result is true (but should be false). Where is my mistake? Can anybody help me?

Column "stub" is clob. I not want always read stub field(this field is big). I want read clob from DB only when function.getStub() was called. I am right that I us lazy property or not?


Top
 Profile  
 
 Post subject:
PostPosted: Tue Apr 12, 2005 9:17 am 
CGLIB Developer
CGLIB Developer

Joined: Thu Aug 28, 2003 1:44 pm
Posts: 1217
Location: Vilnius, Lithuania
You need to run "instrument" task to transform class file.
http://www.hibernate.org/hib_docs/v3/re ... properties


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.