use of com.ramussoft.report.data.Row in project ramus by Vitaliy-Yakovchuk.
the class FastIdef0Connection method addAll.
private void addAll(Row function, IDEF0Buffer buffer) {
for (Object child : function.getChildren()) {
Row r = (Row) child;
buffer.addFunctionStream(r);
buffer.addRowFunction(r);
addAll(r, buffer);
}
}
use of com.ramussoft.report.data.Row in project ramus by Vitaliy-Yakovchuk.
the class IDEF0Buffer method commit.
public void commit(boolean all) {
Enumeration<Row> keys = functionStreamsBuff.keys();
while (keys.hasMoreElements()) {
Row key = keys.nextElement();
Hashtable<Row, Boolean> fs = functionStreamsBuff.get(key);
Rows rows = new Rows(streams, data, false);
functionStreams.put(key, rows);
Enumeration<Row> streams = fs.keys();
while (streams.hasMoreElements()) rows.add(streams.nextElement());
}
List<com.ramussoft.database.common.Row> allRows = this.functions.getAllRows();
Row[] functions = allRows.toArray(new Row[allRows.size()]);
keys = rowFunctionsBuff.keys();
while (keys.hasMoreElements()) {
Row key = keys.nextElement();
Hashtable<Row, Boolean> rf = rowFunctionsBuff.get(key);
Rows fns = new Rows(this.functions, data, false);
// fns.addAll(rf.keySet());
rowFunctions.put(key, fns);
for (Row f : functions) if (all || getChildCount(f) == 0)
if (rf.get(f) != null)
fns.add(f);
}
functionStreamsBuff = null;
rowFunctionsBuff = null;
}
use of com.ramussoft.report.data.Row in project ramus by Vitaliy-Yakovchuk.
the class IDEF0ConnectionPlugin method getStreams.
private Rows getStreams(Data data, String name) {
final RowSet rowSet = IDEF0Buffer.getStreamsRowSet(data);
final Rows rows = new Rows(rowSet, data, false);
rows.setQualifierName(name);
data.getTemplate().queryWithoutResults("SELECT DISTINCT ramus_attribute_any_to_any_elements.element_id,\n" + "(SELECT element_id FROM ramus_elements WHERE ramus_attribute_any_to_any_elements.other_element= ramus_elements.element_id) as oelement_id,\n" + "ramus_elements.element_name\n" + "FROM ramus_attribute_any_to_any_elements, ramus_elements, ramus_attribute_sector_borders, ramus_attribute_other_elements\n" + "WHERE ramus_attribute_any_to_any_elements.element_id= ramus_elements.element_id\n" + "AND ramus_attribute_sector_borders.function_type>=0\n" + "AND ramus_attribute_sector_borders.element_id = ramus_attribute_other_elements.element_id\n" + "AND ramus_attribute_other_elements.other_element = ramus_elements.element_id\n", new RowMapper() {
@Override
public Object mapRow(ResultSet rs, int rowNum) throws SQLException {
if ((rs.getString(3).length() > 0) || (rs.getObject(2) != null)) {
rows.add((Row) rowSet.findRow(rs.getLong(1)));
}
return null;
}
}, true);
return rows;
}
use of com.ramussoft.report.data.Row in project ramus by Vitaliy-Yakovchuk.
the class IDEF0Connection method getRecIDEF0Kod.
protected String getRecIDEF0Kod(final Row function) {
final Row f = (Row) function.getParent();
if (f == null || f.getParent() == null)
return "";
String id = Integer.toString(function.getId());
if (id.length() > 1)
id = "." + id + ".";
return getRecIDEF0Kod(f) + id;
}
use of com.ramussoft.report.data.Row in project ramus by Vitaliy-Yakovchuk.
the class QualifiersConnection method getConnected.
@SuppressWarnings("unchecked")
@Override
public Rows getConnected(Data data, Row row) {
if (!(row.getQualifier().equals(IDEF0Plugin.getBaseStreamQualifier(data.getEngine()))))
return new Rows(null, data, false);
List<AnyToAnyPersistent> list = (List) row.getAttribute(IDEF0Plugin.getStreamAddedAttribute(data.getEngine()));
final Engine engine = data.getEngine();
Rows rows = new Rows(null, data, false) {
/**
*/
private static final long serialVersionUID = -284240974188065028L;
@Override
public RowSet getRowSet() {
Row current = getCurrent();
if (current == null)
return null;
return current.getRowSet();
}
@Override
public Row addRow(long elementId) {
long qId = engine.getQualifierIdForElement(elementId);
if (qId >= 0l) {
Qualifier qualifier = this.data.getQualifier(qId);
if (qualifier != null) {
RowSet rowSet = this.data.getRowSet(qualifier);
Row row = (Row) rowSet.findRow(elementId);
if (row != null) {
add(row);
return row;
}
}
}
return null;
}
};
for (AnyToAnyPersistent p : list) {
Row row2 = rows.addRow(p.getOtherElement());
if (row2 != null)
row2.setElementStatus(p.getElementStatus());
}
return rows;
}
Aggregations