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 JOINclause
2. crossJoin(KRaw kRaw)
- kRaw: is a raw content which will be added in the
CROSS JOINclause.
Method hierarchy
The crossJoin method can be used right after the following methods or objects:
and the subsequent methods that can be called are:
from,innerJoin,leftJoin,rightJoin,fullJoin,crossJoin,where,groupBy,window,except,exceptAll,intersect,intersectAll,union,unionAll,orderBy,limit,offset,fetch,single,multiple
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