-->
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: Composite Element Collection
PostPosted: Wed Feb 22, 2006 5:58 pm 
Beginner
Beginner

Joined: Fri May 13, 2005 11:48 am
Posts: 32
I have a composite collection mapped to its parent object. In my code I pull out the parent object. Read some data off of it and then I use that data to make a new object which I add to the session. When I go to commit the transaction I get the error:
Code:
Unknown entity class: Haochanpin.KeyTerm


Does anyone have any idea of what I am doing wrong here? Does KeyTerm need its own mapping file?

dru

Mapping
Code:
<class name="Haochanpin.Page,Haochanpin" table="Page">
        <id name="Id" type="Guid" column="Id" unsaved-value="00000000-0000-0000-0000-000000000000">
            <generator class="guid" />
        </id>

        <property name="CompanyName" type="String" />


        <set name="Terms"
             table="Page_KeyTerm"
             inverse="true"
             cascade="all-delete-orphan"
             access="NHibernate.Generics.GenericAccessor,NHibernate.Generics">
            <key column="PageId" />
            <composite-element class="Haochanpin.KeyTerm,Haochanpin">
                <property name="Id" type="Guid" />

                <property name="Chinese" type="String" />
                <property name="English" type="String" />
            </composite-element>
        </set>
    </class>


Top
 Profile  
 
 Post subject:
PostPosted: Mon Oct 23, 2006 1:05 pm 
Newbie

Joined: Mon Oct 23, 2006 1:00 pm
Posts: 2
I have the same problem that you have.
Have you found a solution to it?

Can you please help me? I'm desperate!
Mario


Top
 Profile  
 
 Post subject:
PostPosted: Mon Oct 23, 2006 1:33 pm 
Beginner
Beginner

Joined: Fri May 13, 2005 11:48 am
Posts: 32
Yes I did find a solution. What was it...

AH!

I think it was the inverse="true" bit. Let me know if that helps.


Top
 Profile  
 
 Post subject:
PostPosted: Mon Oct 23, 2006 1:59 pm 
Newbie

Joined: Mon Oct 23, 2006 1:00 pm
Posts: 2
Unfortunately that isn't the problem with my code. :-(

Thanks for your help anyway. If you remember anything more that can be the problem, please let me know. Thank you again.
Mario


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.