Example usage for org.hibernate.hql.internal.ast.util ASTUtil findTypeInChildren

List of usage examples for org.hibernate.hql.internal.ast.util ASTUtil findTypeInChildren

Introduction

In this page you can find the example usage for org.hibernate.hql.internal.ast.util ASTUtil findTypeInChildren.

Prototype

public static AST findTypeInChildren(AST parent, int type) 

Source Link

Document

Finds the first node of the specified type in the chain of children.

Usage

From source file:org.babyfish.hibernate.hql.SqlASTHelper.java

License:Open Source License

public static boolean findJoinReferenceInWhereCaluse(QueryNode queryNode, Set<FromElement> joins) {
    if (joins.isEmpty()) {
        return false;
    }/* w  w  w . ja  v a2 s . c o m*/
    AST whereAST = ASTUtil.findTypeInChildren(queryNode, WHERE);
    if (whereAST == null) {
        return false;
    }
    return findJoinReferenceImpl(whereAST, joins);
}

From source file:org.babyfish.hibernate.hql.SqlASTHelper.java

License:Open Source License

public static void removeFromElementsExcept(QueryNode queryNode, Set<FromElement> usedFromElements) {
    AST whereAst = ASTUtil.findTypeInChildren(queryNode, WHERE);
    if (whereAst != null) {
        updateUsedFromElements(whereAst, usedFromElements);
    }/*from  ww w . j av  a  2 s  .  c  o  m*/
    removeFromElementsExceptImpl(queryNode.getFromClause(), usedFromElements);
}