CMT is declaratively defined using annotations that are evaluated by the Java EE container, which then provides transparent transaction processing. Pojos is not container managed, so CMT cannot be applied.
Regarding your question about objects. You must create a DAO layer to abstract the technical details of your persistence logic. you can use one common dao implementation to support JPA. This is basically the only part that should be different for the two environments. In the container, you will receive your transactions for free, as indicated in the annotation. If you are working in standard java se, you must start / commit / roll back your transactions yourself.
I suggest you create a generic dao implementation that declares transactions and expects it to be launched inside the container. For use in java se, you have a decorator for this dao that takes care of the proper transaction processing to emulate what the container would actually do.
I think you do not need to change anything in the persistence.xml file, but maybe I'm wrong here.
source share