salk31 / RedQueryBuilder

SQL Query Builder UI JavaScript component
http://redquerybuilder.appspot.com/
Eclipse Public License 1.0
96 stars 22 forks source link

Exception thrown for single-table wildcards #42

Closed scottbw closed 8 years ago

scottbw commented 9 years ago

Using the following input query:

SELECT "x0".* FROM "city" "x0" INNER JOIN "country" "x1" ON "x0"."country" = "x1"."code" WHERE ("x1"."countryname" = ?)

Results in:

Uncaught java.sql.SQLException: In SELECT "x0".* FROM "city" "x0" INNER JOIN "country" "x1" ON "x0"."country" = "x1"."code" WHERE ("x1"."countryname" = ?) at 13 wanted identifier

Similarly just using

SELECT "city".* FROM "city" INNER JOIN "country" "x0" ON "country" = "x0"."code" WHERE ("x0"."countryname" = ?)

Doesn't throw an exception, but also the query fields aren't correctly populated either.

Using

SELECT * FROM "city" INNER JOIN "country" "x0" ON "country" = "x0"."code" WHERE ("x0"."countryname" = ?)

Works exactly as expected, but obviously returns the columns from both joined tables, which isn't what I need in this context.

salk31 commented 9 years ago

Hmm. Currently no wildcard support at all. It is just that in some cases it ignores it and in others it produces an error. Am adding now.

scottbw commented 9 years ago

What I've done as a workaround for now is I modify the SQL to remove the wildcard before calling the RQG factory, and add it back in when the query change event is fired.

salk31 commented 9 years ago

OK. 0.8.0 should be out soon although it comes with lots of other baggage.