-->
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.  [ 6 posts ] 
Author Message
 Post subject: <list> of composite-elements
PostPosted: Mon Oct 25, 2004 2:23 pm 
Regular
Regular

Joined: Fri Sep 03, 2004 2:01 pm
Posts: 51
Hibernate version:2.1.6

If I have a collection (in this case a List) of components, that I have mapped as follows:

<list>
<key name="owning_class_id"/>

<composite-element class="foo">
<property name=p1/>
<property name=p2/>
<property name=p3/>
</composite-element>

</list>


Do I have to write (and register) a mapping file for class "foo"?
If so, what parameters do I use for the <id> mapping tag in foo.hbm.xml?

If not, why the heck am I getting a:
"No persister for: foo"
error message when I try and persist the owning class of the collection?

Nick


Top
 Profile  
 
 Post subject:
PostPosted: Wed Nov 03, 2004 9:48 am 
Newbie

Joined: Wed Nov 03, 2004 5:27 am
Posts: 5
I get this too ... any one shed some light on this????

_________________
PB~


Top
 Profile  
 
 Post subject:
PostPosted: Wed Nov 03, 2004 10:09 am 
Regular
Regular

Joined: Fri Sep 03, 2004 2:01 pm
Posts: 51
I gave up on the <list> mapping and mapped it as a many-to-one relationship.


Top
 Profile  
 
 Post subject:
PostPosted: Wed Nov 03, 2004 11:00 am 
Newbie

Joined: Wed Nov 03, 2004 5:27 am
Posts: 5
I am using the list and it works fine. I use the list with because I can specify an order for the items and also add additional information to the object via the composite tags.

_________________
PB~


Top
 Profile  
 
 Post subject:
PostPosted: Wed Nov 03, 2004 11:05 am 
Regular
Regular

Joined: Fri Sep 03, 2004 2:01 pm
Posts: 51
Im very happy for you. Thanks.


Top
 Profile  
 
 Post subject:
PostPosted: Wed Nov 03, 2004 11:17 am 
Newbie

Joined: Wed Nov 03, 2004 5:27 am
Posts: 5
Ta!-)

The reason I think you were getting a no persister exception is that you tried to 'save' or 'update' the composite object directly. When I tried this from the list it throw up the same exception.

Let me know if thats clear or if you can prove me wrong.

Post your code as well so we can all see what you're doing.

Paul

_________________
PB~


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