New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

For HSQLDB the RelationalFunctionCall should wrap template with TABLE(...) in JOIN clauses #1061

Closed
piotrgwiazda opened this Issue Nov 28, 2014 · 1 comment

Comments

Projects
None yet
2 participants
@piotrgwiazda

Please note that for HSQLDB to join with function results the syntax is

SELECT * 
FROM TheTable t 
INNER JOIN TABLE(splitMe('1,2,3')) as ids
ON t.id = ids.value

The TABLE(...) syntax seems to be specific to HSQLDB.

Currently when using

RelationalFunctionCall.create(Integer.class, "splitMe", "1,2,3")

I'm getting

SELECT * 
FROM TheTable t 
INNER JOIN splitMe('1,2,3') as ids
ON t.id = ids.value

which fails in HSQLDB.
Of course above syntax works in MSSQL for example.

QueryDSL could wrap with TABLE(...) in JOIN statements or there should be an easy way to do that.

As a workaround I extend RelationalFunctionCall class and override getTemplate method to

return new TemplateFactory('\\').create("TABLE(" + super.getTemplate().toString() + ")");

which is ugly.

@timowest

This comment has been minimized.

Show comment
Hide comment
@timowest

timowest Nov 30, 2014

Member

Released in 3.6.0

Member

timowest commented Nov 30, 2014

Released in 3.6.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment