String n2 = null;
String tt2 = null;
Vector joined = new Vector();
Vector j1 = null;
Vector j2 = null;
EZArrayList nvr = new EZArrayList();
Vector vt = null;
Object val = null;
NameValuePairs ref = null;
for (int ct = 0;ct < jincludealllist.size();ct++)
{
c = (Criteria)jincludealllist.elementAt(ct);
n = c.getName();
tt = findTable(n);
//("************TT1 " + tt);
if (sqp.getTableInfo().getColumnInfo(sqp.getRealColName(n)) != null)
tt = sqp.getTable();
//("************TT2 " + tt);
n2 = c.getValueString();
tt2 = findTable(n2);
if (sqp.getTableInfo().getColumnInfo(sqp.getRealColName(n2)) != null && !tt.equals(sqp.getTable()))
tt2 = sqp.getTable();
//role.realm_username Cannot join the same table realm_user1:realm_user1
if (tt.equals(tt2))
tt = findTable(n);
//("************TT3 " + tt);
if (tt.equals(tt2))
throw JGException.get("cannot_join_same_table",n + " Cannot join the same table " + tt + ":" + tt2);
if (joined.contains(tt) && joined.contains(tt2))
throw JGException.get("at_least_1_table_must_not_be_joined",n + " Trying to Join 2 tables already joined. At least 1 table must not be joined " + tt + ":" + tt2);
if (joined.contains(tt))
j1 = vr;
else{
if (tt.equals(sqp.getTable()))
j1 = r;
else
j1 = new EZArrayList(getSQLParser(tt).getResultsTable().elements());
}
if (joined.contains(tt2))
{
j2 = vr;
//("j2 1 " + j2);
}
else{
if (tt2.equals(sqp.getTable())){
j2 = r;
//("j2 2 " + j2);
}
else{
j2 = new EZArrayList(getSQLParser(tt2).getResultsTable().elements());
//("j2 3 " + j2);
}
}
nvr = new EZArrayList();
vt = null;
val = null;
ref = null;
for (int ct1 = 0; ct1 < j1.size(); ct1++){
ref = (NameValuePairs)j1.elementAt(ct1);
val = ref.get(n);
if (val == null)continue;
vt = joinTable(n2,j2,type,val,ref);
if (vt.size() > 0)
nvr.addEnumeration(vt.elements(),nvr);
//for (int ct2 = 0; ct2 < j2.size(); ct2++){
//Hashtable (String rn,Hashtable h,int typ,Object v)