Related differences

JDBC vs JPAJPA vs Hibernate

Ques 31. How can the JPA metadata that is the information about entity type, embeddable class, etc., be obtained?

The Metamodel interface is used by JPA for this purpose.

We can obtain this interface's object using the method of getMetamodel from an EntityManger or EntityMangerFactory.

Is it helpful? Add Comment View Comments
 

Ques 32. What is a unique inheritance strategy not present in the JPA specification but present in Hibernate?

The implicit polymorphism strategy is present in Hibernate but it is not present in JPA.

Is it helpful? Add Comment View Comments
 

Ques 33. What do you mean by JPQL (Java Persistence query language), and how does it differ from SQL?

  • JPQL is almost similar to SQL, but the names of entity classes and attributes are used instead of the database columns.
  • Also, the data types of entity attributes are used by the query parameters instead of database fields.
  • There is automatic polymorphism in JPQL, unlike SQL. KEY, TREAT, VALUE, MAP, and ENTRY are some of the unique functions of JPQL.

Is it helpful? Add Comment View Comments
 

Ques 34. What is polymorphism in JPQL queries?

This means that regardless of the inheritance strategy, the objects of all the descendant classes are returned in each entity request.

Is it helpful? Add Comment View Comments
 

Ques 35. How can the polymorphism be turned off in JPQL?

We can use the TYPE function in the where condition for turning polymorphism off in JPQL.

Is it helpful? Add Comment View Comments
 

Most helpful rated by users: