-->
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: Easy mapping question
PostPosted: Fri Jan 07, 2011 5:29 am 
Beginner
Beginner

Joined: Fri Jul 20, 2007 10:38 am
Posts: 49
Hello,

I have a question about a hibernate mapping file that I'm making.
I have an object (A) in an object (B) to persist and I'd like to map a field in the object B to a field in the database.

So... ObjectA has a field, ObjectB. And ObjectB has a field, say, lastname.
I have the hbm file like this:
<property name="objectB.lastname" column="lastname" type="string" />
<property name="whatever" column="whatever" type="string" />
etc...

Unfortunately, I get a "PropertyNotFoundException" on objectB.lastname.

Any idea's?

thanks
Lino


Top
 Profile  
 
 Post subject: Re: Easy mapping question
PostPosted: Mon Jan 10, 2011 3:06 am 
Expert
Expert

Joined: Wed Mar 03, 2004 6:35 am
Posts: 1240
Location: Lund, Sweden
Seems like a typical case for what is called a component in Hibernate. See http://docs.jboss.org/hibernate/core/3. ... nents.html for some examples and more information.


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.