Search in sources :

Example 1 with BooleanExpressionPredicate

use of org.hibernate.sql.ast.tree.predicate.BooleanExpressionPredicate in project hibernate-orm by hibernate.

the class TimesTenSqlAstTranslator method renderTableGroupJoin.

@Override
protected void renderTableGroupJoin(TableGroupJoin tableGroupJoin, List<TableGroupJoin> tableGroupJoinCollector) {
    if (tableGroupJoin.getJoinType() == SqlAstJoinType.CROSS) {
        appendSql(", ");
    } else {
        appendSql(WHITESPACE);
        appendSql(tableGroupJoin.getJoinType().getText());
        appendSql("join ");
    }
    final Predicate predicate;
    if (tableGroupJoin.getPredicate() == null) {
        if (tableGroupJoin.getJoinType() == SqlAstJoinType.CROSS) {
            predicate = null;
        } else {
            predicate = new BooleanExpressionPredicate(new QueryLiteral<>(true, getBooleanType()));
        }
    } else {
        predicate = tableGroupJoin.getPredicate();
    }
    if (predicate != null && !predicate.isEmpty()) {
        renderTableGroup(tableGroupJoin.getJoinedGroup(), predicate, tableGroupJoinCollector);
    } else {
        renderTableGroup(tableGroupJoin.getJoinedGroup(), null, tableGroupJoinCollector);
    }
}
Also used : QueryLiteral(org.hibernate.sql.ast.tree.expression.QueryLiteral) BooleanExpressionPredicate(org.hibernate.sql.ast.tree.predicate.BooleanExpressionPredicate) Predicate(org.hibernate.sql.ast.tree.predicate.Predicate) BooleanExpressionPredicate(org.hibernate.sql.ast.tree.predicate.BooleanExpressionPredicate)

Example 2 with BooleanExpressionPredicate

use of org.hibernate.sql.ast.tree.predicate.BooleanExpressionPredicate in project hibernate-orm by hibernate.

the class SybaseASESqlAstTranslator method renderTableGroupJoin.

@Override
protected void renderTableGroupJoin(TableGroupJoin tableGroupJoin, List<TableGroupJoin> tableGroupJoinCollector) {
    if (tableGroupJoin.getJoinType() == SqlAstJoinType.CROSS) {
        appendSql(", ");
    } else {
        appendSql(WHITESPACE);
        appendSql(tableGroupJoin.getJoinType().getText());
        appendSql("join ");
    }
    final Predicate predicate;
    if (tableGroupJoin.getPredicate() == null) {
        if (tableGroupJoin.getJoinType() == SqlAstJoinType.CROSS) {
            predicate = null;
        } else {
            predicate = new BooleanExpressionPredicate(new QueryLiteral<>(true, getBooleanType()));
        }
    } else {
        predicate = tableGroupJoin.getPredicate();
    }
    if (predicate != null && !predicate.isEmpty()) {
        renderTableGroup(tableGroupJoin.getJoinedGroup(), predicate, tableGroupJoinCollector);
    } else {
        renderTableGroup(tableGroupJoin.getJoinedGroup(), null, tableGroupJoinCollector);
    }
}
Also used : QueryLiteral(org.hibernate.sql.ast.tree.expression.QueryLiteral) BooleanExpressionPredicate(org.hibernate.sql.ast.tree.predicate.BooleanExpressionPredicate) Predicate(org.hibernate.sql.ast.tree.predicate.Predicate) BooleanExpressionPredicate(org.hibernate.sql.ast.tree.predicate.BooleanExpressionPredicate)

Example 3 with BooleanExpressionPredicate

use of org.hibernate.sql.ast.tree.predicate.BooleanExpressionPredicate in project hibernate-orm by hibernate.

the class AbstractSqlAstTranslator method renderTableGroupJoin.

