if ((obj != null) && (obj instanceof Entity)) {
Entity<?> entity = (Entity<?>) obj;
BeanDescriptor beanDescriptor = new BeanDescriptorBuilder(entity.getClass()).getBeanDescriptor();
PropertyDescriptor propertyDescriptor = beanDescriptor.getProperty(EntityInterceptor.ENTITY_ID);
Class<?> clazz = propertyDescriptor.getType();
try {
Constructor<?> contructor = clazz.getConstructor(new Class[] { String.class });
Object fieldValue = contructor.newInstance(new Object[] { value });
RockFrameworkLogger.getLogger().info("Setting entity ID " + entityName + "[" + fieldValue + "]");
propertyDescriptor.setValue(entity, fieldValue);
} catch (NoSuchMethodException e) {
RockFrameworkLogger.getLogger().warn("Could not find constructor " + entity.getClass().getCanonicalName() + "(String). Parameter not setted");
} catch (Exception e) {
RockFrameworkLogger.getLogger().warn("Error in constructor " + entity.getClass().getCanonicalName() + "(String)");
RockFrameworkLogger.getLogger().warn(e.getMessage(), e);