All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.ethlo.dachs.hibernate.HibernatePropertyChangeInterceptorBridge Maven / Gradle / Ivy

There is a newer version: 0.9.3
Show newest version
package com.ethlo.dachs.hibernate;

import java.io.Serializable;
import java.util.Iterator;

import org.hibernate.EmptyInterceptor;
import org.hibernate.type.Type;
import org.springframework.util.Assert;

public class HibernatePropertyChangeInterceptorBridge extends EmptyInterceptor
{
	private static final long serialVersionUID = 6375798402716022601L;

	private static HibernatePropertyChangeInterceptor instance;
	
	public static void setHibernatePropertyChangeInterceptor(HibernatePropertyChangeInterceptor instance)
	{
		HibernatePropertyChangeInterceptorBridge.instance = instance;
	}
	
	@Override
    public void postFlush(Iterator entities) 
	{
	    instance.postFlush(entities);
    }
	
	@Override
	public void onDelete(Object entity, Serializable id, Object[] state, String[] propertyNames, Type[] types)
	{
		Assert.notNull(instance);
		instance.onDelete(entity, id, state, propertyNames, types);
	}

	@Override
	public boolean onSave(Object entity, Serializable id, Object[] state, String[] propertyNames, Type[] types)
	{
		Assert.notNull(instance);
		return instance.onSave(entity, id, state, propertyNames, types);
	}

	@Override
	public boolean onFlushDirty(Object entity, Serializable id, Object[] currentState, Object[] previousState, String[] propertyNames, Type[] types) 
	{
		Assert.notNull(instance);
		return instance.onFlushDirty(entity, id, currentState, previousState, propertyNames, types);
	}
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy