Package com.alvazan.orm.api.base.anno

Examples of com.alvazan.orm.api.base.anno.NoSqlId


  @SuppressWarnings("unchecked")
  public <T> MetaIdField<T> processId(DboTableMeta t, Field field, MetaAbstractClass<T> metaClass) {

    Method idMethod = getIdMethod(field);
   
    NoSqlId idAnno = field.getAnnotation(NoSqlId.class);
    MetaIdField<T> metaField = idMetaProvider.get();
    KeyGenerator gen = null;
    if(idAnno.usegenerator()) {
      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()))
      columnName = idAnno.columnName();
   
    boolean isIndexed = false;
    if(field.isAnnotationPresent(NoSqlIndexed.class))
      isIndexed = true;
   
    if(field.isAnnotationPresent(NoSqlPartitionByThisField.class))
      throw new IllegalArgumentException("Field="+field+" is a primary key so it cannot have annotation="+NoSqlPartitionByThisField.class.getName());
   
    converter = lookupConverter(field, type, converter);
    if(converter == null)
      throw throwInvalidConverter(field);
    IdInfo info = new IdInfo();
    info.setIdMethod(idMethod);
    info.setConverter(converter);
    info.setGen(gen);
    info.setUseGenerator(idAnno.usegenerator());
    info.setMetaClass(metaClass);
    metaField.setup(t, info, field, columnName, isIndexed);
    return metaField;
  }
View Full Code Here


  @SuppressWarnings("unchecked")
  public <T> MetaIdField<T> processId(DboTableMeta t, Field field, MetaAbstractClass<T> metaClass) {

    Method idMethod = getIdMethod(field);
   
    NoSqlId idAnno = field.getAnnotation(NoSqlId.class);
    MetaIdField<T> metaField = idMetaProvider.get();
    KeyGenerator gen = null;
    if(idAnno.usegenerator()) {
      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()))
      columnName = idAnno.columnName();
   
    boolean isIndexed = false;
    if(field.isAnnotationPresent(NoSqlIndexed.class))
      isIndexed = true;
   
    if(field.isAnnotationPresent(NoSqlPartitionByThisField.class))
      throw new IllegalArgumentException("Field="+field+" is a primary key so it cannot have annotation="+NoSqlPartitionByThisField.class.getName());
   
    try {
      converter = lookupConverter(type, converter);
      IdInfo info = new IdInfo();
      info.setIdMethod(idMethod);
      info.setConverter(converter);
      info.setGen(gen);
      info.setUseGenerator(idAnno.usegenerator());
      info.setMetaClass(metaClass);
      metaField.setup(t, info, field, columnName, isIndexed);
      return metaField;
    } catch(IllegalArgumentException e)  {
      throw new IllegalArgumentException("No converter found for field='"+field.getName()+"' in class="
View Full Code Here

  @SuppressWarnings("unchecked")
  public <T> MetaIdField<T> processId(DboTableMeta t, Field field, MetaAbstractClass<T> metaClass) {

    Method idMethod = getIdMethod(field);
   
    NoSqlId idAnno = field.getAnnotation(NoSqlId.class);
    MetaIdField<T> metaField = idMetaProvider.get();
    KeyGenerator gen = null;
    if(idAnno.usegenerator()) {
      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()))
      columnName = idAnno.columnName();
   
    boolean isIndexed = false;
    if(field.isAnnotationPresent(NoSqlIndexed.class))
      isIndexed = true;
   
    if(field.isAnnotationPresent(NoSqlPartitionByThisField.class))
      throw new IllegalArgumentException("Field="+field+" is a primary key so it cannot have annotation="+NoSqlPartitionByThisField.class.getName());
   
    converter = lookupConverter(field, type, converter);
    if(converter == null)
      throw throwInvalidConverter(field);
    IdInfo info = new IdInfo();
    info.setIdMethod(idMethod);
    info.setConverter(converter);
    info.setGen(gen);
    info.setUseGenerator(idAnno.usegenerator());
    info.setMetaClass(metaClass);
    metaField.setup(t, info, field, columnName, isIndexed);
    return metaField;
  }
View Full Code Here

  @SuppressWarnings("unchecked")
  public <T> MetaIdField<T> processId(DboTableMeta t, Field field, MetaAbstractClass<T> metaClass) {

    Method idMethod = getIdMethod(field);
   
    NoSqlId idAnno = field.getAnnotation(NoSqlId.class);
    MetaIdField<T> metaField = idMetaProvider.get();
    KeyGenerator gen = null;
    if(idAnno.usegenerator()) {
      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()))
      columnName = idAnno.columnName();
   
    boolean isIndexed = false;
    if(field.isAnnotationPresent(NoSqlIndexed.class))
      isIndexed = true;
   
    if(field.isAnnotationPresent(NoSqlPartitionByThisField.class))
      throw new IllegalArgumentException("Field="+field+" is a primary key so it cannot have annotation="+NoSqlPartitionByThisField.class.getName());
   
    converter = lookupConverter(field, type, converter);
    if(converter == null)
      throw throwInvalidConverter(field);
    IdInfo info = new IdInfo();
    info.setIdMethod(idMethod);
    info.setConverter(converter);
    info.setGen(gen);
    info.setUseGenerator(idAnno.usegenerator());
    info.setMetaClass(metaClass);
    metaField.setup(t, info, field, columnName, isIndexed);
    return metaField;
  }
