Search in sources :

Example 6 with Rows

use of com.ramussoft.report.data.Rows 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;
}
Also used : Row(com.ramussoft.report.data.Row) Rows(com.ramussoft.report.data.Rows)

Example 7 with Rows

use of com.ramussoft.report.data.Rows in project ramus by Vitaliy-Yakovchuk.

the class IDEF0Buffer method getStreams.

public Rows getStreams(Row function) {
    Rows rows = functionStreams.get(function);
    if (rows == null)
        return new Rows(streams, data, false);
    Rows clone = (Rows) rows.clone();
    return clone;
}
Also used : Rows(com.ramussoft.report.data.Rows)

Example 8 with Rows

use of com.ramussoft.report.data.Rows in project ramus by Vitaliy-Yakovchuk.

the class IDEF0Buffer method getFunctions.

public Rows getFunctions(Row row) {
    Rows rows = rowFunctions.get(row);
    if (rows == null)
        return new Rows(functions, data, false);
    Rows clone = (Rows) rows.clone();
    return clone;
}
Also used : Rows(com.ramussoft.report.data.Rows)

Example 9 with Rows

use of com.ramussoft.report.data.Rows 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;
}
Also used : SQLException(java.sql.SQLException) RowSet(com.ramussoft.report.data.RowSet) ResultSet(java.sql.ResultSet) Row(com.ramussoft.report.data.Row) Rows(com.ramussoft.report.data.Rows) RowMapper(com.ramussoft.jdbc.RowMapper)

Example 10 with Rows

use of com.ramussoft.report.data.Rows in project ramus by Vitaliy-Yakovchuk.

the class InputsControlsMechanismsConnection method getConnected.

@Override
public Rows getConnected(Data data, Row row) {
    Rows rows = inputs.getConnected(data, row);
    rows.addAll(controls.getConnected(data, row));
    rows.addAll(mechanisms.getConnected(data, row));
    return rows;
}
Also used : Rows(com.ramussoft.report.data.Rows)

Aggregations

Rows (com.ramussoft.report.data.Rows)16 Row (com.ramussoft.report.data.Row)9 AnyToAnyPersistent (com.ramussoft.idef0.attribute.AnyToAnyPersistent)4 RowSet (com.ramussoft.report.data.RowSet)4 List (java.util.List)4 Engine (com.ramussoft.common.Engine)3 Qualifier (com.ramussoft.common.Qualifier)3 RowMapper (com.ramussoft.jdbc.RowMapper)3 DataException (com.ramussoft.report.data.DataException)3 ResultSet (java.sql.ResultSet)3 SQLException (java.sql.SQLException)3 ArrayList (java.util.ArrayList)3 Hashtable (java.util.Hashtable)2 Attribute (com.ramussoft.common.Attribute)1 Element (com.ramussoft.common.Element)1 IOException (java.io.IOException)1 InvalidPropertiesFormatException (java.util.InvalidPropertiesFormatException)1