public JPADynamicHelper(EntityManager em) { super(JpaHelper.getEntityManager(em).getDatabaseSession()); }
/** * Gets the descriptor for the entity type. * * @param entityClass the type of the enty. * @return the descriptor for the entity type. */ protected ClassDescriptor getClassDescriptor(Class<?> entityClass) { return getEclipseLinkEntityManager().getDatabaseSession().getDescriptor(entityClass); }
@SuppressWarnings("unchecked") @Override public T call() { T copiedObject = (T) sharedEntityManager.unwrap(JpaEntityManager.class).getDatabaseSession() .copy(dataObject, copyGroup); if (shouldResetObjectId) { clearObjectIdOnUpdatableObjects(copiedObject, new HashSet<Object>()); } if (shouldResetVersionNumber) { clearVersionNumberOnUpdatableObjects(copiedObject, new HashSet<Object>()); } return copiedObject; } });
dm.preInitialize(getEclipseLinkEntityManager().getDatabaseSession()); dm.initialize(getEclipseLinkEntityManager().getDatabaseSession()); entityDescriptor.addMapping(dm); entityDescriptor.getObjectBuilder().initialize(getEclipseLinkEntityManager().getDatabaseSession());