private PersistenceUnitMetadata getPersistenceUnit(final DeploymentUnit deploymentUnit, final String puName) throws DeploymentUnitProcessingException { PersistenceUnitMetadata pu = PersistenceUnitSearch.resolvePersistenceUnitSupplier(deploymentUnit, puName); if (null == pu) { throw new DeploymentUnitProcessingException(JpaLogger.ROOT_LOGGER.persistenceUnitNotFound(puName, deploymentUnit)); } return pu; }
private PersistenceUnitMetadata getPersistenceUnit(final DeploymentUnit deploymentUnit, final String puName) throws DeploymentUnitProcessingException { PersistenceUnitMetadata pu = PersistenceUnitSearch.resolvePersistenceUnitSupplier(deploymentUnit, puName); if (null == pu) { throw new DeploymentUnitProcessingException(JpaLogger.ROOT_LOGGER.persistenceUnitNotFound(puName, deploymentUnit)); } return pu; }
private String getScopedPUName(final DeploymentUnit deploymentUnit, final String persistenceUnitName, Member injectionPoint) { PersistenceUnitMetadata scopedPu; scopedPu = PersistenceUnitSearch.resolvePersistenceUnitSupplier(deploymentUnit, persistenceUnitName); if (null == scopedPu) { throw WeldLogger.ROOT_LOGGER.couldNotFindPersistenceUnit(persistenceUnitName, deploymentUnit.getName(), injectionPoint); } return scopedPu.getScopedPersistenceUnitName(); }
private String getScopedPUName(final DeploymentUnit deploymentUnit, final String persistenceUnitName) { PersistenceUnitMetadata scopedPu; scopedPu = PersistenceUnitSearch.resolvePersistenceUnitSupplier(deploymentUnit, persistenceUnitName); if (null == scopedPu) { throw WeldMessages.MESSAGES.couldNotFindPersistenceUnit(persistenceUnitName, deploymentUnit.getName()); } return scopedPu.getScopedPersistenceUnitName(); } }
private InjectionSource getPersistenceUnitBindingSource(final DeploymentUnit deploymentUnit, final String unitName) throws DeploymentUnitProcessingException { final String searchName; if (isEmpty(unitName)) { searchName = null; } else { searchName = unitName; } final PersistenceUnitMetadata pu = PersistenceUnitSearch.resolvePersistenceUnitSupplier(deploymentUnit, searchName); if (null == pu) { throw new DeploymentUnitProcessingException(JpaLogger.ROOT_LOGGER.persistenceUnitNotFound(searchName, deploymentUnit)); } String scopedPuName = pu.getScopedPersistenceUnitName(); ServiceName puServiceName = getPuServiceName(scopedPuName); return new PersistenceUnitInjectionSource(puServiceName, deploymentUnit.getServiceRegistry(), EntityManagerFactory.class.getName(), pu); }
private InjectionSource getPersistenceUnitBindingSource(final DeploymentUnit deploymentUnit, final String unitName) throws DeploymentUnitProcessingException { final String searchName; if (isEmpty(unitName)) { searchName = null; } else { searchName = unitName; } final PersistenceUnitMetadata pu = PersistenceUnitSearch.resolvePersistenceUnitSupplier(deploymentUnit, searchName); if (null == pu) { throw new DeploymentUnitProcessingException(JpaLogger.ROOT_LOGGER.persistenceUnitNotFound(searchName, deploymentUnit)); } String scopedPuName = pu.getScopedPersistenceUnitName(); ServiceName puServiceName = getPuServiceName(scopedPuName); return new PersistenceUnitInjectionSource(puServiceName, deploymentUnit.getServiceRegistry(), EntityManagerFactory.class.getName(), pu); }
private PersistenceUnitMetadata getPersistenceUnit(final DeploymentUnit deploymentUnit, final AnnotationInstance annotation, EEModuleClassDescription classDescription) throws DeploymentUnitProcessingException { final AnnotationValue puName = annotation.value("unitName"); String searchName = null; // note: a null searchName will match the first PU definition found if (puName != null && (searchName = puName.asString()) != null) { searchName = SpecDescriptorPropertyReplacement.propertyReplacer(deploymentUnit).replaceProperties(searchName); } ROOT_LOGGER.debugf("persistence unit search for unitName=%s referenced from class=%s (annotation=%s)", searchName, classDescription.getClassName(), annotation.toString()); PersistenceUnitMetadata pu = PersistenceUnitSearch.resolvePersistenceUnitSupplier(deploymentUnit, searchName); if (null == pu) { classDescription.setInvalid(JpaLogger.ROOT_LOGGER.persistenceUnitNotFound(searchName, deploymentUnit)); return null; } return pu; }
private PersistenceUnitMetadata getPersistenceUnit(final DeploymentUnit deploymentUnit, final AnnotationInstance annotation, EEModuleClassDescription classDescription) throws DeploymentUnitProcessingException { final AnnotationValue puName = annotation.value("unitName"); String searchName = null; // note: a null searchName will match the first PU definition found if (puName != null && (searchName = puName.asString()) != null) { searchName = SpecDescriptorPropertyReplacement.propertyReplacer(deploymentUnit).replaceProperties(searchName); } ROOT_LOGGER.debugf("persistence unit search for unitName=%s referenced from class=%s (annotation=%s)", searchName, classDescription.getClassName(), annotation.toString()); PersistenceUnitMetadata pu = PersistenceUnitSearch.resolvePersistenceUnitSupplier(deploymentUnit, searchName); if (null == pu) { classDescription.setInvalid(JpaLogger.ROOT_LOGGER.persistenceUnitNotFound(searchName, deploymentUnit)); return null; } return pu; }