Package com.alvazan.orm.api.z8spi

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


   
    return keyVal;
  }

  private KeyValue<TypedRow> nextVal(KeyValue<Row> kv) {
    Row row = kv.getValue();
    T key = keys.next();
   
    KeyValue<TypedRow> keyVal;
    if(row == null) {
      keyVal = new KeyValue<TypedRow>();
View Full Code Here


    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

    this.columnFamilyName = columnFamily;
  }

  public Row findOrCreateRow(byte[] key) {
    ByteArray array = new ByteArray(key);
    Row row = keyToRow.get(array);
    if(row == null) {
      row = createSortedMap();
      row.setKey(key);
      keyToRow.put(new ByteArray(key), row);
    }
    return row;
  }
View Full Code Here

    return row;
  }

  private Row createSortedMap() {
    TreeMap<ByteArray, Column> tree;
    Row row;
    switch (columnSortType) {
    case BYTES:
      tree = new TreeMap<ByteArray, Column>();
      row = new RowImpl(tree);
      break;
View Full Code Here

    keyToRow.remove(key);
  }

  public Row getRow(byte[] rowKey) {
    ByteArray key = new ByteArray(rowKey);
    Row row = keyToRow.get(key);
    return row;
  }
View Full Code Here

      if(holder == null)
        break;
      KeyValue<Row> kv = holder.getValue();
      byte[] key = (byte[]) kv.getKey();
      byte[] nonVirtKey = idMeta.unformVirtRowKey(key);
      Row row = kv.getValue();
      Tuple<T> tuple = metaClass.convertIdToProxy(row, session, nonVirtKey, null);
      if(row == null) {
        throw new IllegalStateException("This entity is corrupt(your entity='"+owner+"') and contains a" +
            " reference/FK to a row that does not exist in another table.  " +
            "It refers to another entity with pk="+tuple.getEntityId()+" which does not exist");
View Full Code Here

    KeyValue<Row> kv = new KeyValue<Row>();
    kv.setKey(row.getKey());
    if(!row.getColumns().isEmpty()) {
      //Astyanax returns a row when there is none BUT we know if there are 0 columns there is really no row in the database
      //then
      Row r = rowProvider.get();
      r.setKey(row.getKey());
      CassandraSession.processColumns(row, r);
      kv.setValue(r);
    }
   
    return new Holder<KeyValue<Row>>(kv);   
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

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.