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.  [ 4 posts ] 
Author Message
 Post subject: Child element is not loaded
PostPosted: Thu Aug 23, 2007 12:06 pm 
Beginner
Beginner

Joined: Thu Apr 19, 2007 9:52 am
Posts: 27
Hi Guys,

I have Worker object which has child object State. State is a reference table (hence mutable="false" in the mapping file).

Now when I want to create Worker, I am doing something like this

Worker worker = new Worker()

State state = new State();
state.setId(1);

worker.setState(state );

and then

das.saveOrUpdate(worker);

But when I print any value of State other than Id, I am getting null.

e.g. worker.getState().getAbbr() ---> this gives null

Does anyone know the reason. Am I wrong somewhere.

I know that I can always do findBy on State first and then set it. But I want to avoid extra findBys.

Can someone let me what should I do to fix this.

_________________
Regards,
Mahen
http://www.discoverabout.net
http://funnfacts.discoverabout.net


Top
 Profile  
 
 Post subject:
PostPosted: Fri Aug 24, 2007 9:27 pm 
Beginner
Beginner

Joined: Thu Apr 19, 2007 9:52 am
Posts: 27
Can any one reply to this.

_________________
Regards,
Mahen
http://www.discoverabout.net
http://funnfacts.discoverabout.net


Top
 Profile  
 
 Post subject:
PostPosted: Tue Aug 28, 2007 10:32 pm 
Beginner
Beginner

Joined: Thu Apr 19, 2007 9:52 am
Posts: 27
Sticky

_________________
Regards,
Mahen
http://www.discoverabout.net
http://funnfacts.discoverabout.net


Top
 Profile  
 
 Post subject:
PostPosted: Wed Aug 29, 2007 12:00 am 
Beginner
Beginner

Joined: Fri May 18, 2007 10:28 am
Posts: 48
Location: Madison, WI
Post your hbm file.

_________________
Please rate if it helped


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