protected static PersistenceUnitDescriptor findReferencedPUViaEMRef(EntityManagerReference emRef) { final String unitName = emRef.getUnitName(); final BundleDescriptor bundle = emRef.getReferringBundleDescriptor(); PersistenceUnitDescriptor pu = bundle.findReferencedPU(unitName); if (pu == null) { throw new RuntimeException(localStrings.getLocalString( "enterprise.deployment.exception-unresolved-pc-ref", "xxx", // NOI18N new Object[]{emRef.getName(), bundle.getName()}) ); } if ("RESOURCE_LOCAL".equals(pu.getTransactionType())) { // NOI18N throw new RuntimeException(localStrings.getLocalString( "enterprise.deployment.exception-non-jta-container-managed-em", "xxx", // NOI18N new Object[]{emRef.getName(), bundle.getName(), pu.getName()}) ); } return pu; }
protected static PersistenceUnitDescriptor findReferencedPUViaEMRef(EntityManagerReference emRef) { final String unitName = emRef.getUnitName(); final BundleDescriptor bundle = emRef.getReferringBundleDescriptor(); PersistenceUnitDescriptor pu = bundle.findReferencedPU(unitName); if (pu == null) { throw new RuntimeException(localStrings.getLocalString( "enterprise.deployment.exception-unresolved-pc-ref", "xxx", // NOI18N new Object[]{emRef.getName(), bundle.getName()}) ); } if ("RESOURCE_LOCAL".equals(pu.getTransactionType())) { // NOI18N throw new RuntimeException(localStrings.getLocalString( "enterprise.deployment.exception-non-jta-container-managed-em", "xxx", // NOI18N new Object[]{emRef.getName(), bundle.getName(), pu.getName()}) ); } return pu; }