Which of these can be a JPA entity?
Which of these can be a JPA entity?
A JPA entity must be an instantiable class and it cannot be an abstract class, an interface, or an enum type. It can be a final class because final keyword only restricts the inheritance but does not affect the ability to instantiate the class. Therefore, a JPA entity can be a final class.
B https://docs.oracle.com/javaee/7/tutorial/persistence-intro002.htm#BNBQN
B is the correct Answer
Correct is B. - Must have @Entity. - Must have public or protected no-arg constructor. - Must be a top-level class but can be a concrete or an abstract class. - Must not be final, Interface or Enum.