Skip to content

SelectBuilder's .join(...).on(X).equals(Y) assumes X/Y are *not* Expressions.just(...) expressions #1009

Closed
@nt-gt

Description

@nt-gt

Hi,

Follow up on #995 with a separate issue. Attempting to use Expressions.just to work around #995, I learned that SelectBuilder ignores Expressions.just and "silently" generates invalid SQL. Consider the following code:

        Table transport = Table.create("transport");
        Table transportCall = Table.create("transport_call");
        Select finalSelect = Select.builder().select(transportCall.asterisk())
                .from(transportCall)
                .join(transport).on(Expressions.just("bar")).equals(Expressions.just("foo"))
                .build();

This generates the following invalid SQL:

SELECT transport_call.*
 FROM transport_call
 JOIN transport ON 

Notice how everything after ON-clause is omitted. (If you add a .where(...) then you will end up with JOIN transport ON WHERE ...)

Metadata

Metadata

Assignees

Labels

in: selectbuilderSelectBuilder stands for the complete API for creating SQL statements programmatically.type: enhancementA general enhancement

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions