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.
我有一个带有外键的简单域类
class A { Integer Id String name ... } class B { Integer Id A a }
我需要为 B 编写一个表单,用户只需输入名称。现在我通过读取保存中的参数并明确设置值来做到这一点bInstance.a = A.findByName(formParams.name)
bInstance.a = A.findByName(formParams.name)
有没有更清洁的方法来做到这一点?