use of com.servoy.j2db.query.QueryJoin in project servoy-client by Servoy.
the class QBJoins method add.
public QBJoin add(IQueryBuilder subqueryBuilder, int joinType, String alias) {
if (!DataSourceUtils.isSameServer(getRoot().getDataSource(), subqueryBuilder.getDataSource())) {
throw new RuntimeException("Cannot add derived table join from different server: " + getRoot().getDataSource() + " vs " + subqueryBuilder.getDataSource());
}
QuerySelect subquery = ((QBSelect) subqueryBuilder).getQuery();
QBJoin join = getJoin(alias);
if (join == null) {
join = addJoin(new QueryJoin(alias, parent.getQueryTable(), new DerivedTable(subquery, alias), new AndCondition(), joinType, true), subqueryBuilder.getDataSource(), alias);
}
return join;
}
Aggregations