org.hibernate.envers.event.spi.EnversListenerDuplicationStrategy Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of hibernate-envers Show documentation
Show all versions of hibernate-envers Show documentation
Hibernate's entity version (audit/history) support
/*
* Hibernate, Relational Persistence for Idiomatic Java
*
* License: GNU Lesser General Public License (LGPL), version 2.1 or later.
* See the lgpl.txt file in the root directory or .
*/
package org.hibernate.envers.event.spi;
import org.hibernate.event.service.spi.DuplicationStrategy;
/**
* Event listener duplication strategy for envers
*
* @author Steve Ebersole
*/
public class EnversListenerDuplicationStrategy implements DuplicationStrategy {
/**
* Singleton access
*/
public static final EnversListenerDuplicationStrategy INSTANCE = new EnversListenerDuplicationStrategy();
@Override
public boolean areMatch(Object listener, Object original) {
return listener.getClass().equals( original.getClass() ) && EnversListener.class.isInstance( listener );
}
@Override
public Action getAction() {
return Action.KEEP_ORIGINAL;
}
}