Package com.scooterframework.orm.sqldataexpress.object

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


                log.debug("child query1: " + query);

                // check if parent has data
                boolean parentHasData = false;
                TableData parentRt = null;
                if (returnTO != null) {
                    parentRt = returnTO.getTableData(ip.getProcessorName());
                    if (parentRt != null) {
                        int size = parentRt.getAllRows().size();
                        if (size > 0) parentHasData = true;
                    }
                }

                // construct child query
                String childQuery = "";
                if (query != null && connectorList.size() > 0 && parentHasData) {
                    childQuery = getNewChildQuery(query, childIp, parentRt.getAllRows());
                }
                else {
                    childQuery = query;
                }
View Full Code Here


        inputs.put(DataProcessor.input_key_records_offset, Integer.valueOf(offset));
        inputs.put(DataProcessor.input_key_records_limit, Integer.valueOf(limitOrFixed));

        OmniDTO dto = execute(inputs, processorType, processorName);
        TableData td = dto.getTableData(processorName);

        if (limitOrFixed != DataProcessor.NO_ROW_LIMIT) {
            boolean requireFixed = Util.getBooleanValue(inputs, DataProcessor.input_key_records_fixed, false);
            if (requireFixed) {
                if (td.getTableSize() != 0 && td.getTableSize() != limitOrFixed) {
                    throw new UnexpectedDataException("Failed to retrieveRows for '" +
                      processorName + "': required only " +
                        limitOrFixed + " but retrieved " + td.getTableSize() + ".");
                }
            }
            else {
                if (td.getTableSize() > limitOrFixed) {
                    throw new UnexpectedDataException("Failed to retrieveRows for '" +
                      processorName + "': required limit at most " +
                        limitOrFixed + " but retrieved " + td.getTableSize() + ".");
                }
            }
        }
        return td;
    }
View Full Code Here

    if (whereClause != null)
      processorName = processorName + " " + whereClause;

    // retrieve all records
    inputs.put(DataProcessor.input_key_database_connection_name, connName);
    TableData td = SqlServiceConfig.getSqlService().retrieveRows(inputs, processorType, processorName);
    if (td != null) {
      td.setHeader(ri);
    }
    return (td != null) ? td.getAllRows() : null;
  }
View Full Code Here

        if (condition != null && !"".equals(condition)) processorName += " WHERE " + condition;
       
        log.debug("select sql = " + processorName);
        log.debug("select inputs = " + inputs);
       
        TableData td = SqlServiceConfig.getSqlService().retrieveRow(inputs, processorType, processorName);
        if (td != null) {
          td.setHeader(ri);
        }
        return (td != null)?td.getFirstRow():null;
    }
View Full Code Here

     
      Map<String, Object> inputs = new HashMap<String, Object>();
      inputs.putAll(inputOptions);
      inputs.put(DataProcessor.input_key_database_connection_name, connName);
     
        TableData td = SqlServiceClient.retrieveTableDataBySQL(finderSql, inputs);
        if (td != null) {
          td.setHeader(ri);
        }
        return (td != null)?td.getAllRows():null;
    }
View Full Code Here

     * @param sql a valid SQL statement string
     * @param inputs a map of name and value pairs
     * @return a TableData instance returned from the database.
     */
    public static TableData retrieveTableDataBySQL(String sql, Map<String, Object> inputs) {
        TableData td = null;
       
        try {
            OmniDTO returnTO =
                getSqlService().execute(inputs, DataProcessorTypes.DIRECT_SQL_STATEMENT_PROCESSOR, sql);
           
View Full Code Here

     * @param sqlKey    key to a SQL statement
     * @param inputs a map of name and value pairs
     * @return a TableData instance returned from the database.
     */
    public static TableData retrieveTableDataBySQLKey(String sqlKey, Map<String, Object> inputs) {
        TableData td = null;
       
        try {
            OmniDTO returnTO =
                getSqlService().execute(inputs, DataProcessorTypes.NAMED_SQL_STATEMENT_PROCESSOR, sqlKey);
           
View Full Code Here

     * @param sqlKey    key to a SQL statement
     * @param inputs    a map of name and value pairs
     * @return a lList of RowData objects returned from the database.
     */
    public static List<RowData> retrieveRowsBySQLKey(String sqlKey, Map<String, Object> inputs) {
        TableData td = retrieveTableDataBySQLKey(sqlKey, inputs);
        if (td != null) return td.getAllRows();
        return null;
    }
View Full Code Here

     * @param sql       a SQL statement
     * @param inputs    a map of name and value pairs
     * @return a list of RowData objects returned from the database.
     */
    public static List<RowData> retrieveRowsBySQL(String sql, Map<String, Object> inputs) {
        TableData td = retrieveTableDataBySQL(sql, inputs);
        if (td != null) return td.getAllRows();
        return null;
    }
View Full Code Here

     * @param sqlKey    key to a SQL statement
     * @param inputs    a map of name and value pairs
     * @return a RowData object returned from the database.
     */
    public static RowData retrieveOneRowBySQLKey(String sqlKey, Map<String, Object> inputs) {
        TableData td = retrieveTableDataBySQLKey(sqlKey, inputs);
        if (td != null) return td.getFirstRow();
        return null;
    }
View Full Code Here

TOP

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

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.