JPA/JPA MCQ Sample Test,Sample questions

Question:
 What are the JPA @Entity association attributes?

1.Association validation

2.Association multiplicity

3.Association cascade behavior

4.Association direction


Question:
 What is TRUE about the cascading and cascade mode attributes in Entity Beans?

1. Cascade mode attributes can be specified for the association annotaions (like @OneToMany) in an entity bean

2.The cascading direction is from the target entity to the source entity

3. Refresh cascade causes to refresh the target entities of a relationship when refresh is invoked on the source entity of the relationship

4.PERSIST, DELETE and REFRESH are cascading mode attributes


Question:
 What's true about the following @Entity association between House and Window?
@Entity
public class Window {
	@Id
	private int winNo;
	@ManyToOne
	private House aHouse;
}
@Entity
public class House {
	@Id
	private int houseNo;
	@OneToMany(mappedBy="aHouse")
	private List windows;
}

1. It's OneToMany unidirectional association

2.It's OneToMany bidirectional association

3.The association owner is the House class

4.The association owner is the Window class


Question:
JPA implementation is provided by ---?

1.Hibernate

2.Toplink

3.Ibatis

4.All of them


Question:
Object/relational metadata can be specified directly in the entity class file by using annotations, or in a separate ________ descriptor file distributed with the application.

1.Scalable Vector Graphics

2.HTML

3.XML

4.XHTML


Question:
What is the JPA equivalent of hibernate.cfg.xml file?

1.configuration.xml

2.persistence.xml

3.jpa.configuration.xml

4.jpa.configuration.xml


Question:
What is the Life Cycle Of A Jpa Entity?

1.New / Transient

2.Managed / Persisted

3.Detached

4. All of the above


Question:
Which annotation is used to create Pk-Fk relation b/w two tables?

1.JoinColumn

2.ForeignKey

3.JoinedKey

4.None of these


Question:
Which attribute of @OneToMany is used to mark an entity as owned?

1.cascade

2.mappedBy

3.propertyRef

4.None of the above


Question:
______ has stated that ideas came from several frameworks, including Hibernate and JDO.

1.Sun Microsystems

2.Java (software platform)

3.Open JDK

4.Java (programming language)


More MCQS

  1. JPA MCQ
Search
Olete Team
Online Exam TestTop Tutorials are Core Java,Hibernate ,Spring,Sturts.The content on Online Exam Testwebsite is done by expert team not only with the help of books but along with the strong professional knowledge in all context like coding,designing, marketing,etc!