ignite-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Andrey Mashenkov <amashen...@gridgain.com>
Subject SQL: Table aliases not supported for SqlQuery
Date Wed, 30 Nov 2016 14:55:51 GMT
Hi Igniters,

H2Indexing.generateQuery() generates wrong sql query. It is used in
SqlQuery class for queries like this:
     new SqlQuery(Person.class. "from Person p where p.salary > ? and
p.salary <= ?")
This query produce next sql query string:
    "SELECT "".Person._key, ""Person"._val FROM Person p where p.salary > ?
and p.salary <= ?"
We should use table alias instead on table name in "SELECT" query part. It
looks like we can't automatically determine correct alias, as we can have
multiple aliases for one table or even subquery in "FROM" part.

The solution is to provide table alias SqlQuery object to generate correct
query. SqlQuery is ignite public class.

Is it ok, if I add new constructor in SqlQuery class?

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message