-->
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.  [ 2 posts ] 
Author Message
 Post subject: Associations with a non persistent entity
PostPosted: Wed Aug 18, 2010 7:01 am 
Newbie

Joined: Tue Sep 09, 2008 1:10 pm
Posts: 4
Hello everybody!
I have a problem with a dynamic model. I have a table with no associated class. This table A is associated with a table B (related to a persistent class) by means of an one-to-many association and with a one-to-one association. I have been looking the Dynamic models section of the page http://docs.jboss.org/hibernate/core/3. ... asses.html, but since no mapping files for association entities are presented (only the non pèrsistent entity), I do not know how to deal with the mapping file of the two entities. I have tried with different options of many-to-one, set, bag, but since there is no A class, class B does not have an attribute associated its association with A. That is the reason why I always get the "there is not field---in entity B"

Please, could anybody tell me how to do that or give my any clue?

Thank you very much


Top
 Profile  
 
 Post subject: Re: Associations with a non persistent entity
PostPosted: Sat Aug 21, 2010 5:17 am 
Newbie

Joined: Tue Sep 09, 2008 1:10 pm
Posts: 4
The point is that as it is presented in http://docs.jboss.org/hibernate/core/3. ... asses.html with the example:


<class entity-name="Customer">

<id name="id"
type="long"
column="ID">
<generator class="sequence"/>
</id>

<property name="name"
column="NAME"
type="string"/>

<property name="address"
column="ADDRESS"
type="string"/>

<many-to-one name="organization"
column="ORGANIZATION_ID"
class="Organization"/>

<bag name="orders"
inverse="true"
lazy="false"
cascade="all">
<key column="CUSTOMER_ID"/>
<one-to-many class="Order"/>
</bag>

</class>

would the class Organization have an attribute called organization? As I understand, with the "<bag" block, the Customer will have to have an orders attribute but ther is no Customar class?
Please, could somebody tell my if I am wrong?

Thank you very much in advance


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