Which two solutions are correct? (Choose two.)

A developer needs to include a set of managed classes in a persistence unit.
Which two solutions are correct? (Choose two.)

A developer needs to include a set of managed classes in a persistence unit.
Which two solutions are correct? (Choose two.)

A.
Place the class files in the orm.xml file.

B.
Place the class files in the root of the persistence unit.

C.
Place the class files in any mapping file that is included on the classpath.

D.
Place the class files in any jar on the classpath that is included in the persistence unit.

Explanation:
https://cwiki.apache.org/GMOxDOC21/persistencexml.html
(Topic: <class>)



Leave a Reply 3

Your email address will not be published. Required fields are marked *


test

test

I think B (Container managed) ,C

For A we have also to ensure that the ORM file is in the class path and explicitly specified in Persistence.xml,

For D we have also to reference the jar file in persistence.xml file

Mohamed Fayek

Mohamed Fayek

Answer : B , D

A.Place the class files in the orm.xml file. (not enough)

should ensure that the class is in the classpath.

C.Place the class files in any mapping file that is included on the classpath. (not enough)

Just adding the class to a mapping file is not enough. The mapping file must also be explicitly specified in persistence.xml using the mapping-file elements of the persistence-unit element.