Search in sources :

Example 1 with ZFromItem

use of lucee.runtime.sql.old.ZFromItem in project Lucee by lucee.

the class HSQLUtil method getInvokedTables.

private void getInvokedTables(ZQuery query, Set<String> tablesNames) {
    // print.out("qry:"+query.getSet());
    Vector tables = query.getFrom();
    Enumeration e = tables.elements();
    // from
    while (e.hasMoreElements()) {
        ZFromItem fromItem = (ZFromItem) e.nextElement();
        tablesNames.add(fromItem.getFullName());
    }
    // where
    ZExp where = query.getWhere();
    if (where instanceof ZExpression) {
        parseZExpression((ZExpression) where, tablesNames);
    }
    // set
    ZExpression set = query.getSet();
    if (set != null) {
        isUnion = true;
        ZExp op = set.getOperand(0);
        if (op instanceof ZQuery)
            getInvokedTables((ZQuery) op, tablesNames);
    }
}
Also used : Enumeration(java.util.Enumeration) ZFromItem(lucee.runtime.sql.old.ZFromItem) ZExpression(lucee.runtime.sql.old.ZExpression) ZExp(lucee.runtime.sql.old.ZExp) Vector(java.util.Vector) ZQuery(lucee.runtime.sql.old.ZQuery)

Aggregations

Enumeration (java.util.Enumeration)1 Vector (java.util.Vector)1 ZExp (lucee.runtime.sql.old.ZExp)1 ZExpression (lucee.runtime.sql.old.ZExpression)1 ZFromItem (lucee.runtime.sql.old.ZFromItem)1 ZQuery (lucee.runtime.sql.old.ZQuery)1