@Override public void bind(final SQLStatement<?> q, final EntityHistoryBinder bind, final EntityHistoryModelDao<M, E> history) { try { // Emulate @SmartBindBean 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()); } } };
@Override public void bind(final SQLStatement<?> q, final EntityHistoryBinder bind, final EntityHistoryModelDao<M, E> history) { try { // Emulate @SmartBindBean 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()); } } };
public AuditLogJson(final AuditLog auditLog) { this(auditLog.getChangeType().toString(), auditLog.getCreatedDate(), auditLog.getAuditedObjectType(), auditLog.getAuditedEntityId(), auditLog.getUserName(), auditLog.getReasonCode(), auditLog.getComment(), auditLog.getUserToken(), null); }
public AuditLogJson(final AuditLogWithHistory auditLogWithHistory) { this(auditLogWithHistory.getChangeType().toString(), auditLogWithHistory.getCreatedDate(), auditLogWithHistory.getAuditedObjectType(), auditLogWithHistory.getAuditedEntityId(), auditLogWithHistory.getUserName(), auditLogWithHistory.getReasonCode(), auditLogWithHistory.getComment(), auditLogWithHistory.getUserToken(), auditLogWithHistory.getEntity()); }