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

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


    cursor.setupMore(hTable, colFamily, info, cache);
    return cursor;
  }

  private void persist(Persist action, MetaLookup ormSession) {
    StorageTypeEnum type = action.getColFamily().getNameStorageType();
    String colFamily = action.getColFamily().getColumnFamily();
    Info info = lookupOrCreate(colFamily, ormSession);
    HColumnDescriptor hColFamily = info.getColFamily();
    byte[] rowKey = action.getRowKey();
    Put put = new Put(rowKey);
View Full Code Here


  }
 
  @Override
  public String getIndexTableName() {
    DboColumnIdMeta idMeta = fkToColumnFamily.getIdColumnMeta();
    StorageTypeEnum storageType = idMeta.getStorageType();
    return storageType.getIndexTableName();
  }
View Full Code Here

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

    Object id = classMeta.fetchId((PROXY) fieldsValue);
    return classMeta.getIdField().getConverter().convertTypeToString(id);
  }
 
  private StorageTypeEnum getStorageType() {
    StorageTypeEnum storageType = classMeta.getIdField().getMetaIdDbo().getStorageType();
    return storageType;
  }
View Full Code Here

//    Class typeInTheArray = fkToColumnFamily.getIdColumnMeta().getClassType();
  }

  @Override
  public StorageTypeEnum getStorageType() {
    StorageTypeEnum typeInTheArray = fkToColumnFamily.getIdColumnMeta().getStorageType();
    return typeInTheArray;
  }
View Full Code Here

    if(colNamePrefixType == null) {
      this.colNamePrefixType = null;
      return;
    }
   
    StorageTypeEnum storedType = colNamePrefixType.getStoredType();
    this.colNamePrefixType = storedType.getDbValue();
  }
View Full Code Here

  }

  private static TypeInfo processConstant(ExpressionNode node, InfoForWiring wiring, TypeInfo typeInfo) {
    String constant = node.getASTNode().getText();
   
    StorageTypeEnum ourType;
    if(node.getType() == NoSqlLexer.DECIMAL || node.getType() == NoSqlLexer.DEC_VAL){
      ourType = StorageTypeEnum.DECIMAL;
      BigDecimal dec = new BigDecimal(constant);
      node.setState(dec, constant);
    } else if(node.getType() == NoSqlLexer.STR_VAL){
      String withoutQuotes = constant.substring(1, constant.length()-1);   
      ourType = StorageTypeEnum.STRING;
      node.setState(withoutQuotes, constant);
    } else if(node.getType() == NoSqlLexer.INT_VAL){
      ourType = StorageTypeEnum.INTEGER;
      BigInteger bigInt = new BigInteger(constant);
      node.setState(bigInt, constant);
    } else if(node.getType() == NoSqlLexer.BOOL_VAL) {
      ourType = StorageTypeEnum.BOOLEAN;
      boolean boolVal = Boolean.parseBoolean(constant);
      node.setState(boolVal, constant);
    } else if(node.getType() == NoSqlLexer.NULL) {
      ourType = StorageTypeEnum.NULL;
      node.setState(null, constant);
    }
     
    else
      throw new RuntimeException("bug, not supported type(please fix)="+node.getType());
   
    if(typeInfo == null) //no types to check against so return...
      return new TypeInfo(ourType);

    //we must compare type info so this next stuff is pure validation
    if(typeInfo.getColumnInfo() != null) {
      validateTypes(wiring, ourType, typeInfo);
    } else {
      StorageTypeEnum constantType = typeInfo.getConstantType();
      if(constantType != ourType)
        throw new IllegalArgumentException("Types do not match in namedquery="+wiring.getQuery());
    }
    return null;
  }
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

    ColumnFamilyDefinition def = cluster.makeColumnFamilyDefinition()
          .setName(colFamily)
          .setKeyspace(keysp);

    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

 
  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

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.