Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
public void registerCustomer(Customer cust) { customerRepo.save(cust); }
我怎么知道我的数据已成功插入到上面的代码中?
这是来自 CrudReporsitory.save() javadoc:
保存给定的实体。使用返回的实例进行进一步的操作,因为保存操作可能已经完全改变了实体实例。
似乎 save 方法返回了保存的实体实例。