-->
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: Inheritance in different mapping files. It's possible
PostPosted: Wed Dec 20, 2006 9:08 am 
Newbie

Joined: Fri Nov 17, 2006 9:16 am
Posts: 6
I'm trying to map a inheritance using different hbm files.

I have a file name Orden.hbm.xml

<hibernate-mapping>
<class name="Orden" table="ORDEN" lazy="false">
<id name="id" column="ID" type="java.lang.Long" unsaved-value="null">
<generator class="increment"></generator>
</id>
<discriminator column="TIPO" type="string" />
<component name="audit" class="es.rbcdexia.argenval.Audit">
<property name="user" type="java.lang.String" column="USER_NAME" />
<property name="timestamp" type="custom-timestamp" column="TIMESTAMP" />
<property name="process" type="java.lang.String" column="PROCESS" />
</component>
</class>
</hibernate-mapping>

I want to use other mapping file named Transferencia.hbm.xml (not valid)

<subclass lazy="false" name="Transferencia" extends="Orden" discriminator-value="TRANSFERENCIA_COMUN">

<join table="TRANSFERENCIA">
<id name="id" column="ID" type="java.lang.Long" unsaved-value="null">
<generator class="increment"></generator>
</id>
<property name="concepto" column="CONCEPTO" type="java.lang.String"/>

<property name="fecha" type="java.sql.Date" column="FECHA" />
</join>
</subclass>

hibernate.cfg.xml:

<mapping resource="Orden.hbm.xml"/>
<mapping resource="Transferencia.hbm.xml"/>

But this aproach doesn't work.

It's posible to map a inheritance in diferents mapping files. If it's possible how can I do it?

Thanks

Note: I can do it in one mapping file, but I have a complex inheritance with other classes and mapping files and I would like to divide in several files


Top
 Profile  
 
 Post subject:
PostPosted: Thu Dec 21, 2006 4:20 am 
Newbie

Joined: Fri Nov 17, 2006 9:16 am
Posts: 6
I solved it

Thanks


Top
 Profile  
 
 Post subject:
PostPosted: Mon Mar 05, 2007 5:49 pm 
Newbie

Joined: Tue Jan 16, 2007 3:43 pm
Posts: 4
Location: Lima PERU
Could you explain how you do resolve this issue?

thanks.


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.