protected void renderTableGroupJoin(TableGroupJoin tableGroupJoin, List<TableGroupJoin> tableGroupJoinCollector) {
    appendSql(WHITESPACE);
    appendSql(tableGroupJoin.getJoinType().getText());
    appendSql("join ");
    final Predicate predicate;
    if (tableGroupJoin.getPredicate() == null) {
        if (tableGroupJoin.getJoinType() == SqlAstJoinType.CROSS) {
            predicate = null;
        } else {
            predicate = new BooleanExpressionPredicate(new QueryLiteral<>(true, getBooleanType()));
        }
    } else {
        predicate = tableGroupJoin.getPredicate();
    }
    if (predicate != null && !predicate.isEmpty()) {
        renderTableGroup(tableGroupJoin.getJoinedGroup(), predicate, tableGroupJoinCollector);
    } else {
        renderTableGroup(tableGroupJoin.getJoinedGroup(), null, tableGroupJoinCollector);
    }
}
Also used : ConvertedQueryLiteral(org.hibernate.sql.ast.tree.expression.ConvertedQueryLiteral) QueryLiteral(org.hibernate.sql.ast.tree.expression.QueryLiteral) BooleanExpressionPredicate(org.hibernate.sql.ast.tree.predicate.BooleanExpressionPredicate) SqlFragmentPredicate(org.hibernate.persister.internal.SqlFragmentPredicate) InSubQueryPredicate(org.hibernate.sql.ast.tree.predicate.InSubQueryPredicate) SelfRenderingPredicate(org.hibernate.sql.ast.tree.predicate.SelfRenderingPredicate) FilterPredicate(org.hibernate.sql.ast.tree.predicate.FilterPredicate) NegatedPredicate(org.hibernate.sql.ast.tree.predicate.NegatedPredicate) LikePredicate(org.hibernate.sql.ast.tree.predicate.LikePredicate) ComparisonPredicate(org.hibernate.sql.ast.tree.predicate.ComparisonPredicate) BetweenPredicate(org.hibernate.sql.ast.tree.predicate.BetweenPredicate) NullnessPredicate(org.hibernate.sql.ast.tree.predicate.NullnessPredicate) GroupedPredicate(org.hibernate.sql.ast.tree.predicate.GroupedPredicate) BooleanExpressionPredicate(org.hibernate.sql.ast.tree.predicate.BooleanExpressionPredicate) ExistsPredicate(org.hibernate.sql.ast.tree.predicate.ExistsPredicate) InListPredicate(org.hibernate.sql.ast.tree.predicate.InListPredicate) Predicate(org.hibernate.sql.ast.tree.predicate.Predicate)

Aggregations

QueryLiteral (org.hibernate.sql.ast.tree.expression.QueryLiteral)3 BooleanExpressionPredicate (org.hibernate.sql.ast.tree.predicate.BooleanExpressionPredicate)3 Predicate (org.hibernate.sql.ast.tree.predicate.Predicate)3 SqlFragmentPredicate (org.hibernate.persister.internal.SqlFragmentPredicate)1 ConvertedQueryLiteral (org.hibernate.sql.ast.tree.expression.ConvertedQueryLiteral)1 BetweenPredicate (org.hibernate.sql.ast.tree.predicate.BetweenPredicate)1 ComparisonPredicate (org.hibernate.sql.ast.tree.predicate.ComparisonPredicate)1 ExistsPredicate (org.hibernate.sql.ast.tree.predicate.ExistsPredicate)1 FilterPredicate (org.hibernate.sql.ast.tree.predicate.FilterPredicate)1 GroupedPredicate (org.hibernate.sql.ast.tree.predicate.GroupedPredicate)1 InListPredicate (org.hibernate.sql.ast.tree.predicate.InListPredicate)1 InSubQueryPredicate (org.hibernate.sql.ast.tree.predicate.InSubQueryPredicate)1 LikePredicate (org.hibernate.sql.ast.tree.predicate.LikePredicate)1 NegatedPredicate (org.hibernate.sql.ast.tree.predicate.NegatedPredicate)1 NullnessPredicate (org.hibernate.sql.ast.tree.predicate.NullnessPredicate)1 SelfRenderingPredicate (org.hibernate.sql.ast.tree.predicate.SelfRenderingPredicate)1