-->
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: How does hibernate manage the order of parameter bindings?
PostPosted: Wed Jun 02, 2004 3:46 pm 
Beginner
Beginner

Joined: Mon Mar 08, 2004 6:09 pm
Posts: 20
I'm having a problem when trying to load an object.
This is the generated query:
Code:
Hibernate: select m4tfasesal0_.FEC_ALTA_EMPLEADO as FEC_ALTA1___, m4tfasesal0_.ID_SOCIEDAD as ID_SOCIE2___, m4tfasesal0_.ID_EMPLEADO as ID_EMPLE3___, m4tfasesal0_.FEC_ALTA_EMPLEADO as FEC_ALTA1_0_, m4tfasesal0_.ID_SOCIEDAD as ID_SOCIE2_0_, m4tfasesal0_.ID_EMPLEADO as ID_EMPLE3_0_, m4tfasesal0_.FEC_BAJA as FEC_BAJA0_, m4tfasesal0_.FEC_ANTIGUEDAD as FEC_ANTI5_0_, m4tfasesal0_.FEC_EXTRAS as FEC_EXTRAS0_, m4tfasesal0_.NUM_MATRICULA as NUM_MATR7_0_, m4tfasesal0_.NUM_PLURIEMPLEO as NUM_PLUR8_0_, m4tfasesal0_.COMENT_BAJA as COMENT_B9_0_, m4tfasesal0_.EXTENSION_TELEFONICA as EXTENSI10_0_, m4tfasesal0_.DIRECCION_MAIL as DIRECCI11_0_, m4tfasesal0_.FEC_ULT_ACTUALIZACION as FEC_ULT12_0_, m4tfasesal0_.COMENT as COMENT0_, m4tfasesal0_.ID_USUARIO as ID_USUARIO0_, m4tfasesal0_.ID_MOTIVO_BAJA as ID_MOTI15_0_, m4tfasesal0_.ID_ESTADO_NOMINA as ID_ESTA16_0_, m4tfasesal0_.A_TRABAJADOS_EMP_ANT as A_TRABA17_0_, m4tfasesal0_.TIPO_INP as TIPO_INP0_, m4tfasesal0_.ID_ESTADO_PLANTILLA as ID_ESTA19_0_, m4tfasesal0_.ID_HORARIO as ID_HORARIO0_, m4tfasesal0_.FEC_INI_HORARIO as FEC_INI21_0_, m4tfasesal0_.ID_VIG_HORARIO as ID_VIG_22_0_, m4tfasesal0_.ID_HORARIO_ALT as ID_HORA23_0_, m4tfasesal0_.AAA2 as AAA20_, m4tfasesal0_.NNP1 as NNP10_, m4tfasesal0_.AAEC as AAEC0_, m4tfasesal0_.AANI as AANI0_, m4tfasesal0_.AACP as AACP0_, m4tfasesal0_.FEC_PAGA_BAJ as FEC_PAG29_0_, m4tfasesal0_.FEC_PAGA_BAJA as FEC_PAG30_0_, m4tfasesal0_.AAAP as AAAP0_ from M4T_FASES_ALTA m4tfasesal0_ where m4tfasesal0_.ID_SOCIEDAD=? and m4tfasesal0_.ID_EMPLEADO=?


And the binding info is:
Code:
15:43:18 DEBUG type.StringType : binding '100-7' to parameter: 1
15:43:18 DEBUG type.StringType : binding '100-7' to parameter: 1
15:43:18 DEBUG type.StringType : binding '45' to parameter: 2
15:43:18 DEBUG type.StringType : binding '45' to parameter: 2


The problem is that the parameter 1 must be '45' and parameter 2 must be '100-7'

Is there any way to manually manage the order of binding??

Thank you very much!

PD: BTW, the hbm and java files was generated by middlegen.


Top
 Profile  
 
 Post subject:
PostPosted: Wed Jun 02, 2004 6:04 pm 
Beginner
Beginner

Joined: Mon Mar 08, 2004 6:09 pm
Posts: 20
SOLVED!
The binding order follows the order of the key properties in the hbm.xml file.

(May be a bug on middlegen??)


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.