/** * Parse the {@code jar-file} XML elements. */ protected void parseJarFiles(Element persistenceUnit, SpringPersistenceUnitInfo unitInfo) throws IOException { List<Element> jars = DomUtils.getChildElementsByTagName(persistenceUnit, JAR_FILE_URL); for (Element element : jars) { String value = DomUtils.getTextValue(element).trim(); if (StringUtils.hasText(value)) { Resource[] resources = this.resourcePatternResolver.getResources(value); boolean found = false; for (Resource resource : resources) { if (resource.exists()) { found = true; unitInfo.addJarFileUrl(resource.getURL()); } } if (!found) { // relative to the persistence unit root, according to the JPA spec URL rootUrl = unitInfo.getPersistenceUnitRootUrl(); if (rootUrl != null) { unitInfo.addJarFileUrl(new URL(rootUrl, value)); } else { logger.warn("Cannot resolve jar-file entry [" + value + "] in persistence unit '" + unitInfo.getPersistenceUnitName() + "' without root URL"); } } } } }
if (pui.getPersistenceUnitRootUrl() == null) { pui.setPersistenceUnitRootUrl(determineDefaultPersistenceUnitRootUrl()); StringBuilder msg = new StringBuilder(); msg.append("Conflicting persistence unit definitions for name '").append(name).append("': "); msg.append(pui.getPersistenceUnitRootUrl()).append(", "); msg.append(this.persistenceUnitInfos.get(name).getPersistenceUnitRootUrl()); throw new IllegalStateException(msg.toString());
if (matchesFilter(reader, readerFactory)) { scannedUnit.addManagedClassName(className); if (scannedUnit.getPersistenceUnitRootUrl() == null) { URL url = resource.getURL(); if (ResourceUtils.isJarURL(url)) {
/** * Parse the {@code jar-file} XML elements. */ protected void parseJarFiles(Element persistenceUnit, SpringPersistenceUnitInfo unitInfo) throws IOException { List<Element> jars = DomUtils.getChildElementsByTagName(persistenceUnit, JAR_FILE_URL); for (Element element : jars) { String value = DomUtils.getTextValue(element).trim(); if (StringUtils.hasText(value)) { Resource[] resources = this.resourcePatternResolver.getResources(value); boolean found = false; for (Resource resource : resources) { if (resource.exists()) { found = true; unitInfo.addJarFileUrl(resource.getURL()); } } if (!found) { // relative to the persistence unit root, according to the JPA spec URL rootUrl = unitInfo.getPersistenceUnitRootUrl(); if (rootUrl != null) { unitInfo.addJarFileUrl(new URL(rootUrl, value)); } else { logger.warn("Cannot resolve jar-file entry [" + value + "] in persistence unit '" + unitInfo.getPersistenceUnitName() + "' without root URL"); } } } } }
if (pui.getPersistenceUnitRootUrl() == null) { pui.setPersistenceUnitRootUrl(determineDefaultPersistenceUnitRootUrl()); StringBuilder msg = new StringBuilder(); msg.append("Conflicting persistence unit definitions for name '").append(name).append("': "); msg.append(pui.getPersistenceUnitRootUrl()).append(", "); msg.append(this.persistenceUnitInfos.get(name).getPersistenceUnitRootUrl()); throw new IllegalStateException(msg.toString());
if (matchesFilter(reader, readerFactory)) { scannedUnit.addManagedClassName(className); if (scannedUnit.getPersistenceUnitRootUrl() == null) { URL url = resource.getURL(); if (ResourceUtils.isJarURL(url)) {
if (ormXml != null) { scannedUnit.addMappingFileName(DEFAULT_ORM_XML_RESOURCE); if (scannedUnit.getPersistenceUnitRootUrl() == null) { try { scannedUnit.setPersistenceUnitRootUrl(
if (ormXml != null) { scannedUnit.addMappingFileName(DEFAULT_ORM_XML_RESOURCE); if (scannedUnit.getPersistenceUnitRootUrl() == null) { try { scannedUnit.setPersistenceUnitRootUrl(
/** * Parse the {@code jar-file} XML elements. */ protected void parseJarFiles(Element persistenceUnit, SpringPersistenceUnitInfo unitInfo) throws IOException { List<Element> jars = DomUtils.getChildElementsByTagName(persistenceUnit, JAR_FILE_URL); for (Element element : jars) { String value = DomUtils.getTextValue(element).trim(); if (StringUtils.hasText(value)) { Resource[] resources = this.resourcePatternResolver.getResources(value); boolean found = false; for (Resource resource : resources) { if (resource.exists()) { found = true; unitInfo.addJarFileUrl(resource.getURL()); } } if (!found) { // relative to the persistence unit root, according to the JPA spec URL rootUrl = unitInfo.getPersistenceUnitRootUrl(); if (rootUrl != null) { unitInfo.addJarFileUrl(new URL(rootUrl, value)); } else { logger.warn("Cannot resolve jar-file entry [" + value + "] in persistence unit '" + unitInfo.getPersistenceUnitName() + "' without root URL"); } } } } }
if (ormXml != null) { scannedUnit.addMappingFileName(DEFAULT_ORM_XML_RESOURCE); if (scannedUnit.getPersistenceUnitRootUrl() == null) { try { scannedUnit.setPersistenceUnitRootUrl(