{
List<Field> declaredFields = ReflectionUtils.getInheritedFields(pojo.getClass());
for (Field declaredField : declaredFields)
{
Key keyAnnotation = declaredField.getAnnotation(Key.class);
Parent parentAnnotation = declaredField.getAnnotation(Parent.class);
if (keyAnnotation != null)
{
ReflectionUtils.setProperty(pojo, declaredField.getName(), keyFieldName);
}
if (parentAnnotation != null)
{
Object value = parent;
if (!parentAnnotation.property().isEmpty())
{
try
{
value = PropertyUtils.getProperty(parent, parentAnnotation.property());
}
catch (IllegalAccessException e)
{
throw new RuntimeException(e);
}