Package com.scooterframework.orm.sqldataexpress.object

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


    try {
      OmniDTO returnTO = getSqlService().execute(inputs,
          DataProcessorTypes.DIRECT_SQL_STATEMENT_PROCESSOR, findSQL);

      RowData tmpRd = returnTO.getTableData(findSQL).getRow(0);
      if (tmpRd != null) {
        ar = (ActiveRecord) createNewInstance();
        ar.populateDataFromDatabase(tmpRd);
       
        if (modelCacheClient.useCache("findById")) {
View Full Code Here


  public void test_retrieveTableDataBySQL() {
    String sql = "SELECT * FROM pets ORDER BY birth_date DESC";
    TableData td = SqlServiceClient.retrieveTableDataBySQL(sql);
    assertEquals("total vets", 13, td.getTableSize());
   
    RowData rd1 = td.getFirstRow();
    assertEquals("first row pet name", "Basil", rd1.getField("name"));
  }
View Full Code Here

    Map<String, Object> inputs = new HashMap<String, Object>();
    inputs.put("name", "Max");
    TableData td = SqlServiceClient.retrieveTableDataBySQL(sql, inputs);
    assertEquals("total vets", 1, td.getTableSize());
   
    RowData rd1 = td.getFirstRow();
    assertEquals("first row pet id", "8", rd1.getField("id").toString());
  }
View Full Code Here

  public void test_retrieveTableDataBySQLKey() {
    String sql = "getAllPets";
    TableData td = SqlServiceClient.retrieveTableDataBySQLKey(sql);
    assertEquals("total vets", 13, td.getTableSize());
   
    RowData rd1 = td.getFirstRow();
    assertEquals("first row pet name", "Leo", rd1.getField("name"));
  }
View Full Code Here

    Map<String, Object> inputs = new HashMap<String, Object>();
    inputs.put("name", "Max");
    TableData td = SqlServiceClient.retrieveTableDataBySQLKey(sql, inputs);
    assertEquals("total vets", 1, td.getTableSize());
   
    RowData rd1 = td.getFirstRow();
    assertEquals("first row pet id", "8", rd1.getField("id").toString());
  }
View Full Code Here

  public void test_retrieveRowsBySQL() {
    String sql = "SELECT * FROM pets ORDER BY birth_date DESC";
    List<RowData> rows = SqlServiceClient.retrieveRowsBySQL(sql);
    assertEquals("total rows", 13, rows.size());
   
    RowData rd1 = (RowData)rows.get(0);
    assertEquals("first row pet name", "Basil", rd1.getField("name"));
  }
View Full Code Here

    Map<String, Object> inputs = new HashMap<String, Object>();
    inputs.put("name", "Max");
    List<RowData> rows = SqlServiceClient.retrieveRowsBySQL(sql, inputs);
    assertEquals("total rows", 1, rows.size());
   
    RowData rd1 = (RowData)rows.get(0);
    assertEquals("first row pet id", "8", rd1.getField("id").toString());
  }
View Full Code Here

            if (records == null) return null;

            List<ReferenceData> list = new ArrayList<ReferenceData>(records.size());
            Iterator<RowData> it = records.iterator();
            while(it.hasNext()) {
                RowData row = it.next();
                ReferenceData rdr = new ReferenceDataRecord(theName, key, value, row);
                list.add(rdr);
            }
            return list;
        }
View Full Code Here

     * copies data from one row to another
     */
    public static void copyData(RowData fromRowData, RowData toRowData) {
        if ( fromRowData != null ) {
            if (toRowData == null)
                toRowData = new RowData(fromRowData.getRowInfo(), null);

            Object[] currentData = fromRowData.getFields();
            if ( currentData != null ) {
                int dataLength = currentData.length;
                Object[] newObjectAry = new Object[dataLength];
View Full Code Here

    /**
     * Initializes the record
     */
    private void initialize(String connectionName, String table) {
        rowInfo = lookupAndRegister(connectionName, table).getHeader();
        rowData = new RowData(rowInfo, null);

        dirty = false;//reset dirty as it was set in setData()
        existInDatabase = false;
        freezed = false;

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.