Package com.scooterframework.orm.sqldataexpress.object

Examples of com.scooterframework.orm.sqldataexpress.object.RowData


     */
    protected void beforeSetData() {
        if (hasCopied) return;

        if (latestDbRowData == null) {
            latestDbRowData = new RowData(rowInfo, copyArray(rowData.getFields()));
        }
        else {
            latestDbRowData.setFields(copyArray(rowData.getFields()));
        }

View Full Code Here


                            cellValues[i] = dba.getObjectFromResultSetByType(rs,
                                                                         cursor.getColumnJavaClassName(i),
                                                                         cursor.getColumnSqlDataType(i),
                                                                         i+1);
                        }
                        rt.addRow(new RowData(cursor, cellValues));
                    }
                    rs.close();
                }
                else {
                    returnTO.addNamedObject(p.getName(), dba.getObjectFromStatementByType(cstmt,
View Full Code Here

                                                                            i+1));
                            }
                        }
                       
                        if (cellValues.size() > 0)
                            rt.addRow(new RowData(newHeader, cellValues.toArray()));
                    }
                    rs.close();
                }
                else {
                    if (outputFilter.containsKey(p.getName())) {
View Full Code Here

        if(parentRt == null || childRt == null || childRt.getTableSize() == 0) return;

        int size = parentRt.getAllRows().size();
        Map<String, Object> connectorMap = new HashMap<String, Object>();
        for (int i = 0; i < size; i++) {
            RowData parentRow = parentRt.getRow(i);
            populateConnectorMap(connectorMap, parentRow, connectorList);
            parentRow.addChildRowToMap(processorName, getMatchingRowDataList(connectorMap, childRt));

            //clear the map for next row
            connectorMap.clear();
        }
    }
View Full Code Here

    private List<RowData> getMatchingRowDataList(Map<String, Object> connectorMap, TableData childRt) {
        List<RowData> filteredList = new ArrayList<RowData>();
        boolean allPassed = true;
        int size = childRt.getTableSize();
        for (int i=0; i<size; i++) {
            RowData child = childRt.getRow(i);

            for (Map.Entry<String, Object> entry :connectorMap.entrySet()) {
                String key = entry.getKey();
                Object keyData = entry.getValue();
                Object rowData = child.getField(key);
                if (rowData == null || !rowData.toString().equalsIgnoreCase(keyData.toString())) {
                    allPassed = false;
                    break;
                }
            }
View Full Code Here

            int size = parentRows.size();
            if (size > 0) {
                int rowIndex = 0;
                for (int i = 0; i < size -1; i++) {
                    rowIndex = i;
                    RowData parentRow = parentRows.get(i);
                    childQuery += populateChildInputs(rowIndex, childIp.getInputs(), parentRow, query) + " UNION ";
                }

                //last row
                rowIndex = size -1;
                RowData parentRow = (RowData)parentRows.get(rowIndex);
                childQuery += populateChildInputs(rowIndex, childIp.getInputs(), parentRow, query);
            }
        }
        else
        if (InputInfo.CONSTRUCT_CHILD_QUERY_MAKE_NEW_WHERE_CLAUSE.equals(childIp.getChildQueryType())) {
            int size = parentRows.size();
            if (size > 0) {
                String conditionPart1 = "(" + childIp.getFKString() + ") in ";
                String conditionPart2 = "";
                int rowIndex = 0;
                for (int i = 0; i < size -1; i++) {
                    rowIndex = i;
                    RowData parentRow = parentRows.get(i);
                    conditionPart2 += populateConditionPart2(rowIndex, childIp, parentRow) + ", ";
                }

                //last row
                rowIndex = size -1;
                RowData parentRow = parentRows.get(rowIndex);
                conditionPart2 += populateConditionPart2(rowIndex, childIp, parentRow);
                childQuery += " WHERE " + conditionPart1 + "(" + conditionPart2 + ")";
            }
        }
        else
        if (InputInfo.CONSTRUCT_CHILD_QUERY_ADD_TO_WHERE_CLAUSE.equals(childIp.getChildQueryType())) {
            int size = parentRows.size();
            if (size > 0) {
                String conditionPart1 = "(" + childIp.getFKString() + ") in ";
                String conditionPart2 = "";
                int rowIndex = 0;
                for (int i = 0; i < size -1; i++) {
                    rowIndex = i;
                    RowData parentRow = (RowData)parentRows.get(i);
                    conditionPart2 += populateConditionPart2(rowIndex, childIp, parentRow) + ", ";
                }

                //last row
                rowIndex = size -1;
                RowData parentRow = (RowData)parentRows.get(rowIndex);
                conditionPart2 += populateConditionPart2(rowIndex, childIp, parentRow);
                childQuery += " AND " + conditionPart1 + "(" + conditionPart2 + ")";
            }
        }
View Full Code Here

        inputs.put(DataProcessor.input_key_database_connection_name, connName);
        OmniDTO returnTO =
            SqlServiceConfig.getSqlService().execute(inputs, DataProcessorTypes.DIRECT_SQL_STATEMENT_PROCESSOR, insertSQL.toString());
        int insertCount = returnTO.getUpdatedRowCount();
       
        RowData record = null;
        if (insertCount == 1) {
            record = new RowData(ri, null);
            record.setData(inputs);
        }
       
        return record;
    }
View Full Code Here

        String table = getTable();
        setViewData("table", table);
       
        String connName = database;
        RowInfo ri = Record.getRowInfo(connName, table);
        RowData rd = new RowData(ri, null);
        setViewData("record", rd);
       
        return null;
    }
View Full Code Here

        String table = getTable();
        setViewData("table", table);
       
        String connName = database;
        Map<String, Object> inputs = params();
        RowData record = null;
        try {
            record = Record.createRecord(inputs, connName, table);
            if (record == null) {
                flash("notice", "There is no record inserted with inputs as " + inputs + ".");
            }
View Full Code Here

        setViewData("table", table);
       
        String connName = database;
        String restfulId = p("id");
        Map<String, Object> inputs = params();
        RowData record = null;
        try {
            record = Record.getRow(connName, table, restfulId);
            if (record != null) {
                record.setData(inputs);
               
                int updateCount = Record.updateRecord(inputs, connName, table, restfulId);
                if (updateCount == 0) {
                    flash("notice", "There is no record updated in table \"" + table +
                    "\" with restful id as \"" + restfulId + "\".");
View Full Code Here

TOP

Related Classes of com.scooterframework.orm.sqldataexpress.object.RowData

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.