Самые популярные вопросы и ответы для интервью и онлайн-тесты
Образовательная платформа для подготовки к интервью, онлайн-тестов, учебных материалов и живой практики

Развивайте навыки с целевыми маршрутами обучения, пробными тестами и контентом для подготовки к интервью.

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.