In data 15 dicembre 2008 alle ore 20:45:07, Nathan Maves
<nathan.ma...@gmail.com> ha scritto:
you have yet to give us your complete SQL for this select. That might
really help us to help you :)
Ok, thanks. Actually I trimmed the query because many parts are
irrelevant, but this was a mistake because playing with the query I found
a lot of interesting things. First of all, sorry to everyone for this
thread becoming a sql/postgres related topic, I don't think anymore that
this is an iBatis problem.
My environment:
Tomcat 6.0.18
PostgreSQL 8.3 and postgresql-8.3-604.jdbc4.jar as driver (but tested also
with jdbc3 driver)
iBatis 2.3.4.726 (just upgraded from 2.3.0.677)
Spring 2.5.6
The pojo:
http://pastebin.com/d7f1ba086
The sqlmap:
http://pastebin.com/m42d91c56 (note the order by clause)
The SQL:
http://pastebin.com/d7569333d
So, I have a service and a list of tags associated to it. If the user
search for 'gra' I want to look for all the services that has 'gra' in
their short_description, and all the services that has an associated tag
that has 'gra' in the name.
Here the result I get:
List<Service> list = dao.getServicesBySearchQuery("gra");
System.out.println(list);
[[serv...@3020ad id = 4, userId = [null], shortDescription = 'Creazione
layout grafico', longDescription = [null], creation = Mon Dec 15 20:56:40
CET 2008, price = 20.00, state = 1, effort = 1, effortType = 3, tagList =
list[graphic, layout, website], username = [null]]]
List<Service> list = dao.getServicesBySearchQuery("graph");
System.out.println(list);
[[serv...@3020ad id = 4, userId = [null], shortDescription = 'Creazione
layout grafico', longDescription = [null], creation = Mon Dec 15 20:56:40
CET 2008, price = 20.00, state = 1, effort = 1, effortType = 3, tagList =
list[website, layout, graphic], username = [null]]]
As you can see, the tagList is ordered in different ways.
Thank you very much for your help.
Corrado