人気の面接質問と回答・オンラインテスト
面接対策、オンラインテスト、チュートリアル、ライブ練習のための学習プラットフォーム

集中型学習パス、模擬テスト、面接向けコンテンツでスキルを伸ばしましょう。

WithoutBook は、分野別の面接質問、オンライン練習テスト、チュートリアル、比較ガイドをひとつのレスポンシブな学習空間にまとめています。

面接準備

JPA 面接の質問と回答

関連する比較

JDBC vs JPAJPA vs Hibernate

質問 21. On each of the four statuses of Entity objects, how are the operations persisted?

  • For the new status, the object will get saved to the database after a transaction is committed and changes to the status managed.
  • If the status is managed, it ignores the operation. But the status of the dependent Entity can be changed to 'managed' if the cascading annotations are there.
  • For the removed status, it changes to managed thereafter.
  • For the detached status, it throws the exception at the transaction's commit stage or right away.

役に立ちましたか? コメントを追加 コメントを見る
 

質問 22. What are the effects on the statuses of Entity objects of the merge operation?

  • For the new status, a new managed entity is created, and the past data will be copied into it.
  • For the managed status, it ignores the operation, but it works on the Entity dependent on cascading when the status is not managed.
  • For the removed status, it throws the exception at the transaction's commit stage or right away.
  • For the detached status, it either creates a new managed with the data copied or copies the data to the existing managed Entity

役に立ちましたか? コメントを追加 コメントを見る
 

質問 23. What are the effects on the statuses of Entity objects of the remove operation?

  • For the new status, it ignores the operation, but the status changes to removed on the Entity dependent on cascading. Here the status shouldn't be managed.
  • For the managed status, the status changes to removed thereafter, and the removed database records the object during the commit stage.
  • For the removed status, it ignores the operation.
  • For the detached status, it throws the exception at the transaction's commit stage or right away.

役に立ちましたか? コメントを追加 コメントを見る
 

質問 24. What are the effects on the statuses of Entity objects of the detach operation?

  • For the new or detached status, it ignores the operation.
  • For the managed or removed status, the Entity's status and also of the objects dependent on cascade become detached.

役に立ちましたか? コメントを追加 コメントを見る
 

質問 25. What are the effects on the statuses of Entity objects of the refresh operation?

  • For the new, detached, or removed status, it throws out the exception.
  • For the managed status, it restores all the changes from the database and refreshes all objects dependent on the cascade.

役に立ちましたか? コメントを追加 コメントを見る
 

ユーザー評価で最も役立つ内容:

著作権 © 2026、WithoutBook。