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

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


   
    return metaField;
  }

  private Converter lookupConverter(Field field, Class<?> type) {
    Converter converter = lookupConverter(field, type, null);
    if(converter == null)
      throw new IllegalArgumentException("We found no converters(customer or standard for type="
          +type.getSimpleName()+" and this class is not annotated with " +
              "@NoSqlEmbeddable either.  The field that caused this issue is field="+field);
    return converter;
View Full Code Here


    throw new UnsupportedOperationException();
  }

    private byte[] getBytesValue(Object value, NoSqlConverter customConv) {
        Class<? extends Converter> convClazz = customConv.converter();
        Converter converter = ReflectionUtil.create(convClazz);
        return converter.convertToNoSql(value);
    }
View Full Code Here

        return converter.convertToNoSql(value);
    }

    private Object getValue(byte[] value, NoSqlConverter customConv) {
        Class<? extends Converter> convClazz = customConv.converter();
        Converter converter = ReflectionUtil.create(convClazz);
        return converter.convertFromNoSql(value);
    }
View Full Code Here

  public byte[] convertEntityToId(T value) {
    if(value == null)
      return null;
    MetaIdField idField = getIdField();
    Object id = fetchId(value);
    Converter converter = idField.getConverter();
    return converter.convertToNoSql(id);   
  }
View Full Code Here

  public Tuple<T> convertIdToProxy(Row row, NoSqlSession session, byte[] nonVirtKey, CacheLoadCallback cacheLoadCallback) {
    Tuple<T> t = new Tuple<T>();
    if(nonVirtKey == null)
      return t;
    MetaIdField<T> idField = this.getIdField();
    Converter converter = idField.getConverter();

    Object entityId = converter.convertFromNoSql(nonVirtKey);
    T proxy = idField.convertIdToProxy(session, entityId, cacheLoadCallback);
    t.setEntityId(entityId);
    t.setProxy(proxy);
   
    return t;
View Full Code Here

    CursorProxy<PROXY> cursor = new CursorProxy<PROXY>(entity, session, indexCursor, classMeta, batchSize);
    ReflectionUtil.putFieldValue(entity, field, cursor);
  }

  private String formRowKey(byte[] byteKey) {
    Converter converter = ownerMeta.getIdField().getConverter();
    Object objKey = converter.convertFromNoSql(byteKey);
    String keyAsStr = converter.convertTypeToString(objKey);
   
    //We ALWAYS ignore partition in this case since this index row is ALWAYS tied to this row period...moving it all
    //would be a pain and be useless...
    String rowKey = getMetaDbo().getIndexRowKey(null, null)+"/"+keyAsStr;
    return rowKey;
View Full Code Here

      Class<? extends KeyGenerator> generation = idAnno.generation();
      gen = ReflectionUtil.create(generation);
    }
   
    Class<?> type = field.getType();
    Converter converter = null;
    if(!NoConversion.class.isAssignableFrom(idAnno.customConverter()))
      converter = ReflectionUtil.create(idAnno.customConverter());
   
    String columnName = field.getName();
    if(!"".equals(idAnno.columnName()))
View Full Code Here

    boolean isPartitioned = false;
    if(field.isAnnotationPresent(NoSqlPartitionByThisField.class))
      isPartitioned = true;
     
    Class<?> type = field.getType();
    Converter converter = null;
    if(col != null && !NoConversion.class.isAssignableFrom(col.customConverter()))
      converter = ReflectionUtil.create(col.customConverter());

    converter = lookupConverter(field, type, converter);
    if(converter == null)
View Full Code Here

      MetaAbstractClass<?> fkMeta = metaInfo.findOrCreate(type);
      MetaEmbeddedEntity temp = metaEmbeddedProvider.get();
      temp.setup(t, field, colName, fkMeta);
      metaField = temp;
    } else {
      Converter converter = lookupConverter(field, type, null);
      if(converter == null)
        throw new IllegalArgumentException("We found no converters(customer or standard for type="
            +type.getSimpleName()+" and this class is not annotated with " +
                "@NoSqlEmbeddable either.  The field that caused this issue is field="+field);
     
View Full Code Here

      Class<? extends KeyGenerator> generation = idAnno.generation();
      gen = ReflectionUtil.create(generation);
    }
   
    Class<?> type = field.getType();
    Converter converter = null;
    if(!NoConversion.class.isAssignableFrom(idAnno.customConverter()))
      converter = ReflectionUtil.create(idAnno.customConverter());
   
    String columnName = field.getName();
    if(!"".equals(idAnno.columnName()))
View Full Code Here

TOP

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

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.