HIBERNATE JBoss.org
 |  Register  | 
     
News 
About 
   Feature List 
   Road Map 
Documentation 
   Related Projects 
   External Documentation 
Download 
Forum & Mailinglists 
Support & Training 
JIRA Issue Tracking
Wiki Community Area


Hibernate Public Training Courses


Get Hibernate in Action eBook!


JavaWorld 2003 Finalist


Jolt Award 2004 Winner
      
Documentation > Community Area > UserType for Polymorphic Associations > Comments > Re: Polymorphic association within collection property


Comment
Prev. thread 
 Next thread
 
Prev. posting 
 Next posting
Subject: Re: Polymorphic association within collection property 05 Aug 2004, 11:18
From: christian_falkowski Replies: 0, Views: 40
 
On 28 Jul 2004 13:23, smaugg wrote:

>I like to use the above method within a set property:

> <code>
> <set name="excludedEntites" table="excluded_entities" lazy="true">
>   <key column="node_id"/>
>   <any ...>
> </set>
> </code>

>Unfortunately the <any>-tag is not allowed within <collection>-tags.

>Is there a way to implement this in another way?

The "any"-association is allowed within the <collection>-tags,
look at the DTD, e.g., for <set>

<!ELEMENT set (
  meta*,
 (cache|jcs-cache)?,
 key, 
 (element|one-to-many|many-to-many|composite-element|many-to-any)
)>

with the tag <many-to-any> a "ony-to-many"-association inclusive
a discriminator-column for the "any"-reference is created.
The <many-to-any>-tag works similiar to the <any>-tag for "to-one"-
references.
 

Thread:
 Polymorphic association within collection property 
 smaugg   28 Jul 2004, 13:23 
 Re: Polymorphic association within collection p... 
 christian_falkowski   05 Aug 2004, 11:18 
      

coWiki