Package com.alvazan.orm.api.z8spi.action

Examples of com.alvazan.orm.api.z8spi.action.Column


    Set<String> columns = mdbRow.keySet();
    for (String col : columns) {
      if(!col.equalsIgnoreCase("_id")) {
        byte[] name = StandardConverters.convertFromString(byte[].class, col);
        byte[] val = StandardConverters.convertToBytes(mdbRow.get(col));
        Column c = new Column();
        c.setName(name);
        if (val.length != 0)
          c.setValue(val);
        r.put(c);
      }
    }
  }
View Full Code Here


  @Override
  public void translateToColumn(InfoForIndex<TypedRow> info) {
    TypedRow entity = info.getEntity();
    RowToPersist row = info.getRow();
    Column col = new Column();
    TypedColumn column = entity.getColumn(getColumnName());

    byte[] byteVal = convertToStorage2(column.getValue());
    byte[] prefix = StandardConverters.convertToBytes(getColumnName());

    byte[] pkData = byteVal;
    byte[] name = new byte[prefix.length + pkData.length];
    for(int i = 0; i < name.length; i++) {
      if(i < prefix.length)
        name[i] = prefix[i];
      else
        name[i] = pkData[i-prefix.length];
    }
    col.setName(name);
    row.getColumns().add(col);
    Object primaryKey = column.getValue();
    addIndexInfo(info, primaryKey, byteVal);
    removeIndexInfo(info, primaryKey, byteVal);
  }
View Full Code Here

    Class fieldType = getClassType();
    return ConverterUtil.getStorageType(fieldType);
  }

  public void translateFromColumn(Row row, TypedRow entity) {
    Column column = row.getColumn(getColumnNameAsBytes());
    if(column == null) {
      return;
    }

    Long timestamp = column.getTimestamp();
    entity.addColumn(this, getColumnNameAsBytes(), column.getValue(), timestamp);
  }
View Full Code Here

    TypedColumn typedCol = typedRow.getColumn(getColumnName());
    Object value = null;
    byte[] byteVal = null;
    if(typedCol != null) {
      Column col = new Column();
      row.getColumns().add(col);
     
      value = typedCol.getValue();
      byteVal = convertToStorage2(value);
      col.setName(getColumnNameAsBytes());
      col.setValue(byteVal);
    }   
    addIndexInfo(info, value, byteVal);
    removeIndexInfo(info, value, byteVal);
  }
View Full Code Here

    }

    private List<Column> createColumns(int i, DboTableMeta table2) {
      List<Column> cols = new ArrayList<Column>();
      for(DboColumnMeta colMeta : table2.getAllColumns()) {
        Column c = new Column();
        byte[] name = colMeta.getColumnNameAsBytes();
        c.setName(name);
        long val = r.nextLong();
        byte[] value = colMeta.convertToStorage2(val);
        c.setValue(value);
        cols.add(c);
      }
      return cols;
    }
View Full Code Here

    //now process all the existing columns (we can add same entity as many times as we like and it does not
    //get duplicated)
    if (toBeAdded != null) {
      for(PROXY proxy : toBeAdded) {
        byte[] name = formTheName(proxy);
        Column c = new Column();
        c.setName(name);
     
        row.getColumns().add(c);
      }
    }
  }
View Full Code Here

    MetaClassSingle<T> metaClassSingle = retrieveMeta(row);
    return metaClassSingle.translateFromRow(row, session);
  }

  private MetaClassSingle<T> retrieveMeta(Row row) {
    Column column = row.getColumn(discColAsBytes);
   
    String type = StandardConverters.convertFromBytes(String.class, column.getValue());
    MetaClassSingle<T> metaClassSingle = this.dbTypeToMeta.get(type);
    return metaClassSingle;
  }
View Full Code Here

    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

      DboColumnMeta colMeta = col.getColumnMeta();
      if(colMeta != null)
        continue;
     
      List<Column> columns = row.getColumns();
      Column c = new Column();
      c.setName(col.getNameRaw());
      c.setValue(col.getValueRaw());
      columns.add(c);
    }
   
    return row;
  }
View Full Code Here

   
    //now process all the existing columns (we can add same entity as many times as we like and it does not
    //get duplicated)
    for(PROXY proxy : toBeAdded) {
      byte[] name = formTheName(proxy);
      Column c = new Column();
      c.setName(name);
     
      row.getColumns().add(c);
    }
  }
View Full Code Here

TOP

Related Classes of com.alvazan.orm.api.z8spi.action.Column

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.