-->
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.  [ 8 posts ] 
Author Message
 Post subject: Custom bag collection
PostPosted: Mon Jan 02, 2006 6:49 am 
Newbie

Joined: Mon Jan 02, 2006 6:42 am
Posts: 4
Hello.

I need to extend a bag collection in order to override the add and remove methods, however I don't understand how to do this. I found references on the collection-type attribute, over complicated references to implements a number of hibernate interfaces, but nothing seems to work, or at least nowhere I have found a clear explanation of what to do to make them working.

Do someone address me to a simple and clear example on how to extend the bag collection ? I just need to override the add and remove methods (and add a couple of methods) in order to send notifications when an element is added or removed from the collection.

[b]Hibernate version: 3.05[/b]

Thanks


Top
 Profile  
 
 Post subject:
PostPosted: Tue Jan 03, 2006 2:53 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
search the unittests for MyList

_________________
Max
Don't forget to rate


Top
 Profile  
 
 Post subject:
PostPosted: Tue Jan 03, 2006 9:07 am 
Newbie

Joined: Mon Jan 02, 2006 6:42 am
Posts: 4
max wrote:
search the unittests for MyList


Would you please be more specific as to where "MyList" is ? It seems that I can't find it in the test folder.


Top
 Profile  
 
 Post subject:
PostPosted: Tue Jan 03, 2006 10:26 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
well then my search function is better than yours ;)

org.hibernate.test.usercollection.MyList

/max

_________________
Max
Don't forget to rate


Top
 Profile  
 
 Post subject:
PostPosted: Tue Jan 03, 2006 2:17 pm 
Newbie

Joined: Mon Jan 02, 2006 6:42 am
Posts: 4
max wrote:
well then my search function is better than yours ;)

org.hibernate.test.usercollection.MyList

/max


Maybe.
Or maybe you are looking at something else: there isn't a usercollection directory under test/org/hibernate/test, at least not the in hibernate tar.gz file. Where are you looking at ?


Top
 Profile  
 
 Post subject:
PostPosted: Tue Jan 03, 2006 2:45 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
hibernate 3.1

_________________
Max
Don't forget to rate


Top
 Profile  
 
 Post subject:
PostPosted: Tue Jan 03, 2006 3:06 pm 
Newbie

Joined: Mon Jan 02, 2006 6:42 am
Posts: 4
max wrote:
hibernate 3.1


This means that there is no way to do the same with 3.0.5 ?
I'm having a problem with 3.1 that duplicates the entries in some collections (while 3.0.5 works perfectly with the same exact configuration), so I'll stick with 3.0.5 for now.


Top
 Profile  
 
 Post subject:
PostPosted: Tue Jan 03, 2006 3:58 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
you are most likely using multiple fetch which in 3.0.5 will not be obeyed.
In 3.1 multiple fetches are possible with the duplicaiton side effect - read the migration guide.

And no - 3.1 just have more unittests than 3.0.5

_________________
Max
Don't forget to rate


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