Skip to content

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

@piotrgwiazda

Description

@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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions