On Wed, 29 Jan 2003 00:06:38 -0500, "Viktor Szathmary"
<[EMAIL PROTECTED]> said:
> hi,
> 
> to annoy people with more trivial questions: is it possible to have a
> bidirectional one-to-many relationship between a component and a
> firstclass object? i'm getting a MappingException: "An association refers
> to an unmapped class" (which is not entirely true, since it is in fact
> mapped as a component of another class).

i also considered mapping this as a nested component list inside the
component, but for some reason i'm still getting MappingException: "No
persister for: net.sf.flock.hibernate.Feed".

here's the mapping file (with some irrelevant fields removed):

<hibernate-mapping>
        <class name="net.sf.flock.hibernate.Subscription" table="subscription">
                <id name="id" unsaved-value="null" length="32">
                        <generator class="vm.hex"/>
                </id>

                <one-to-one name="feed" class="net.sf.flock.hibernate.Feed" 
cascade="delete" constrained="false"/>

                <component name="feed" class="net.sf.flock.hibernate.Feed">
                        <parent name="subscription" 
class="net.sf.flock.hibernate.Subscription"/>
                        <bag role="items" readonly="true" cascade="all">
                                <key name="id" type="string">
                                        <generator class="vm.hex"/>
                                </key>
                                <composite-element class="net.sf.flock.hibernate.Item">
                                        <!-- parent name="origin" 
class="net.sf.flock.hibernate.Feed" column="feed_id"/ -->
                                        <property name="title"/>
                                        <property name="link" 
type="net.sf.flock.hibernate.URLType"/>
                                        <property name="description"/>
                                        <property name="creationTime"/>
                                </composite-element>
                        </bag>
                </component>
         </class>

</hibernate-mapping>

-- 
http://fastmail.fm - Accessible with your email software
                      or over the web


-------------------------------------------------------
This SF.NET email is sponsored by:
SourceForge Enterprise Edition + IBM + LinuxWorld = Something 2 See!
http://www.vasoftware.com
_______________________________________________
hibernate-devel mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/hibernate-devel

Reply via email to