View Full Code Here

  @SuppressWarnings("unchecked")
  public <T> MetaIdField<T> processId(DboTableMeta t, Field field, MetaAbstractClass<T> metaClass) {

    Method idMethod = getIdMethod(field);
   
    NoSqlId idAnno = field.getAnnotation(NoSqlId.class);
    MetaIdField<T> metaField = idMetaProvider.get();
    KeyGenerator gen = null;
    if(idAnno.usegenerator()) {
      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()))
      columnName = idAnno.columnName();
   
    boolean isIndexed = false;
    if(field.isAnnotationPresent(NoSqlIndexed.class))
      isIndexed = true;
   
    if(field.isAnnotationPresent(NoSqlPartitionByThisField.class))
      throw new IllegalArgumentException("Field="+field+" is a primary key so it cannot have annotation="+NoSqlPartitionByThisField.class.getName());
   
    converter = lookupConverter(field, type, converter);
    if(converter == null)
      throw throwInvalidConverter(field);
    IdInfo info = new IdInfo();
    info.setIdMethod(idMethod);
    info.setConverter(converter);
    info.setGen(gen);
    info.setUseGenerator(idAnno.usegenerator());
    info.setMetaClass(metaClass);
    metaField.setup(t, info, field, columnName, isIndexed);
    return metaField;
  }
View Full Code Here

  @SuppressWarnings("unchecked")
  public <T> MetaIdField<T> processId(DboTableMeta t, Field field, MetaAbstractClass<T> metaClass) {

    Method idMethod = getIdMethod(field);
   
    NoSqlId idAnno = field.getAnnotation(NoSqlId.class);
    MetaIdField<T> metaField = idMetaProvider.get();
    KeyGenerator gen = null;
    if(idAnno.usegenerator()) {
      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()))
      columnName = idAnno.columnName();
   
    boolean isIndexed = false;
    if(field.isAnnotationPresent(NoSqlIndexed.class))
      isIndexed = true;
   
    if(field.isAnnotationPresent(NoSqlPartitionByThisField.class))
      throw new IllegalArgumentException("Field="+field+" is a primary key so it cannot have annotation="+NoSqlPartitionByThisField.class.getName());
   
    converter = lookupConverter(field, type, converter);
    if(converter == null)
      throw throwInvalidConverter(field);
    IdInfo info = new IdInfo();
    info.setIdMethod(idMethod);
    info.setConverter(converter);
    info.setGen(gen);
    info.setUseGenerator(idAnno.usegenerator());
    info.setMetaClass(metaClass);
    metaField.setup(t, info, field, columnName, isIndexed);
    return metaField;
  }
View Full Code Here

  @SuppressWarnings("unchecked")
  public <T> MetaIdField<T> processId(DboTableMeta t, Field field, MetaAbstractClass<T> metaClass) {

    Method idMethod = getIdMethod(field);
   
    NoSqlId idAnno = field.getAnnotation(NoSqlId.class);
    MetaIdField<T> metaField = idMetaProvider.get();
    KeyGenerator gen = null;
    if(idAnno.usegenerator()) {
      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()))
      columnName = idAnno.columnName();
   
    boolean isIndexed = false;
    if(field.isAnnotationPresent(NoSqlIndexed.class))
      isIndexed = true;
   
    if(field.isAnnotationPresent(NoSqlPartitionByThisField.class))
      throw new IllegalArgumentException("Field="+field+" is a primary key so it cannot have annotation="+NoSqlPartitionByThisField.class.getName());
   
    converter = lookupConverter(field, type, converter);
    if(converter == null)
      throw throwInvalidConverter(field);
    IdInfo info = new IdInfo();
    info.setIdMethod(idMethod);
    info.setConverter(converter);
    info.setGen(gen);
    info.setUseGenerator(idAnno.usegenerator());
    info.setMetaClass(metaClass);
    metaField.setup(t, info, field, columnName, isIndexed);
    return metaField;
  }
View Full Code Here

TOP

Related Classes of com.alvazan.orm.api.base.anno.NoSqlId

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.