Prepare Interview

Mock Exams

Make Homepage

Bookmark this page

Subscribe Email Address

JPA Interview Questions and Answers

Question: What is Persistent Properties?
Answer:
  • If the entity uses persistent properties, the entity must follow the method conventions of JavaBeans components.
  • JavaBeans-style properties use getter and setter methods that are typically named after the entity class's instance variable names.
  • For every persistent property of type Type of the entity, there is a getter method getProperty and a setter method setProperty.
  • If the property is a Boolean, you may use isProperty instead of getProperty. For example, if a Customer entity uses persistent properties and has a private instance variable called firstName, the class defines a getFirstName and setFirstName method for retrieving and setting the state of the firstName instance variable.

    The method signature for single-valued persistent properties are as follows:

    Type getProperty()
    void setProperty(Type type)

    The object/relational mapping annotations for persistent properties must be applied to the getter methods. Mapping annotations cannot be applied to fields or properties annotated @Transient or marked transient.
Is it helpful? Yes No

Most helpful rated by users:

©2024 WithoutBook