-->
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.  [ 5 posts ] 
Author Message
 Post subject: collection of primitives
PostPosted: Wed Oct 22, 2003 12:08 pm 
Newbie

Joined: Wed Oct 22, 2003 12:01 pm
Posts: 6
Hi, I've been looking all over for documentation, but can't seem to find anything.
I'm trying to map a collection with primitives (Floats), but can't seem to work out how to. I've tried a set, adding the one-to-many with class java.lang.Float, but Float obviously hasn't got any tags and is therefore not mapped. The association fails.

Is there a solition that is so obvious that I've missed it, or do I need to create a workaround solution?


Top
 Profile  
 
 Post subject:
PostPosted: Wed Oct 22, 2003 12:49 pm 
Hibernate Team
Hibernate Team

Joined: Sun Sep 14, 2003 3:54 am
Posts: 7256
Location: Paris, France
Use collection of values (section 5.3 of hib ref guide)

_________________
Emmanuel


Top
 Profile  
 
 Post subject:
PostPosted: Thu Oct 23, 2003 3:57 am 
Newbie

Joined: Wed Oct 22, 2003 12:01 pm
Posts: 6
blindingly obvious after all - thank you!


Top
 Profile  
 
 Post subject:
PostPosted: Thu Oct 23, 2003 7:02 am 
Newbie

Joined: Wed Oct 22, 2003 12:01 pm
Posts: 6
The collection of values only seems to support many-to-many, is there no option for one-to-many relationships?


Top
 Profile  
 
 Post subject:
PostPosted: Thu Oct 23, 2003 8:21 am 
Hibernate Team
Hibernate Team

Joined: Sun Sep 14, 2003 3:54 am
Posts: 7256
Location: Paris, France
Quote:
The collection of values only seems to support many-to-many

No

Code:
<bag name="sizes" table="SIZES" order-by="SIZE ASC">
    <key column="OWNER"/>
    <element column="SIZE" type="integer"/>
</bag>


is kind of a one-to-many relationship.

The section talks about collection of values AND collection of entities (which are naturally mapped as many-to-many).
Your are mismatching

_________________
Emmanuel


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