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)
これを行うためのよりクリーンな方法はありますか?