今天在写一个很简单的Demo的时候,遇到了这个问题is in unnamed module of loader 'app'。
先说解决方法:若pom中有引入 spring-boot-devtools ,将其注释后重启。
以下是我自己遇到的代码情况
@RequestMapping("/get")
public R<List<DiaryRespVO>> getDiary() {
List<Diary> list = diaryService.list();
System.out.println(list);
Diary diary = list.get(0);
System.out.println(diary);
return R.ok(null);
}
@Data
@AllArgsConstructor
@NoArgsConstructor
@Table("diary")
public class Diary {
@Id(keyType = KeyType.Auto)
private Long id;
private String content;
@Column(typeHandler = JacksonTypeHandler.class)
private List<String> pictureList;
@Column(isLogicDelete = true)
private Boolean delFlag;
@Column(onInsertValue = "now()")
private Date createTime;
@Column(onUpdateValue = "now()", onInsertValue = "now()")
private Date updateTime;
@Column(version = true)
private Integer version;
}