Relationship relationship = relationships[0];
assertEquals(
"Relationship[primaryTable=PRODUCTS,primaryColumns=[PRODUCTCODE],foreignTable=ORDERFACT,foreignColumns=[PRODUCTCODE]]",
relationship.toString());
Query q = new Query().from(new FromItem(JoinType.LEFT, relationship))
.select(relationship.getForeignColumns())
.select(relationship.getPrimaryColumns());
assertEquals(
"SELECT _ORDERFACT_._PRODUCTCODE_, _PRODUCTS_._PRODUCTCODE_ FROM PUBLIC._PRODUCTS_ LEFT JOIN PUBLIC._ORDERFACT_ ON _PRODUCTS_._PRODUCTCODE_ = _ORDERFACT_._PRODUCTCODE_",
q.toString().replace('\"', '_'));