Package info.archinnov.achilles.exception

Examples of info.archinnov.achilles.exception.AchillesException


        for (PropertyMeta propertyMeta : meta.getAllMetasExceptCounters()) {
            if (propertyMeta.getCQL3ColumnName().equals(cql3Name) ) {
                return propertyMeta;
            }
        }
        throw new AchillesException(String.format("Cannot find matching property meta for the cql3 field %s", cql3Name));
    }
View Full Code Here


    public <T> T instantiate(Class<T> entityClass) {
        try {
            return entityClass.newInstance();
        } catch (InstantiationException e) {
            throw new AchillesException("Cannot instantiate class of type " + entityClass.getCanonicalName()+", did you forget to declare a default constructor ?",e);
        } catch (IllegalAccessException e) {
            throw new AchillesException("Cannot instantiate class of type " + entityClass.getCanonicalName()+", did you forget to declare a default constructor ?",e);
        }
    }
View Full Code Here

        }
    if (entity != null) {
      try {
        return accessor.getValueFromField(field, entity);
      } catch (IllegalAccessException | IllegalArgumentException e) {
        throw new AchillesException("Cannot get primary key from field '" + field.getName() + "' of type '"
            + field.getDeclaringClass().getCanonicalName() + "' from entity '" + entity + "'", e);
      }
    }
    return null;
  }
View Full Code Here

    if (target != null) {
      try {
        value = accessor.getValueFromField(field, target);
      } catch (IllegalAccessException | IllegalArgumentException e) {
        throw new AchillesException("Cannot get value from field '" + field.getName() + "' of type '"
            + field.getDeclaringClass().getCanonicalName() + "' on instance '" + target + "'", e);
      }
    }
    log.trace("Found value : {}", value);
    return value;
View Full Code Here

    if (target != null) {
      try {
        value = getter.invoke(target);
      } catch (Exception e) {
        throw new AchillesException("Cannot invoke '" + getter.getName() + "' of type '"
            + getter.getDeclaringClass().getCanonicalName() + "' on instance '" + target + "'", e);
      }
    }

    log.trace("Found value : {}", value);
View Full Code Here

    }
    if (target != null) {
      try {
        accessor.setValueToField(field, target, args);
      } catch (IllegalAccessException | IllegalArgumentException e) {
        throw new AchillesException("Cannot set value to field '" + field.getName() + "' of type '"
            + field.getType().getCanonicalName() + "' on instance '" + target + "'", e);
      }
    }
  }
View Full Code Here

    public <T> T invokeOnRowForType(Row row, Class<T> type, String name) {
        log.trace("Extract property {} of type {} from CQL row ", name, type);
        try {
            return (T) getRowMethod(type).invoke(row, name);
        } catch (Exception e) {
            throw new AchillesException("Cannot retrieve column '" + name + "' of type '" + type.getCanonicalName()
                    + "' from CQL Row", e);
        }
    }
View Full Code Here

            case SET:
                return meta.getSetCodec().decode((Set) fromCassandra);
            case MAP:
                return meta.getMapCodec().decode((Map) fromCassandra);
            default:
                throw new AchillesException(String.format("Cannot decode value '%s' from CQL3 for property '%s' of type '%s'", fromCassandra, meta.propertyName, meta.type().name()));
        }
    }
View Full Code Here

            case MAP:
                return (T)meta.getMapCodec().encode((Map) fromJava);
            case COUNTER:
                return (T)((InternalCounterImpl) fromJava).getInternalCounterDelta();
            default:
                throw new AchillesException(String.format("Cannot encode value '%s' to CQL3 for property '%s' of type '%s'",fromJava, meta.propertyName, meta.type().name()));
        }
    }
View Full Code Here

            return String.class.cast(object);
        } else {
            try {
                return this.meta.defaultJacksonMapperForCounter.writeValueAsString(object);
            } catch (Exception e) {
                throw new AchillesException(String.format("Error while encoding primary key '%s' for class '%s'", object, meta.getEntityClassName()), e);
            }
        }
    }
View Full Code Here

TOP

Related Classes of info.archinnov.achilles.exception.AchillesException

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.