Code example for EmptyInterceptor

Methods: changeProperties

0
			if (log.isDebugEnabled()) {
				log.debug("Setting changed by fields on " + entity.getClass());
			} 
			 
			HashMap<String, Object> propertyValues = getPropertyValuesToUpdate();
			objectWasChanged = changeProperties(currentState, propertyNames, objectWasChanged, propertyValues, false);
		} 
		return objectWasChanged;
	} 
	 
	/** 
	 * Sets the creator and dateCreated fields to the current user and the current time if they are 
	 * null. 
	 * if is a Person Object, sets the personCreator and personDateCreated fields to the current user and the current time 
	 * if they are null. 
	 * 
	 * @param entity 
	 * @param currentState 
	 * @param propertyNames 
	 * @return true if creator and dateCreated were changed 
	 */ 
	private boolean setCreatorAndDateCreatedIfNull(Object entity, Object[] currentState, String[] propertyNames) {
		 
		boolean objectWasChanged = false;
		 
		if (entity instanceof OpenmrsObject) { 
			if (log.isDebugEnabled()) {
				log.debug("Setting creator and dateCreated on " + entity);
			} 
			 
			HashMap<String, Object> propertyValues = getPropertyValuesToSave();
			objectWasChanged = changeProperties(currentState, propertyNames, objectWasChanged, propertyValues, true);
		} 
		return objectWasChanged;
	} 
	 
	private boolean changeProperties(Object[] currentState, String[] propertyNames, boolean objectWasChanged,
Connect your IDE to all the code out there  Get Codota for Java