-->
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.  [ 1 post ] 
Author Message
 Post subject: Issue with a custom bridge table
PostPosted: Thu Jan 11, 2007 11:22 am 
Newbie

Joined: Thu Jan 11, 2007 10:44 am
Posts: 1
Hi folks,

I've seen on this tutorial:http://www.hibernate.org/hib_docs/v3/reference/en/html/tutorial.html#tutorial-associations
how to use a bridge table in hibernate mapping.

S it looks like that:
Code:
<class name="events.Person" table="PERSON">
    <id name="id" column="PERSON_ID">
        <generator class="native"/>
    </id>
    <property name="age"/>
    <property name="firstname"/>
    <property name="lastname"/>

    <set name="events" table="PERSON_EVENT">
        <key column="PERSON_ID"/>
        <many-to-many column="EVENT_ID" class="events.Event"/>
    </set>
</class>


with the following schema:

EVENT <-> PERSON_EVENT <-> PERSON
*EVENT_ID *EVENT_ID *PERSON_ID
*EVENT_NAME *PERSON_ID *PERSON_NAME

where PERSON_EVENT is the bridge table between EVENT and PERSON.


My issue is that I've got the following schema :

EVENT_ID <-> PERSON_EVENT <-> PERSON
*ID *EVENT_ID *PERSON_ID
*EVENT_NAME *PERSON_ID *PERSON_NAME

So how can I configure my mapping to use this bridge table ?

Thanks for your help,

Sven


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

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.