|
From: <leg...@at...> - 2003-09-18 22:21:57
|
The following comment has been added to this issue:
Author: Andres A. Carrasquilla G=C3=B3mez
Created: Thu, 18 Sep 2003 5:20 PM
Body:
Mr. Gavin, My problem is exactly this but this problem it happens when the =
query is used whit an object that have an prymary key composed by two field=
s for example:
my object is customer and the prymary key is:
* ID
* ID_Type
---------------------------------------------------------------------
View the issue:
http://opensource.atlassian.com/projects/hibernate/secure/ViewIssue.jspa?=
key=3DHB-331
Here is an overview of the issue:
---------------------------------------------------------------------
Key: HB-331
Summary: Problem with create Query
Type: Bug
Status: Unassigned
Priority: Critical
Project: Hibernate2
Components:=20
core
Versions:
2.0.1
Assignee:=20
Reporter: Osvaldo Andres Cifuentes
Created: Fri, 12 Sep 2003 5:26 PM
Updated: Fri, 12 Sep 2003 5:26 PM
Environment: windows 2000 server spanish,xdoclet,jboss 3.2.1,jdk 1.4.2,orac=
le 9i Enterprise Edition
Description:
I'm using Session createQuery from Hibernate 2.0.1, the source look like th=
is:
List tipos =3D new ArrayList();
for(int lu=3D0;lu<ti.length;lu++)
=09tipos.add(ti[lu]);
Query q =3D sess.createQuery("from Cliente cliente where cliente.identifica=
cionPK.tipoIdentidad in (:tiposIdentidad) and cliente.identificacionPK.iden=
tidad like (:identidad)");
q.setParameterList("tiposIdentidad", tipos);
q.setString("identidad", i+"%");
List client=3Dq.list();
with this code i put the query on a list
for (int k=3D1;k<=3Dclient.size();k++){
=09Cliente cli=3D(Cliente)client.get(k);
=09log.debug(cli.getNombres());
}
=09=09=09
the Hibernate generated SQL source is OK. (I already tasted)
But when I look the client list, i can see that the first data is overwriti=
ng the others, The same
numbers of times than must have the query.
For example:
*The expected result:
id name
__________
1=09a
2=09b
3=09c
4=09d
5=09e
6=09f
7=09g
*The actual result:
id name
__________
1=09a
1=09a
1=09a
1=09a
1=09a
1=09a
1=09a
I hope any one can help me, I'll be very thankful
---------------------------------------------------------------------
JIRA INFORMATION:
This message is automatically generated by JIRA.
If you think it was sent incorrectly contact one of the administrators:
http://opensource.atlassian.com/projects/hibernate/secure/Administrators=
.jspa
If you want more information on JIRA, or have a bug to report see:
http://www.atlassian.com/software/jira
|