@Override
	public boolean onSave(Object entity, Serializable id, Object[] state, String[] propertyNames, Type[] types) {
		boolean stateModified = false;
		
		if (entity instanceof Auditable) {
			for (int i=0; i<propertyNames.length; i++) {
				if ("created".equals(propertyNames[i])) {
					if (state[i] == null) {
						state[i] = new Date();
						stateModified = true;
						if (LOG.isDebugEnabled()) {
							LOG.debug("Setting 'created' property to current date on " + entity);
						}
					}
				}
				else if ("modified".equals(propertyNames[i])) {
					if (state[i] == null) {
						state[i] = new Date();
						stateModified = true;
						if (LOG.isDebugEnabled()) {
							LOG.debug("Setting 'modified' property to current date on " + entity);
						}
					}
				}
			}
		}
		return stateModified;
	}