Examples of ApitraryOrmIdException


Examples of com.apitrary.orm.core.exception.ApitraryOrmIdException

    T result = (T) new GetResponseUnmarshaller(this).unMarshall(response, entity);

    if (result != null) {
      List<Field> fields = ClassUtil.getAnnotatedFields(entity, Id.class);
      if (fields.isEmpty() || fields.size() > 1) {
        throw new ApitraryOrmIdException("Illegal amount of annotated id properties of class " + entity.getClass().getName());
      } else {
        ClassUtil.setSilent(result, fields.get(0).getName(), id);
      }
    }
    return result;
View Full Code Here

Examples of com.apitrary.orm.core.exception.ApitraryOrmIdException

    }

    java.lang.reflect.Field field = fields.get(0);
    String id = ClassUtil.getValueOf(field, entity, entity.getClass(), String.class);
    if (id == null || id.isEmpty()) {
      throw new ApitraryOrmIdException("Entity lacks ID and is probably not persisted.");
    }
    return id;
  }
View Full Code Here

Examples of com.apitrary.orm.core.exception.ApitraryOrmIdException

    log.trace(fieldName + " " + text);

    if ("_id".equals(fieldName)) {
      List<java.lang.reflect.Field> fields = ClassUtil.getAnnotatedFields(entity.getClass(), Id.class);
      if (fields.isEmpty() || fields.size() > 1) {
        throw new ApitraryOrmIdException("Illegal amount of annotated id properties of class " + entity.getClass().getName());
      } else {
        ClassUtil.setSilent(this.entity, fields.get(0).getName(), text);
      }
    }
  }
View Full Code Here

Examples of com.apitrary.orm.core.exception.ApitraryOrmIdException

    if (resultStarted && entityStarted) {
      if (!idFound) {
        List<java.lang.reflect.Field> fields = ClassUtil.getAnnotatedFields(getEntityInstance().getClass(), Id.class);
        if (fields.isEmpty() || fields.size() > 1) {
          throw new ApitraryOrmIdException("Illegal amount of annotated id properties of class " + getEntityInstance().getClass().getName());
        } else {
          ClassUtil.setSilent(getEntityInstance(), fields.get(0).getName(), text);
          idFound = true;
        }
      } else if (text != null && idFound) {
View Full Code Here

Examples of com.apitrary.orm.core.exception.ApitraryOrmIdException

    log.trace(fieldName + " " + text);

    if ("_id".equals(fieldName)) {
      List<java.lang.reflect.Field> fields = ClassUtil.getAnnotatedFields(entity.getClass(), Id.class);
      if (fields.isEmpty() || fields.size() > 1) {
        throw new ApitraryOrmIdException("Illegal amount of annotated id properties of class " + entity.getClass().getName());
      } else {
        ClassUtil.setSilent(this.entity, fields.get(0).getName(), text);
      }
    }
  }
View Full Code Here

Examples of com.apitrary.orm.core.exception.ApitraryOrmIdException

    T result = (T) new GetResponseUnmarshaller(this).unMarshall(response, entity);

    if (result != null) {
      List<Field> fields = ClassUtil.getAnnotatedFields(entity, Id.class);
      if (fields.isEmpty() || fields.size() > 1) {
        throw new ApitraryOrmIdException("Illegal amount of annotated id properties of class " + entity.getClass().getName());
      } else {
        ClassUtil.setSilent(result, fields.get(0).getName(), id);
      }
    }
    return result;
View Full Code Here

Examples of com.apitrary.orm.core.exception.ApitraryOrmIdException

    }

    java.lang.reflect.Field field = fields.get(0);
    String id = ClassUtil.getValueOf(field, entity, entity.getClass(), String.class);
    if (id == null || id.isEmpty()) {
      throw new ApitraryOrmIdException("Entity lacks ID and is probably not persisted.");
    }
    return id;
  }
View Full Code Here

Examples of com.apitrary.orm.core.exception.ApitraryOrmIdException

    if (resultStarted && entityStarted) {
      if (!idFound) {
        List<java.lang.reflect.Field> fields = ClassUtil.getAnnotatedFields(getEntityInstance().getClass(), Id.class);
        if (fields.isEmpty() || fields.size() > 1) {
          throw new ApitraryOrmIdException("Illegal amount of annotated id properties of class " + getEntityInstance().getClass().getName());
        } else {
          ClassUtil.setSilent(getEntityInstance(), fields.get(0).getName(), text);
          idFound = true;
        }
      } else if (text != null && idFound) {
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.