Hello again!
I�m experiencing again problems when doing criteria that uses alias.
This time I cannot get a Criteria to filter by an alias field
this is what I want:
SELECT actividad.ACTIVIDAD_ID, actividad.ACTIVIDAD, MATCH
(actividad.ACTIVIDAD) AGAINST ('futbol') AS score FROM actividad,
WHERE MATCH (actividad.ACTIVIDAD) AGAINST ('futbol') AND .score>=0.5
ORDER BY score DESC LIMIT 1
and here is my code:
String matchString = "MATCH ("+ActividadPeer.ACTIVIDAD+") AGAINST
futbol";
Criteria crit = new Criteria();
crit.add(ActividadPeer.ACTIVIDAD, (Object)matchString,
Criteria.CUSTOM);
crit.addAsColumn("score", matchString);
crit.add("score", 0.5, Criteria.GREATER_EQUAL);
crit.addDescendingOrderByColumn("score");
crit.setLimit(1);
I�ve already patched BasePeer so that I can sort by the "score" alias
field, by when doing the crit.add(...), you can notice that in the
generated SQL it inserts a dot in "AND .score>=0.5"
any workaround?
thank you very much
Tulsi
------------
Internet GRATIS es Yahoo! Conexi�n
4004-1010 desde Buenos Aires. Usuario: yahoo; contrase�a: yahoo
M�s ciudades: http://conexion.yahoo.com.ar
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]