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

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

WithoutBook объединяет вопросы для интервью по предметам, онлайн-практику, учебные материалы и сравнительные руководства в одном удобном учебном пространстве.

Подготовка к интервью

JPA вопросы и ответы для интервью

Связанные сравнения

JDBC vs JPAJPA vs Hibernate

Вопрос 16. What is the difference between JPA and JDO?

JPA (Java Persistence API) and Java Data Objects (JDO) are two specifications for storing java objects in databases.

If JPA is concentrated only on relational databases, then JDO is a more general specification that describes the ORM for any possible bases and repositories.

In principle, JPA can be viewed as part of the JDO specification specialized in relational databases, even though the API of these two specifications does not completely match.

The “developers” of specifications also differ – if JPA is developed as JSR, then JDO was first developed as JSR, and now it is developed as an Apache JDO project.

Это полезно? Добавить комментарий Посмотреть комментарии
 

Вопрос 17. What is the attribute of the Entity class in JPA terminology?

JPA indicates that it can work both with properties of classes (property), designed in the style of JavaBeans, or with fields (field), that is, class variables (instance variables). Both types of elements of the Entity class are called attributes of the Entity class.

Это полезно? Добавить комментарий Посмотреть комментарии
 

Вопрос 18. What data types are allowed in the attributes of the Entity class (fields or properties)?

Valid attribute types for Entity classes are:

  1. primitive types and their Java wrappers,
  2. strings,
  3. any Java serializable types,
  4. enums;
  5. entity types;
  6. embeddable classes
  7. collection types

Это полезно? Добавить комментарий Посмотреть комментарии
 

Вопрос 19. What requirements does JPA set for Embeddable classes?

  1. Such classes must satisfy the same rules as the Entity classes, except that they do not have to contain a primary key and be marked with the Entity annotation.
  2. The Embeddable class must be marked with the Embeddable annotation or described in the XML configuration file JPA.

Это полезно? Добавить комментарий Посмотреть комментарии
 

Вопрос 20. What is a Mapped Superclass?

A mapped Superclass is a class from which Entity is inherited, it may contain JPA annotations, however, such a class is not Entity, it does not have to fulfill all the requirements set for Entity (for example, it may not contain a primary key).

Such a class cannot be used in EntityManager or Query operations. Such a class should be marked with the MappedSuperclass annotation or, respectively, described in the XML file.

Это полезно? Добавить комментарий Посмотреть комментарии
 

Самое полезное по оценкам пользователей:

Авторские права © 2026, WithoutBook.