- I have searched the issues of this repository and believe that this is not a duplicate.
- I have checked the FAQ of this repository and believe that this is not a duplicate.
environment
- canal version
- mysql version
Issue Description
实现改接口 对象id获取不到,int类型不支持,换成String 就可以
``
@CanalTable(value = "test_one")
@Component
@Slf4j
public class TestOneHandler implements EntryHandler<TestOne> {
@Override
public void insert(TestOne testOne) {
log.info("insert message {}", testOne);
}
@Override
public void update(TestOne before, TestOne after) {
log.info("update message before{}", before);
log.info("update message after{}", after);
}
@Override
public void delete(TestOne testOne) {
log.info("delete message after{}", testOne);
}
}
2条答案
按热度按时间1szpjjfi1#
问题描述不清楚,CanalTable是你自己封装的?
sqserrrh2#
创建和数据库想对应的对象,然后实现EntryHandler方法,对象的主键ID int 类型获取不到,换成String类型的就可以,这样还不清楚??? @CanalTable这个是 这个依赖自带的
<dependency> <groupId>top.javatool</groupId> <artifactId>canal-spring-boot-starter</artifactId> <version>1.2.1-RELEASE</version> </dependency>