J2ee Concepts

20 Questions | Total Attempts: 2881

SettingsSettingsSettings
J2ee Concepts - Quiz

This quiz was created by TeoGol29. Remember, concepts are what really matter.


Questions and Answers
  • 1. 
    Which of the following statements about the fetch modes in Entity beans is FALSE?
    • A. 

      There are two fetch modes : EAGER and LAZY.

    • B. 

      The default fetching mode for a field in an Entity bean annotated by @OneToMany is LAZY.

    • C. 

      The default fetching mode for a field in an Entity bean annotated by @Basic is LAZY.

    • D. 

      @Lob annotation does not have a default fetch mode.

  • 2. 
    What is TRUE about the cascading and cascade mode attributes in Entity Beans?
    • A. 

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

    • B. 

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

    • C. 

      PERSIST, DELETE and REFRESH are cascading mode attributes.

    • D. 

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

  • 3. 
    How to declare JPA Entity class?
    • A. 

      Write a private final Entity class named after the mapped table

    • B. 

      Annotate the class with @Entity

    • C. 

      Annotate the primary key attribute or its getter method with @Id

    • D. 

      Define private attributes to map the table columns.

    • E. 

      Write the finalize method

  • 4. 
    What is the impact of marking an attribute in a JPA Entity class with @Transient annotation?
    • A. 

      This attribute will should not be serialized by the EJB container

    • B. 

      This attribute will should not be persisted by the EJB container.

    • C. 

      This attribute will should not be garbage collected by the EJB container

  • 5. 
    In which life cycle state the JPA entity class is synchronized with the database?
    • A. 

      New

    • B. 

      Managed

    • C. 

      Synchronized

    • D. 

      Detached

    • E. 

      Removed

  • 6. 
    What causes the entity manager to move an Entity instance from the detached to the managed state?
    • A. 

      Invoke the persist() method of the entity manager on the instance

    • B. 

      Invoke the merge() method of the entity manager on the instance

    • C. 

      Invoke the manage() method of the entity manager on the instance

    • D. 

      Invoke the remove() method of the entity manager on the instance

  • 7. 
    Which of the following is NOT a JPA entity manager method?
    • A. 

      Persist

    • B. 

      Flush

    • C. 

      Contains

    • D. 

      Detach

    • E. 

      Find

  • 8. 
    Which method of the jpa entity manager would you use to force synchronizing the persistence context from the database?
    • A. 

      Synchronize

    • B. 

      Flush

    • C. 

      Refresh

    • D. 

      Persist

  • 9. 
    Which method of the jpa entity manager would you use to force synchronizing the database with the entities of the persistence context?
    • A. 

      Synchronize

    • B. 

      Flush

    • C. 

      Refresh

    • D. 

      Persist

  • 10. 
    In the web services world, the REST (REpresentational State Transfer) is:
    • A. 

      A protocol.

    • B. 

      A software architectural paradigm

    • C. 

      A standard API.

  • 11. 
    In a RESTful web service, you would use the HTTP methods as verbs to invoke the CRUD action (create, read, update, and delete) Which of the following is true:
    • A. 

      To read use HTTP get method.

    • B. 

      To delete use HTTP delete method.

    • C. 

      To create use HTTP post method.

    • D. 

      To update use HTTP put method

  • 12. 
    When is it most appropriate to architect your enterprise java application using SOAP protocol web services over RESTful?
    • A. 

      When client-server communication bandwidth is limited.

    • B. 

      When the web service interface must be predefined in a concrete contract.

    • C. 

      When a web based application utilizes AJAX components which consume the web service.

    • D. 

      When asynchronous invocation is required.

  • 13. 
    Web Services are the amalgamation of:
    • A. 

      XML and SOAP

    • B. 

      SOAP, UDDI, WSDL

    • C. 

      WSDL and UDDI

    • D. 

      Eb-XML and WSDL

  • 14. 
    Service Transport, XML MEssaging, Service Description and Service Discovery are four layers of:
    • A. 

      Web service implementing client components.

    • B. 

      Web service protocol stack

    • C. 

      Web service supporting repository

    • D. 

      Web service supporting request and respone components

  • 15. 
    Which of the following is used to describe web services?
    • A. 

      SOAP

    • B. 

      Web Page

    • C. 

      UDDI

    • D. 

      WSDL

  • 16. 
    Web Services enables...
    • A. 

      Data can be exchanged between various applications and different platforms

    • B. 

      To resolve interoperability issues

    • C. 

      Applications to function between two different operating systems server

    • D. 

      All of the above

  • 17. 
    In accessing a web service through synchronous call,
    • A. 

      Application can make a call to the web service and then continue to perform the needed task

    • B. 

      A service notifies the application when it is ready

    • C. 

      Application has to wait until execution is completed.

    • D. 

      None of the above.

  • 18. 
    Difference between RESTfull web services and SOAP web services
    • A. 

      REST is more simple and easy to use than SOAP web services

    • B. 

      REST uses HTTP protocol for producing or consuming web services while SOAP uses XML

    • C. 

      REST is lighweight as compared to SOAP

    • D. 

      All of the above.

  • 19. 
    What is difference between top-down and bottom-up approach of developing web services?
    • A. 

      In top-down approach first WSDL document is created and then JAVA classes

    • B. 

      B.In bottom-up approach first Java Code is created and then WSDL fields are generated.

    • C. 

      Both a and b.

    • D. 

      None of the above

  • 20. 
    EclipseLink, TopLink, and Hybernarte are implementations of:
    • A. 

      JPQL

    • B. 

      REST

    • C. 

      JPA

    • D. 

      XML-RPC