-->
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.  [ 2 posts ] 
Author Message
 Post subject: Generated query SQL has duplicated column names
PostPosted: Wed Sep 26, 2007 11:05 am 
Beginner
Beginner

Joined: Mon Apr 02, 2007 8:08 am
Posts: 24
I'm doing a Criteria.list() query and it throws this exception:


Code:
INFO LongType:182 - could not read column value from result set: C2_12_; Fallo al convertir a representación interna
(internal representation conversion failure).

So I looked at the generated query, and C2_12_ appears twice!

Code:
/* Formatted on 2007/09/26 16:36 (Formatter Plus v4.8.7) */
SELECT this_.c_tarea_id AS c1_2_10_, this_.d_comentario AS d2_2_10_,
       this_.f_alta AS f3_2_10_, this_.f_hecho AS f4_2_10_,
       this_.f_plazo AS f5_2_10_, this_.c_mgestionado_modelo AS c7_2_10_,
...
       estado5_.d_nombre AS d4_0_1_, opciones6_.c_tarea_id AS c1_12_,
       [b]opcs1_.c_mgestionado_id AS c2_12_[/b], opcs1_.c_transicion_id AS c3_12_,
       opcs1_.c_mgestionado_id AS c1_3_2_, opcs1_.c_transicion_id AS c2_3_2_,

...
rolespermi10_.c_mgestionado_id AS c1_12_,
       [b]rolespermi10_.c_transicion_id AS c2_12_[/b], rol11_.c_rol AS c3_12_,
       rol11_.c_rol AS c1_26_5_, rol11_.d_rol AS d2_26_5_,
...
WHERE ups2_.c_usuario IN (?) AND this_.f_hecho IS NULL


When Hibernate extracts query results to objects it will fail because 'C2_12_' refers to different data types. How can I avoid this?

_________________
--
<a href="http://ideasse.blogspot.com/">Ideas + Software Engineering</a> (English)
<a href="http://iiso.blogspot.com/">Ideas + Ingeniería del Software</a> (Spanish)


Top
 Profile  
 
 Post subject:
PostPosted: Wed Sep 26, 2007 1:06 pm 
Beginner
Beginner

Joined: Mon Apr 02, 2007 8:08 am
Posts: 24
I've been struggling with this for hours and I find nothing at all. Is this a bug?

_________________
--
<a href="http://ideasse.blogspot.com/">Ideas + Software Engineering</a> (English)
<a href="http://iiso.blogspot.com/">Ideas + Ingeniería del Software</a> (Spanish)


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 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.