You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@Data
@Accessors(chain = true)
@Table(name = "articles")
public class Article {
@Id
private Long id;
private String name;
private String body;
@Column(name = "abstract")
private String abstractInfo;
...
dao/ArticleMapper.java
public interface ArticleMapper extends Mapper<Article> {
@Select("select * from articles where name = #{name}")
Collection<Article> findByName(String name);
...
但是使用 selectByExample 方法查询数据是可以正常获取 abstractInfo 这个属性值,对比发现其查询语句为 select id,name,body,abstract from articles where name = ?
当我使用自定义的查询
ArticleMapper#findByName
查出数据发现abstractInfo
这个属性信息为 null。重现步骤:
有以下 po 和 dao:
po/Article.java
dao/ArticleMapper.java
但是使用
selectByExample
方法查询数据是可以正常获取abstractInfo
这个属性值,对比发现其查询语句为select id,
name,body,abstract from articles where name = ?
请问一下有办法可以不自己指定全部字段也能实现自动封装
@Column
注解的属性值吗?测试环境版本:
The text was updated successfully, but these errors were encountered: