-->
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: Fallo al convertir a representación interna - SOLUTION
PostPosted: Mon Oct 24, 2011 6:00 pm 
Newbie

Joined: Mon Oct 24, 2011 5:46 pm
Posts: 3
HI, i have a problem with Hibernate and oracle 11. Here's mi hbm code :

catSucursal

<hibernate-mapping>
<class name="bean.CatSucursal" table="CAT_SUCURSAL" schema="POS">
<composite-id name="id" class="bean.CatSucursalId">
<key-property name="idCompania" type="string">
<column name="ID_COMPANIA" length="12" />
</key-property>
<key-property name="idSucursal" type="int">
<column name="ID_SUCURSAL" precision="9"/>
</key-property>
</composite-id>
..... etc
<hibernate-mapping>

catEmpleado


<hibernate-mapping>
<class name="bean.CatEmpleado" schema="POS" table="CAT_EMPLEADO">
<id name="idEmpleado" type="int">
<column name="ID_EMPLEADO" precision="9" scale="0"/>
<generator class="assigned"/>
</id>
<many-to-one class="bean.CatSucursal" fetch="select" name="catSucursal" >
<column name="ID_SUCURSAL" precision="9"/>
<column length="12" name="ID_COMPANIA"/>
</many-to-one>
....etc
<hibernate-mapping>

the problem is, when i get a Empleado via findByExample, send me a Exception :

Fallo al convertir a representación interna

I change the driver, (ojdbc6) by new version, but nothing happens, after 4 hours, it occurred to me change the tags of CatEmpleado.hbm of catSucursal :

BEFORE
<many-to-one class="mx.com.pos.bean.CatSucursal" fetch="select" name="catSucursal" >
<column name="ID_SUCURSAL" precision="9"/>
<column length="12" name="ID_COMPANIA"/>
</many-to-one>

AFTER

<many-to-one class="mx.com.pos.bean.CatSucursal" fetch="select" name="catSucursal" >
<column length="12" name="ID_COMPANIA"/>
<column name="ID_SUCURSAL" precision="9"/>
</many-to-one>

Same as the PK of catsucursal, and worked correctly, :( WHY ???

The position of the tags matter ???

After All, this resolved my problem :D


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.