Package com.alvazan.orm.api.z8spi.conv

Examples of com.alvazan.orm.api.z8spi.conv.StorageTypeEnum


        }
    }

    private void persist(Persist action, MetaLookup ormSession) {
        StorageTypeEnum type = action.getColFamily().getNameStorageType();
        String colFamily = action.getColFamily().getColumnFamily();
        String table = lookupOrCreate(colFamily, ormSession);
        List<Column> s = action.getColumns();
        byte[] rowkey = action.getRowKey();
        byte[] nullArray  = StandardConverters.convertToBytes(SpiConstants.NULL_STRING_FORCQL3);
View Full Code Here


  }

  @Override
  public StorageTypeEnum getStorageType() {
    Class storageTypeClass = DboColumnMeta.classForName(itemType);
    StorageTypeEnum storageType = DboColumnMeta.getStorageType(storageTypeClass);
    return storageType;
  }
View Full Code Here

    Object id = fillInAndFetchId(entity);
    byte[] byteVal = converter.convertToNoSql(id);
    byte[] virtualKey = metaDbo.formVirtRowKey(byteVal);
    row.setKeys(byteVal, virtualKey);
   
    StorageTypeEnum storageType = metaDbo.getStorageType();
    addIndexInfo(info, id, byteVal, storageType);
    //NOTICE: there is no call to remove because if an id is changed, it is a new entity and we only need to add index not remove since
    //the old entity was not deleted during this save....we remove from index on remove of old entity only
  }
View Full Code Here

    } else if(formName(DecimalType.class, BytesType.class).equals(comparatorType)) {
      type = ColumnType.COMPOSITE_DECIMALPREFIX;
    }

    String keyValidationClass = def.getKeyValidationClass();
    StorageTypeEnum keyType = null;
    if(UTF8Type.class.getName().equals(keyValidationClass)) {
      keyType = StorageTypeEnum.STRING;
    } else if(DecimalType.class.getName().equals(keyValidationClass)) {
      keyType = StorageTypeEnum.DECIMAL;
    } else if(IntegerType.class.getName().equals(keyValidationClass)) {
View Full Code Here

    def = def.setName(colFamily)
          .setKeyspace(keysp);

    if (log.isInfoEnabled())
      log.info("keyspace="+def.getKeyspace()+" col family="+def.getName());
    StorageTypeEnum rowKeyType = meta.getIdColumnMeta().getStorageType();
    ColumnType colType = ColumnType.ANY_EXCEPT_COMPOSITE;
    if(meta.isVirtualCf()) {
      rowKeyType = StorageTypeEnum.BYTES;
    } else {
      StorageTypeEnum type = meta.getColNamePrefixType();
      def = addRowKeyValidation(meta, def);
      def = setColumnNameCompareType(meta, type, def);
     
      if(type == StorageTypeEnum.STRING)
        colType = ColumnType.COMPOSITE_STRINGPREFIX;
View Full Code Here

  }
 
  @Override
  public void removingEntity(InfoForIndex<OWNER> info, List<IndexData> indexRemoves, byte[] pk) {
    if (metaDbo.isIndexed()) {
      StorageTypeEnum storageType = getMetaDbo().getStorageType();
      addToList(info, pk, storageType, pk, indexRemoves);
    }
  }
View Full Code Here

 
  private ColumnFamilyDefinition setColumnNameCompareType(DboTableMeta cf,
      StorageTypeEnum type, ColumnFamilyDefinition def2) {
    ColumnFamilyDefinition def = def2;
    if(type == null) {
      StorageTypeEnum t = cf.getNameStorageType();
      if(t == StorageTypeEnum.STRING)
        def = def.setComparatorType("UTF8Type");
      else if(t == StorageTypeEnum.DECIMAL)
        def = def.setComparatorType("DecimalType");
      else if(t == StorageTypeEnum.INTEGER)
View Full Code Here

  private ColumnFamilyDefinition addRowKeyValidation(DboTableMeta cf,
      ColumnFamilyDefinition def2) {
    ColumnFamilyDefinition def = def2;
    DboColumnMeta idColumnMeta = cf.getIdColumnMeta();
    StorageTypeEnum rowKeyType = idColumnMeta.getStorageType();
    switch (rowKeyType) {
    case STRING:
      def = def.setKeyValidationClass("UTF8Type");
      break;
    case INTEGER:
View Full Code Here

      throw new IllegalStateException("Column family='"+colFamily+"' was not found AND we looked up meta data for this column" +
          " family to create it AND we could not find that data so we can't create it for you");
    }

    SortType sortType;
    StorageTypeEnum prefixType = cf.getColNamePrefixType();
    if(prefixType == null) {
      switch (cf.getNameStorageType()) {
      case BYTES:
        sortType = SortType.BYTES;
        break;
View Full Code Here

    byte[] byteVal = translateValue(value);
    byte[] colBytes = StandardConverters.convertToBytes(columnName);
    col.setName(colBytes);
    col.setValue(byteVal);
   
    StorageTypeEnum storageType = metaDbo.getStorageType();
    addIndexInfo(info, value, byteVal, storageType);
    removeIndexInfo(info, value, byteVal, storageType);
  }
View Full Code Here

TOP

Related Classes of com.alvazan.orm.api.z8spi.conv.StorageTypeEnum

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.