JPA Interview Questions and Answers
Prepare for your Interview today!
In general, the JPA specification says only about mapping java objects into relational database tables, but there are a number of implementations of this standard for NoSQL databases: Kundera, DataNucleus, ObjectDB, and a number of others. Naturally, not all specification-specific features for relational databases are transferred to NoSQL databases completely.
1) Entity class must be annotated with Entity or described in the XML configuration file JPA,
2) Entity class must contain a public or protected constructor with no arguments (it can also have constructors with arguments),
3) Entity class must be a top-level class (top-level class),
4) Entity class cannot be an enum or interface,
5) Entity class cannot be the final class,
6) Entity class cannot contain final fields or methods if they participate in the mapping (persistent final methods or persistent final instance variables),
7) If an Entity class object is passed by value as a separate object (detached object), for example through a remote interface (through a remote interface), it must also implement a Serializable interface,
8) The Entity class fields should be directly accessible only to the methods of the Entity class and should not be directly accessible to other classes using this entity. Such classes should refer only to methods (getter/setter methods or other business logic methods in the Entity class),
9) The Entity class must contain a primary key, that is, an attribute or group of attributes that uniquely defines the record of this Entity class in the database.
Key states that an entity might be in:
Most helpful rated by users: