Caused by: org.apache.ibatis.ognl.OgnlException: from [java.lang.NullPointerException: Cannot invoke "com.baomidou.mybatisplus.core.metadata.TableInfo.getTableName()" because the return value of "com.baomidou.mybatisplus.core.metadata.TableInfoHelper.getTableInfo(java.lang.Class)" is null]
Caused by: java.lang.NullPointerException: Cannot invoke "com.baomidou.mybatisplus.core.metadata.TableInfo.getTableName()" because the return value of "com.baomidou.mybatisplus.core.metadata.TableInfoHelper.getTableInfo(java.lang.Class)" is null
已经在entity上加了@TableName
表如下
@Data
@TableName("table_a")
public class TableA {
@TableId(type = IdType.AUTO)
private Long id;
private String name;
}
@Data
@TableName("table_b")
public class TableB {
@TableId(type = IdType.AUTO)
private Long id;
private String name;
}
@Data
@TableName("table_a_b")
public class TableAB{
private Long aId;
private Long bId;
}
查询
var page = new Page<TableA>(1, 2);
var pages = TableAMapper.selectJoinPage(page, TableA.class, new MPJLambdaWrapper<TableA>()
.selectAll(TableA.class)
.leftJoin(TableAB.class, TableAB::getAId, TableA::getId)
.leftJoin(TableB.class, TableB::getId, TableAB::getBId));
jdk:
openjdk 17.0.4.1 2022-08-12 LTS
OpenJDK Runtime Environment Corretto-17.0.4.9.1 (build 17.0.4.1+9-LTS)
OpenJDK 64-Bit Server VM Corretto-17.0.4.9.1 (build 17.0.4.1+9-LTS, mixed mode, sharing)
多对多查询,三表left join,出现以下问题
已经在entity上加了@TableName
表如下
查询
jdk:
mybatis plus 、mybatis plus join 、spring boot 版本