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.
JPAでシーケンスを使用する方法を知りたいです。DB のシーケンスから値を取得する必要がある非 pk フィールドがあります。エンティティを更新してその値を更新するにはどうすればよいですか?
前もって感謝します。
JPA は@GeneratedValue、PK フィールドのみに適用されるように定義しています。DataNucleus は、任意のフィールドでそれを受け入れます。明らかに、これは JPA 仕様を超えており、他の実装ではそのような動作がサポートされていない可能性があります。
@GeneratedValue