use of org.hibernate.sql.ast.tree.from.DerivedTableReference in project hibernate-orm by hibernate.
the class AbstractSqlAstTranslator method renderPrimaryTableReference.
protected boolean renderPrimaryTableReference(TableGroup tableGroup, LockMode lockMode) {
final TableReference tableReference = tableGroup.getPrimaryTableReference();
if (tableReference instanceof NamedTableReference) {
return renderNamedTableReference((NamedTableReference) tableReference, lockMode);
}
final DerivedTableReference derivedTableReference = (DerivedTableReference) tableReference;
if (derivedTableReference.isLateral()) {
if (getDialect().supportsLateral()) {
appendSql("lateral");
} else if (tableReference instanceof QueryPartTableReference) {
final QueryPartTableReference queryPartTableReference = (QueryPartTableReference) tableReference;
final QueryPart emulationQueryPart = stripToSelectClause(queryPartTableReference.getQueryPart());
final QueryPartTableReference emulationTableReference = new QueryPartTableReference(emulationQueryPart, tableReference.getIdentificationVariable(), queryPartTableReference.getColumnNames(), false, sessionFactory);
emulationTableReference.accept(this);
return false;
}
}
tableReference.accept(this);
return false;
}
use of org.hibernate.sql.ast.tree.from.DerivedTableReference in project hibernate-orm by hibernate.
the class SpannerSqlAstTranslator method renderPrimaryTableReference.
@Override
protected boolean renderPrimaryTableReference(TableGroup tableGroup, LockMode lockMode) {
final TableReference tableReference = tableGroup.getPrimaryTableReference();
if (tableReference instanceof NamedTableReference) {
return renderNamedTableReference((NamedTableReference) tableReference, lockMode);
}
final DerivedTableReference derivedTableReference = (DerivedTableReference) tableReference;
final boolean correlated = derivedTableReference.isLateral();
final boolean oldCorrelated = this.correlated;
if (correlated) {
this.correlated = true;
appendSql("unnest(array");
}
tableReference.accept(this);
if (correlated) {
this.correlated = oldCorrelated;
appendSql(CLOSE_PARENTHESIS);
}
return false;
}
Aggregations