我正在创建一个带有登录页面的待办事项列表,其中有一个两个输入表作为名称,名称中的事物,事物不向服务器发送数据这是存储库...public interface TodosRepository extends CrudRepository<Todos, Long> { Todos findByName(String name,String things); List<Todos> findByCompletedAndUserId(boolean complated, Long Id);}这是我的实体@Entitypublic class Todos { @Id @GeneratedValue(strategy = GenerationType.IDENTITY) private Long id; private String things; private String name; private boolean completed; @ManyToOne(fetch = FetchType.LAZY) @JoinColumn(name = "user_id") private User user; public Todos() { } public Todos(String name,String things, boolean completed) { this.things = things; this.name = name; this.completed = completed; } public String getThings() { return things; } public void setThings(String things) { this.things = things; } public Long getId() { return id; } public void setId(Long id) { this.id = id; } public String getName() { return name; } public void setName(String name) { this.name = name; } public boolean isCompleted() { return completed; } public void setCompleted(boolean completed) { this.completed = completed; } public User getUser() { return user; } public void setUser(User user) { this.user = user; } @Override public String toString() { return "Todos [id=" + id + ", name=" + name + ",things=" + things +", completed=" + completed + "]"; }}java.util.NoSuchElementException:null
添加回答
举报
0/150
提交
取消