-->
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.  [ 3 posts ] 
Author Message
 Post subject: Hibernate not Setting Class Attributes
PostPosted: Fri Jun 20, 2008 2:22 pm 
Newbie

Joined: Fri Jun 20, 2008 2:04 pm
Posts: 3
I have code similar to the code in section 6.1.5 of Java Persistence with Hibernate. This is the case where an owning class (let's call this Class1) uses a Map to store many instances of a second class (let's call this Class2). The objects of both classes are being persisted as I can see the data in Oracle using an external program. I can fetch the Class1 objects and their attributes are set correctly.

But when I access each Class1 map and drill down to the contents of Class2 objects, the Class2 attributes are not set. The keys to the maps are set correctly. The size of the maps are set correctly. I read the SQL created by Hibernate and the SQL looks right. It would seem that Hibernate is working only to a point.

I've tried batch-size="10" and fetch="subselect". The SQL looks right, but the attributes in Class2 are not there.

Any help would be appreciated. Thanks.


Top
 Profile  
 
 Post subject:
PostPosted: Mon Jun 23, 2008 10:13 am 
Expert
Expert

Joined: Tue May 13, 2008 3:42 pm
Posts: 919
Location: Toronto & Ajax Ontario www.hibernatemadeeasy.com
Is it possible that the objects are being loaded in a lazy fashion, and what you are looking at is only proxies for the real objects that only get loaded when they are needed?

_________________
Cameron McKenzie - Author of "Hibernate Made Easy" and "What is WebSphere?"
http://www.TheBookOnHibernate.com Check out my 'easy to follow' Hibernate & JPA Tutorials


Top
 Profile  
 
 Post subject:
PostPosted: Tue Sep 09, 2008 3:25 pm 
Newbie

Joined: Fri Jun 20, 2008 2:04 pm
Posts: 3
Sorry for the extremely late response. I thought nobody had responded.

I fixed this problem a long time ago by the use of "formula" instead of "column" in the mapping files.


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 3 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.