Question : JSP, EJB, JSF

I have some questins I am studying to learn. Could you see if I stuyd to the right results? Dont want to learn wrong.

In which tier of the java ee architecture does jpa belong?
A client tier
b presentation tier
c buisiness tier
d integratin tier
Answer D


In jpa code, you get an EntityManager by calling the cdreateEntityManager() method on:
a entityManager
b An instandce of EntityManagerFactory
c persistence
d an instance of EntityTransaction
Answer B



If duration is a persistent object and entitymanager is an instance of entitymanager, when you call entityManager.remove(duration):
a The duration object will no longer be available to the application
b The data for the duration object will be removed from the database
c The data for the duration object will be persisted and then the object garbage will be collected
d both a and b
Answer d



If the Track class in an entity and has an embeddable realtionship with the Duration class, which of the two classes should have an Id property with annotation @ID
a Track has an Id property , but Duration does not
b Duration has an id property, but track does not
c Track and duration both have an Id property
d Neither track nor duration need an id property
Answer a


In jpa code an object myObject becomes detached from a persistence context when you call the method remove(myOjbect) on an instance of:
a EntityManager
b EntitnyManagerFactory
C Persistence
D EntityTransaction

Container-managed transactions always end
a at the method call commit()
b att the mthod call begin ()
c just before a mthode is invoked
d just after a mthod execution completes
Answer d


In container-managed security, security roles can be declared using:
a annotations on the bean class
b the xml deployment descriptor
c annotations, the xml deployment descriptor, or both
d either annotations or the xml deployment descriptor , but not both
Answer C

Answer : JSP, EJB, JSF

It's all right, except you have skipped  the following answer:
-In jpa code an object myObject becomes detached from a persistence context when you call the method remove(myOjbect) on an instance of EntityManager
Random Solutions  
 
programming4us programming4us