-->
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: key column=?
PostPosted: Wed Feb 16, 2005 5:49 pm 
Regular
Regular

Joined: Sat May 29, 2004 2:16 pm
Posts: 81
Hibernate version:
2.1.6
Mapping documents:
Code:
<?xml version="1.0"?>
<!DOCTYPE hibernate-mapping PUBLIC
   "-//Hibernate/Hibernate Mapping DTD//EN"
   "http://hibernate.sourceforge.net/hibernate-mapping-2.0.dtd">

<hibernate-mapping package="logica">

   <class name="Pessoa"
      table="pessoa" discriminator-value="p">

      <id name="id" column="id">
         <generator class="native" />
      </id>

      <discriminator
         column="pessoa_tipo"
         type="string" />

      <property name="nome" />
      <property name="outroNome" />
      <property name="apelido" />
      <property name="telefone" />
      <property name="telemovel" />
      
      <subclass
         name="Tecnica"
         discriminator-value="t">
         
      <set name="actosMedicos" inverse="true" cascade="save-update">
         <key column="tecnica_id" />
         <one-to-many class="ActoMedico" />
      </set>
      </subclass>

   </class>

</hibernate-mapping>


i'm reading HiA and implementing a table per class hierarchy, like pag 99.
One of the subclasses has a Set - so here's my Q.

When i write:

Code:
      <set name="actosMedicos" inverse="true" cascade="save-update">
         <key column="tecnica_id" />
         <one-to-many class="ActoMedico" />
      </set>

does my key column should point to top class id or i can just create one like i did?
thanks in advance


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.