Exemple #1
0
    private boolean isUserId(SQLExpr x) {
      if (x instanceof SQLIdentifierExpr) {
        if ("user".equals(defaultTableName) && "uid".equals(((SQLIdentifierExpr) x).getName())) {
          return true;
        }

        return false;
      }

      if (x instanceof SQLPropertyExpr) {
        SQLPropertyExpr propExpr = (SQLPropertyExpr) x;

        String columnName = propExpr.getName();

        if (!"uid".equals(columnName)) {
          return false;
        }

        if (propExpr.getOwner() instanceof SQLIdentifierExpr) {
          String ownerName = ((SQLIdentifierExpr) propExpr.getOwner()).getName();
          if ("user".equals(ownerName) || "user".equals(tableAlias.get(ownerName))) {
            return true;
          }
        }
      }
      return false;
    }
 public void setTable(SQLName table) {
   if (table instanceof SQLPropertyExpr) {
     SQLPropertyExpr propExpr = (SQLPropertyExpr) table;
     this.setDatabase((SQLName) propExpr.getOwner());
     this.table = new SQLIdentifierExpr(propExpr.getName());
     return;
   }
   this.table = table;
 }