com.bixuebihui.jdbc.event.LogAfterChangeEventHandler Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of c-dbtools Show documentation
Show all versions of c-dbtools Show documentation
a fast small database connection pool and a active record flavor mini framework
package com.bixuebihui.jdbc.event;
import com.bixuebihui.jdbc.IPrimaryKeyedTable;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import java.util.function.Consumer;
/**
* @author xwx
*/
public class LogAfterChangeEventHandler extends BaseAfterChangeEventHandler {
static final Logger log = LoggerFactory.getLogger(LogAfterChangeEventHandler.class);
ChangeEventConsumer handler = (ChangeEvent e) -> {
log.info(String.valueOf(e));
};
public LogAfterChangeEventHandler(IPrimaryKeyedTable dbOperator) {
super(dbOperator);
}
@Override
public void sendEvent(ChangeEvent e) {
handler.accept(e);
}
@Autowired(required = false)
public void setHandler(ChangeEventConsumer handler) {
this.handler = handler;
}
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy