package com.microstar.tap3.db;


import org.hibernate.envers.RevisionListener;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import com.microstar.tap3.util.ConfigSingleton;

public class CustomRevisionListener implements RevisionListener
{
	public static Logger LOG = LoggerFactory.getLogger(CustomRevisionListener.class);

	public void newRevision(Object revisionEntity) {
		String identity = ConfigSingleton.getInstance().getIdentity();
		LOG.debug("CustomRevisionListener::identity: " + identity);
		CustomRevisionInfo rev = (CustomRevisionInfo) revisionEntity;
		
		rev.setUserId(identity);
	}

}
