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.
使用 Spring MVC/Roo 创建将在 ID 字段上搜索的查找器的最佳方法是什么?Finder 列表命令不会获取 ID,因为它是自动生成的,并且没有作为实体的一部分创建为字段
如果您有 ID,则从技术上讲,您是在阅读该对象,而不是“找到它”本身。Solubris 几乎是正确的。但是,正确的阅读存储库方法是repo.findOne(ID).
repo.findOne(ID)
repo.find(...)通过 ID 进行查找
repo.find(...)