Package com.alvazan.orm.api.z8spi.meta

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


    ReflectionUtil.putFieldValue(entity, field, value);
  }
  @Override
  public void translateToColumn(InfoForIndex<OWNER> info) {
    OWNER entity = info.getEntity();
    RowToPersist row = info.getRow();
   
    Column col = new Column();
    row.getColumns().add(col);

    Object value = ReflectionUtil.fetchFieldValue(entity, field);
    byte[] byteVal = translateValue(value);
    byte[] colBytes = StandardConverters.convertToBytes(columnName);
    col.setName(colBytes);
View Full Code Here


        entity = temp;
        BeanProps.copyProps(originalEntity, entity);
      }
    }
   
    RowToPersist row = metaClass.translateToRow(entity);
   
    DboTableMeta metaDbo = metaClass.getMetaDbo();
    //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(metaDbo, row.getKey(), 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(metaDbo, 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(metaDbo, ind.getColumnFamilyName(), ind.getRowKeyBytes(), ind.getIndexColumn());
    }

    byte[] virtKey = row.getVirtualKey();
    List<Column> cols = row.getColumns();
    session.put(metaDbo, virtKey, cols);
  }
View Full Code Here

  @SuppressWarnings("unchecked")
  @Override
  public void translateToColumn(InfoForIndex<OWNER> info) {
    OWNER entity = info.getEntity();
    RowToPersist row = info.getRow();
   
    Collection<T> values = (Collection<T>) ReflectionUtil.fetchFieldValue(entity, field);
    if (values == null)
      values = new ArrayList<T>();
    Collection<T> toBeAdded = values; //all values in the list get added if not an OurAbstractCollection
View Full Code Here

    if(entity instanceof Proxy) {
      clazz = entity.getClass().getSuperclass();
    }
    String type = classToType.get(clazz);
    MetaClassSingle<T> metaClassSingle = dbTypeToMeta.get(type);
    RowToPersist translateToRow = metaClassSingle.translateToRow(entity);
   
    byte[] value = StandardConverters.convertToBytes(type);
    Column typeCol = new Column();
    typeCol.setName(discColAsBytes);
    typeCol.setValue(value);
    translateToRow.getColumns().add(typeCol);
    return translateToRow;
  }
View Full Code Here

  }
 
  @SuppressWarnings("unchecked")
  public void translateToColumn(InfoForIndex<OWNER> info) {
    OWNER entity = info.getEntity();
    RowToPersist row = info.getRow();
   
    Column col = new Column();
    row.getColumns().add(col);
   
    PROXY value = (PROXY) ReflectionUtil.fetchFieldValue(entity, field);
    //Value is the Account.java or a Proxy of Account.java field and what we need to save in
    //the database is the ID inside this Account.java object!!!!
    byte[] byteVal = classMeta.convertEntityToId(value);
View Full Code Here

TOP

Related Classes of com.alvazan.orm.api.z8spi.meta.RowToPersist

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.