use of org.pentaho.agilebi.modeler.models.JoinFieldModel in project data-access by pentaho.
the class SerializeMultiTableServiceIT method getSchema.
private SchemaModel getSchema() {
List<JoinRelationshipModel> joins = new ArrayList<JoinRelationshipModel>();
JoinTableModel joinTable1 = new JoinTableModel();
joinTable1.setName("CUSTOMERS");
JoinTableModel joinTable2 = new JoinTableModel();
joinTable2.setName("PRODUCTS");
JoinRelationshipModel join1 = new JoinRelationshipModel();
JoinFieldModel lField1 = new JoinFieldModel();
lField1.setName("CUSTOMERNAME");
lField1.setParentTable(joinTable1);
join1.setLeftKeyFieldModel(lField1);
JoinFieldModel rField1 = new JoinFieldModel();
rField1.setName("PRODUCTCODE");
rField1.setParentTable(joinTable2);
join1.setRightKeyFieldModel(rField1);
joins.add(join1);
SchemaModel model = new SchemaModel();
model.setJoins(joins);
return model;
}
use of org.pentaho.agilebi.modeler.models.JoinFieldModel in project data-access by pentaho.
the class JoinMetadataIT method getSchemaModel.
private SchemaModel getSchemaModel() {
List<JoinRelationshipModel> joins = new ArrayList<JoinRelationshipModel>();
JoinTableModel joinTable1 = new JoinTableModel();
joinTable1.setName("CUSTOMERS");
JoinTableModel joinTable2 = new JoinTableModel();
joinTable2.setName("PRODUCTS");
JoinRelationshipModel join1 = new JoinRelationshipModel();
JoinFieldModel lField1 = new JoinFieldModel();
lField1.setName("CUSTOMERNAME");
lField1.setParentTable(joinTable1);
join1.setLeftKeyFieldModel(lField1);
JoinFieldModel rField1 = new JoinFieldModel();
rField1.setName("PRODUCTCODE");
rField1.setParentTable(joinTable2);
join1.setRightKeyFieldModel(rField1);
joins.add(join1);
SchemaModel model = new SchemaModel();
model.setJoins(joins);
return model;
}
use of org.pentaho.agilebi.modeler.models.JoinFieldModel in project data-access by pentaho.
the class JoinDefinitionsStep method setBindings.
public void setBindings() {
BindingFactory bf = new GwtBindingFactory(document);
bf.createBinding(this.joinGuiModel.getLeftTables(), "children", this.leftTables, "elements");
bf.createBinding(this.joinGuiModel.getRightTables(), "children", this.rightTables, "elements");
bf.createBinding(this.leftTables, "selectedItem", this.joinGuiModel, "leftJoinTable");
bf.createBinding(this.rightTables, "selectedItem", this.joinGuiModel, "rightJoinTable");
bf.createBinding(this.joinGuiModel.getJoins(), "children", this.joinsList, "elements");
bf.createBinding(this.joinsList, "selectedItem", this.joinGuiModel, "selectedJoin");
bf.createBinding(this.leftTables, "selectedItem", this.leftKeyFieldList, "elements", new TableSelectionConvertor(this.leftTables));
bf.createBinding(this.rightTables, "selectedItem", this.rightKeyFieldList, "elements", new TableSelectionConvertor(this.rightTables));
this.leftKeyFieldBinding = bf.createBinding(this.leftKeyFieldList, "selectedIndex", this.joinGuiModel, "leftKeyField", new BindingConvertor<Integer, JoinFieldModel>() {
@Override
public JoinFieldModel sourceToTarget(final Integer index) {
JoinTableModel joinTable = joinGuiModel.getLeftJoinTable();
if (joinTable != null) {
List<JoinFieldModel> fields = joinTable.getFields();
if (index == -1 || fields.isEmpty()) {
return null;
}
return fields.get(index);
}
return null;
}
@Override
public Integer targetToSource(final JoinFieldModel value) {
return null;
}
});
this.rightKeyFieldBinding = bf.createBinding(this.rightKeyFieldList, "selectedIndex", this.joinGuiModel, "rightKeyField", new BindingConvertor<Integer, JoinFieldModel>() {
@Override
public JoinFieldModel sourceToTarget(final Integer index) {
JoinTableModel joinTable = joinGuiModel.getRightJoinTable();
if (joinTable != null) {
List<JoinFieldModel> fields = joinTable.getFields();
if (index == -1 || fields.isEmpty()) {
return null;
}
return fields.get(index);
}
return null;
}
@Override
public Integer targetToSource(final JoinFieldModel value) {
return null;
}
});
}
Aggregations