use of org.jparsec.functors.Tuple4 in project fql by CategoricalData.
the class SqlToFql method toECreateTable.
@SuppressWarnings("rawtypes")
private static ECreateTable toECreateTable(Object decl) {
Tuple4 t = (Tuple4) decl;
String name = t.c.toString();
Tuple3 t0 = (Tuple3) t.d;
List t1 = (List) t0.b;
List<Pair<String, String>> types = new LinkedList<>();
List<Pair<String, String>> fks = new LinkedList<>();
for (Object o : t1) {
org.jparsec.functors.Pair p = (org.jparsec.functors.Pair) o;
if (p.a.toString().equals("FOREIGN")) {
Tuple5 x = (Tuple5) o;
Tuple3 y = (Tuple3) x.b;
fks.add(new Pair<>(y.b.toString(), x.d.toString()));
} else {
types.add(new Pair<>(p.a.toString(), p.b.toString()));
}
}
return new ECreateTable(name, types, fks);
}
Aggregations