@Override
public void bind(final SQLStatement<?> q, final EntityHistoryBinder bind, final EntityHistoryModelDao<M, E> history) {
try {
final M arg = history.getEntity();
final BeanInfo infos = Introspector.getBeanInfo(arg.getClass());
final PropertyDescriptor[] props = infos.getPropertyDescriptors();
for (final PropertyDescriptor prop : props) {
q.bind(prop.getName(), prop.getReadMethod().invoke(arg));
}
q.bind("id", history.getId());
q.bind("targetRecordId", history.getTargetRecordId());
q.bind("changeType", history.getChangeType().toString());
} catch (IntrospectionException e) {
logger.warn(e.getMessage());
} catch (InvocationTargetException e) {
logger.warn(e.getMessage());
} catch (IllegalAccessException e) {
logger.warn(e.getMessage());
}
}
};