-->
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: trying to map two primary keys on a table
PostPosted: Tue Jun 09, 2009 12:05 pm 
Newbie

Joined: Tue Jun 09, 2009 11:29 am
Posts: 1
hello, i´m quite new to hibernating and i need help..
i have a quite simple database that i´m not sure how to map a table.
here is my database diagram
Image
the device features table that i´m not sure how to map it...
can you guys help me?

this is what i came up with, ut i´m pretty sure i´m wrong.
Code:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE hibernate-mapping
    PUBLIC "-//Hibernate/Hibernate Mapping DTD//EN"
    "http://hibernate.sourceforge.net/hibernate-mapping-2.0.dtd">
<hibernate-mapping >
    <joined-subclass name="DeviceFeatures" extends="Device">
        <property name="featureValue"/>
        <key column="Device_idDevice" not-null="true"/>
     <one-to-many class="Device"/>

    </joined-subclass>
    <joined-subclass name="DeviceFeatures" extends="Feature">
        <key column="Feature_idFeature" not-null="ture"/>
        <many-to-one class="Feature"/>
    </joined-subclass>
</hibernate-mapping>


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:
cron
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.