Examples of RowToPersist


Examples of com.alvazan.orm.api.z8spi.meta.RowToPersist

  public void put(String colFamily, TypedRow typedRow) {
    DboTableMeta metaClass = cachedMeta.getMeta(colFamily);
    if(metaClass == null)
      throw new IllegalArgumentException("DboTableMeta for colFamily="+colFamily+" was not found");

    RowToPersist row = metaClass.translateToRow(typedRow);
   
    byte[] virtualKey = row.getVirtualKey();
    //This is if we need to be removing columns from the row that represents the entity in a oneToMany or ManyToMany
    //as the entity.accounts may have removed one of the accounts!!!
    if(row.hasRemoves())
      session.remove(metaClass, virtualKey, row.getColumnNamesToRemove());
   
    //NOW for index removals if any indexed values change of the entity, we remove from the index
    for(IndexData ind : row.getIndexToRemove()) {
      session.removeFromIndex(metaClass, ind.getColumnFamilyName(), ind.getRowKeyBytes(), ind.getIndexColumn());
    }
   
    //NOW for index adds, if it is a new entity or if values change, we persist those values
    for(IndexData ind : row.getIndexToAdd()) {
      session.persistIndex(metaClass, ind.getColumnFamilyName(), ind.getRowKeyBytes(), ind.getIndexColumn());
    }
   
    List<Column> cols = row.getColumns();
    session.put(metaClass, virtualKey, cols);
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.