-->
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.  [ 3 posts ] 
Author Message
 Post subject: any mapping generates unexpected foreign key constraint
PostPosted: Mon Jan 05, 2004 5:04 pm 
JBoss jBPM Developer
JBoss jBPM Developer

Joined: Thu Aug 28, 2003 11:56 am
Posts: 30
Location: Belgium
if (reader=="Gavin") {
While starting jBpm 2.0 developments I finally find some time to implement the tip you gave me in the Amsterdam-restaurant :-)
}


4 subtypes of ActionableImpl all have this mapping :

<set name="actions" lazy="true" cascade="all">
<key column="ACTIONABLE" />
<one-to-many class="org.jbpm.model.definition.impl.ActionImpl" />
</set>

ActionImpl maps the inverse end of this relation with 'any'

<any name="actionable" id-type="long">
<column name="ACTIONABLE_TYPE"/>
<column name="ACTIONABLE"/>
</any>

The schema-export now generates a foreign-key-constraint from table Actionable to one of the 4 subtypes.

Am I missing something ? Can this be turned off ?

Thanks for your time !

Regards, Tom Baeyens.


Top
 Profile  
 
 Post subject:
PostPosted: Mon Jan 05, 2004 6:29 pm 
Hibernate Team
Hibernate Team

Joined: Sun Sep 14, 2003 3:54 am
Posts: 7256
Location: Paris, France
Hum, I'm not familiar whith those any stuffs
Have a look at http://forum.hibernate.org/viewtopic.php?t=925949&postdays=0&postorder=asc&highlight=manytoany&start=15

_________________
Emmanuel


Top
 Profile  
 
 Post subject: I found the solution
PostPosted: Thu Jan 08, 2004 5:15 pm 
JBoss jBPM Developer
JBoss jBPM Developer

Joined: Thu Aug 28, 2003 11:56 am
Posts: 30
Location: Belgium
I added inverse="true" to *all* set mappings like this

<set name="actions" lazy="true" cascade="all" inverse="true">
<key column="ACTIONABLE" />
<one-to-many class="org.jbpm.model.definition.impl.ActionImpl" />
</set>

Regards, Tom.


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