-->
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: Custom collection and one-to-many
PostPosted: Fri Jan 30, 2004 6:00 am 
Newbie

Joined: Tue Jan 27, 2004 3:26 pm
Posts: 18
Hello,

I wonder if is there possible to use custom collection (instead of hibernate's built-in: set, map, etc.) in one-to-many association. As far as i understand I should use CompositeUserType - but I have no idea how to incorporate my new type into mapping file and one-to-many relation. For exaple suppose we have custom collection

public class FooVector {

// vector of Foos - it does not
// inherite after java Vector.

}

And we have Bar entity,

public class Bar {
private FooVect foos;
}

how can I express one-to-many relation in this case? Member foos is not
a regular property, so i can't use <property> (even if could) so what I can use with my custom FooVectorType?

Any hints?

Artur


Top
 Profile  
 
 Post subject:
PostPosted: Fri Jan 30, 2004 1:31 pm 
Hibernate Team
Hibernate Team

Joined: Sun Sep 14, 2003 3:54 am
Posts: 7256
Location: Paris, France
CompositeUserType is used to map a single type into several columns. Not to create your own collection.

_________________
Emmanuel


Top
 Profile  
 
 Post subject:
PostPosted: Fri Jan 30, 2004 7:01 pm 
Hibernate Team
Hibernate Team

Joined: Tue Sep 09, 2003 2:10 pm
Posts: 3246
Location: Passau, Germany
I don't know an easy way to do this. Probably something like creating your own CollectionPersister, but I am mostly certain this won't work too.


Top
 Profile  
 
 Post subject:
PostPosted: Sat Jan 31, 2004 3:47 am 
Beginner
Beginner

Joined: Tue Nov 11, 2003 4:49 am
Posts: 47
Location: Florence, Italy
We use CERN Colt library for out optmization algo, 'cause Collections are tooooo slow. To solve persistency and mapping problem, we copy from them on get and save on them on set.
This solved our problems, but be careful with lazy mappings.
Ciao.


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.