com.discursive.dao.generic.spring.TimestampingAdvisor Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of generic-dao Show documentation
Show all versions of generic-dao Show documentation
A generics DAO pattern/library
The newest version!
package com.discursive.dao.generic.spring;
import org.springframework.aop.ClassFilter;
import org.springframework.aop.support.DefaultIntroductionAdvisor;
import com.discursive.dao.generic.GenericDao;
public class TimestampingAdvisor extends DefaultIntroductionAdvisor {
private static final long serialVersionUID = -3761487756824571846L;
public TimestampingAdvisor() {
super(new TimestampingInterceptor());
}
@Override
public ClassFilter getClassFilter() {
return new ClassFilter() {
@SuppressWarnings("unchecked")
public boolean matches(Class clazz) {
boolean isGenericDao = GenericDao.class.isAssignableFrom( clazz );
return isGenericDao;
}
};
}
}