mcq-3 - Hibernate
mcq-3 - Hibernate
Q1. Code need to put in struts-config.xml for referring an resource ApplicationResources.properties put into
com.jamesholmes.minihr package
1. <message-resources parameter="com.ApplicationResources"/>
2. <message-resources parameter=" ApplicationResources"/>
3. <message-resources parameter=" ApplicationResources.properties"/>
4. None of these
Q2. Sequence of calling methods in Struts1 FormBean
1. Constructor-> reset() method ->populate form data with requested data-> validate() method
2. Constructor-> validate() method ->populate form data with requested data
3. Constructor-> clean() method ->populate form data with requested data-> validate() method
4. None of these
Q3. We want to provide custom request processor that can apply a logged-in security check before any action is
executed.
1. processForward()
2. processPreprocess()
3. processActionCreate()
4. processActionPerform( )
Q6. In______1______, we define validation rules for any specific Java bean while in _____2____file, standard and
generic validation rules are defined.
1. Validation.xml
2. validator-rules.xml
Q7. _____________provides a way to group all related functions into a single action class.
1. DispatchAction
2. DynaAction
3. ForwardAction
4. None of these
Q8. Which of the following acts as a bridge between user-invoked uri and business logic
1. RequestProcessor
2. Action classes
3. ActionServlet
4. ActionForm
Q9. Signature of reset() method of form bean is
1. public ActionError reset(ActionMapping mapping, HttpServletRequest request)
2. public void reset(ActionMapping mapping, HttpServletRequest request)
3. public Action reset(ActionMapping mapping, HttpServletRequest request)
4. None of these
Q10. Signature of execute() method
1. public ActionForward execute(ActionMapping mapping, ActionForm form,
HttpServletRequest request, HttpServletResponse response)
2. public void execute(ActionMapping mapping, ActionForm form,
HttpServletRequest request, HttpServletResponse response)
3. public ActionForward execute(ActionForm form,ActionMapping mapping,
HttpServletRequest request, HttpServletResponse response)
4. None of these
Q11. What is dirty checking in Hibernate?
1. object state changes in order to synchronize the updated state with the database
2. remove the dirty data from data base.
3. check the data when insert into data base.
4. None
Q12. What does session.evict() method do?
1. remove the object and its collections from the first level cache
2. remove the object and its collections from the second level cache
3. remove the object and its collections from the data base
4. None of the above
A - Once we close the Hibernate Session, the persistent instance will become a detached instance.
B - A new instance of a persistent class which is not associated with a Session.
C - You can make a transient instance detached by associating it with a Session.
D - None of the above.
A - get() returns null if no data is present where as load throws ObjectNotFoundException exception in such case.
B - get() always hits the database whereas load() method doesn't hit the database.
C - get() returns actual object whereas load() returns proxy object.
D - All of the above.