private AbstractNameQuery findPersistenceUnit(GerPersistenceContextRefType persistenceContextRef, Configuration localConfiguration) throws DeploymentException { AbstractNameQuery persistenceUnitNameQuery; if (persistenceContextRef.isSetPersistenceUnitName()) { String persistenceUnitName = persistenceContextRef.getPersistenceUnitName(); persistenceUnitNameQuery = new AbstractNameQuery(null, Collections.singletonMap("name", persistenceUnitName), PERSISTENCE_UNIT_INTERFACE_TYPES); } else { GerPatternType gbeanLocator = persistenceContextRef.getPattern(); persistenceUnitNameQuery = buildAbstractNameQuery(gbeanLocator, null, null, PERSISTENCE_UNIT_INTERFACE_TYPES); } checkForGBean(localConfiguration, persistenceUnitNameQuery, false, false, new HashSet<AbstractName>()); return persistenceUnitNameQuery; }
private Map<String, GerPersistenceContextRefType> getGerPersistenceContextRefs(XmlObject plan) throws DeploymentException { Map<String, GerPersistenceContextRefType> map = new HashMap<String, GerPersistenceContextRefType>(); if (plan != null) { List<GerPersistenceContextRefType> refs = convert(plan.selectChildren(GER_PERSISTENCE_CONTEXT_REF_QNAME_SET), NAMING_CONVERTER, GerPersistenceContextRefType.class, GerPersistenceContextRefType.type); for (GerPersistenceContextRefType ref : refs) { map.put(getJndiName(ref.getPersistenceContextRefName().trim()), ref); } } return map; }
private void addProperties(GerPersistenceContextRefType persistenceContextRef, Map<String, String> properties) { GerPropertyType[] propertyTypes = persistenceContextRef.getPropertyArray(); for (GerPropertyType propertyType : propertyTypes) { String key = propertyType.getKey(); String value = propertyType.getValue(); properties.put(key, value); } }
String persistenceContextRefName = gerPersistenceContextRef.getPersistenceContextRefName(); GerPersistenceContextTypeType.Enum persistenceContextType = gerPersistenceContextRef.getPersistenceContextType(); boolean transactionScoped = persistenceContextType == null || !persistenceContextType.equals(GerPersistenceContextTypeType.EXTENDED); Map<String, String> properties = new HashMap<String, String>();