Skip to main content

Cross Join

Definition

The crossJoin method allows you to add the CROSS JOIN clause to the query.

Available methods

1. crossJoin(KTable kTable)

  • kTable: is the table which will be added to CROSS JOIN clause

2. crossJoin(KRaw kRaw)

  • kRaw: is a raw content which will be added in the CROSS JOIN clause.

Method hierarchy

The crossJoin method can be used right after the following methods or objects:

and the subsequent methods that can be called are:

Example: KTable

Java code:

k
.select(APP_USER.EMAIL, ROLE.NAME)
.from(APP_USER)
.crossJoin(ROLE)
.multiple();

SQL generated:

SELECT au.email, ro.name
FROM app_user au
CROSS JOIN role ro

Parameters:

  • None

Example: KRaw

Java code:

k
.select(APP_USER.EMAIL, raw("ro.name"))
.from(APP_USER)
.crossJoin(raw("role ro"))
.multiple();

SQL generated:

SELECT au.email, ro.name
FROM app_user au
CROSS JOIN role ro

Parameters:

  • None