Package com.alvazan.orm.api.z8spi

Examples of com.alvazan.orm.api.z8spi.Row


    RowHolder<Row> currentRow = fromCache(colFamily, rowKey);
    if(currentRow == null) {
      currentRow = new RowHolder<Row>(rowKey);
    }

    Row value = currentRow.getValue();
    if(value == null)
      value = rowProvider.get();
   
    value.setKey(rowKey);
    value.addColumns(columns);
    cacheRow(colFamily, rowKey, value);
  }
View Full Code Here


    session.remove(colFamily, rowKey, columnNames);
    RowHolder<Row> currentRow = fromCache(colFamily, rowKey);
    if(currentRow == null) {
      return;
    }
    Row value = currentRow.getValue();
    if(value == null) {
      return;
    }
   
    value.removeColumns(columnNames);
  }
View Full Code Here

  public Row find(DboTableMeta colFamily, byte[] rowKey) {
    RowHolder<Row> result = fromCache(colFamily, rowKey);
    if(result != null)
      return result.getValue(); //This may return the cached null value!!
   
    Row row = session.find(colFamily, rowKey);
    cacheRow(colFamily, rowKey, row);
    return row;
  }
View Full Code Here

      throw new RuntimeException("bug, unknown remove action="+action.getAction());
    }
  }

  private void removeColumns(Remove action, Table table) {
    Row row = table.getRow(action.getRowKey());
    if(row == null)
      return;
   
    for(byte[] name : action.getColumns()) {
      row.remove(name);
    }
  }
View Full Code Here

  private void removeColumn(RemoveColumn action, NoSqlEntityManager ormSession) {

    String colFamily = action.getColFamily().getColumnFamily();
    Table table = lookupColFamily(colFamily, (NoSqlEntityManager) ormSession);
    Row row = table.getRow(action.getRowKey());
    if(row == null)
      return;
    byte[] name = action.getColumn();
      row.remove(name);
  }
View Full Code Here

  }

  private void persist(Persist action, NoSqlEntityManager ormSession) {
    String colFamily = action.getColFamily().getColumnFamily();
    Table table = lookupColFamily(colFamily, (NoSqlEntityManager) ormSession);
    Row row = table.findOrCreateRow(action.getRowKey());
   
    for(Column col : action.getColumns()) {
      row.put(col.copy());
    }
  }
View Full Code Here

      byte[] from, byte[] to, Integer batchSize, BatchListener l) {
    Table table = database.findTable(colFamily.getColumnFamily());
    if(table == null) {
      return new HashSet<Column>();
    }
    Row row = table.findOrCreateRow(rowKey);
    if(row == null)
      return new HashSet<Column>();
   
    return row.columnSlice(from, to);
  }
View Full Code Here

    byte[] rowKey = info.getRowKey();
    Table table = database.findTable(colFamily);
    if(table == null) {
      return new HashSet<IndexColumn>();
    }
    Row row = table.findOrCreateRow(rowKey);
    if(row == null)
      return new HashSet<IndexColumn>();
   
    return row.columnSlice(from, to);
  }
View Full Code Here

      throw new RowNotFoundException("row for type="+classMeta.getMetaClass().getName()+" not found for key="+entityId);
    KeyValue<Row> next = holder.getValue();
    if(next.getValue() == null)
      throw new RowNotFoundException("row for type="+classMeta.getMetaClass().getName()+" not found for key="+entityId);
   
    Row row = next.getValue();
    classMeta.fillInInstance(row, session, self);
  }
View Full Code Here

    while(true) {
      com.alvazan.orm.api.z8spi.iter.AbstractCursor.Holder<KeyValue<Row>> holder = rows.nextImpl();
      if(holder == null)
        break;
      KeyValue<Row> kv = holder.getValue();
      Row row = kv.getValue();
      //Tuple<T> tuple = proxyMeta.convertIdToProxy(row, session, key, null);
      if(row != null) {
        T value = proxyList.get(counter);
        proxyMeta.fillInInstance(row, session, value);       
//        throw new IllegalStateException("This entity is corrupt(your entity='"+owner+"') and contains a" +
View Full Code Here

TOP

Related Classes of com.alvazan.orm.api.z8spi.Row

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.