This is an automated email from the ASF dual-hosted git repository. asf-gitbox-commits pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/cayenne.git
commit 1623a54047e4566d0ca2011e8208eb14957ed9ed Author: Andrus Adamchik <[email protected]> AuthorDate: Fri May 8 16:59:27 2026 -0400 CAY-2937 Decomission "graph" support * bugfixing, stragglers --- UPGRADE.txt | 4 +- .../compatibility/ProjectCompatibilityModule.java | 4 +- .../project/upgrade/handlers/UpgradeHandler.java | 41 ++- .../upgrade/handlers/UpgradeHandler_V12.java | 9 +- .../upgrade/handlers/UpgradeHandler_V12Test.java | 19 ++ .../project/upgrade/v12/cayenne-project1.xml | 3 + .../configuration/DataChannelDescriptor.java | 4 +- .../xml/XMLDataChannelDescriptorLoader.java | 92 +++--- .../main/java/org/apache/cayenne/map/DataMap.java | 4 +- .../org/apache/cayenne/schema/12/cgen.xsd | 52 +++ .../org/apache/cayenne/schema/12/dbimport.xsd | 110 +++++++ .../org/apache/cayenne/schema/12/domain.xsd | 130 ++++++++ .../org/apache/cayenne/schema/12/info.xsd | 29 ++ .../org/apache/cayenne/schema/12/modelMap.xsd | 364 +++++++++++++++++++++ .../org/apache/cayenne/schema/12/validation.xsd | 30 ++ 15 files changed, 832 insertions(+), 63 deletions(-) diff --git a/UPGRADE.txt b/UPGRADE.txt index 931c5b1bb..94174d86b 100644 --- a/UPGRADE.txt +++ b/UPGRADE.txt @@ -8,8 +8,8 @@ IMPORTANT: be sure to read all notes for the intermediate releases between your UPGRADING TO 5.0.M2 * Per CAY-2937 the visual graph feature (entity layout diagrams) has been removed from CayenneModeler. -Existing `.graph.xml` files will be automatically deleted and their `<xi:include>` references removed -from `cayenne-project.xml` when a project is opened and upgraded to format version 12. +Existing `.graph.xml` files will be automatically deleted and their references removed +from `cayenne-project.xml` when a project is opened in the Modeler and upgraded to the newest format. * Per CAY-2859 SelectById query factory methods are redesigned with a bunch of old methods deprecated, so you should update your calls accordingly. diff --git a/cayenne-project-compatibility/src/main/java/org/apache/cayenne/project/compatibility/ProjectCompatibilityModule.java b/cayenne-project-compatibility/src/main/java/org/apache/cayenne/project/compatibility/ProjectCompatibilityModule.java index 54f9827a4..582b7abfa 100644 --- a/cayenne-project-compatibility/src/main/java/org/apache/cayenne/project/compatibility/ProjectCompatibilityModule.java +++ b/cayenne-project-compatibility/src/main/java/org/apache/cayenne/project/compatibility/ProjectCompatibilityModule.java @@ -29,6 +29,7 @@ import org.apache.cayenne.project.ProjectModule; import org.apache.cayenne.project.upgrade.UpgradeService; import org.apache.cayenne.project.upgrade.handlers.UpgradeHandler_V10; import org.apache.cayenne.project.upgrade.handlers.UpgradeHandler_V11; +import org.apache.cayenne.project.upgrade.handlers.UpgradeHandler_V12; import org.apache.cayenne.project.upgrade.handlers.UpgradeHandler_V7; import org.apache.cayenne.project.upgrade.handlers.UpgradeHandler_V8; import org.apache.cayenne.project.upgrade.handlers.UpgradeHandler_V9; @@ -51,6 +52,7 @@ public class ProjectCompatibilityModule implements Module { .addUpgradeHandler(UpgradeHandler_V8.class) .addUpgradeHandler(UpgradeHandler_V9.class) .addUpgradeHandler(UpgradeHandler_V10.class) - .addUpgradeHandler(UpgradeHandler_V11.class); + .addUpgradeHandler(UpgradeHandler_V11.class) + .addUpgradeHandler(UpgradeHandler_V12.class); } } diff --git a/cayenne-project/src/main/java/org/apache/cayenne/project/upgrade/handlers/UpgradeHandler.java b/cayenne-project/src/main/java/org/apache/cayenne/project/upgrade/handlers/UpgradeHandler.java index e5be3c86d..76dd5ff7a 100644 --- a/cayenne-project/src/main/java/org/apache/cayenne/project/upgrade/handlers/UpgradeHandler.java +++ b/cayenne-project/src/main/java/org/apache/cayenne/project/upgrade/handlers/UpgradeHandler.java @@ -19,16 +19,16 @@ package org.apache.cayenne.project.upgrade.handlers; -import javax.xml.xpath.XPath; -import javax.xml.xpath.XPathConstants; -import javax.xml.xpath.XPathExpressionException; -import javax.xml.xpath.XPathFactory; - import org.apache.cayenne.configuration.DataChannelDescriptor; import org.apache.cayenne.project.upgrade.UpgradeUnit; import org.w3c.dom.Element; import org.w3c.dom.NodeList; +import javax.xml.xpath.XPath; +import javax.xml.xpath.XPathConstants; +import javax.xml.xpath.XPathExpressionException; +import javax.xml.xpath.XPathFactory; + /** * Interface that upgrade handlers should implement. * Implementation also should be injected into DI stack in right order. @@ -55,6 +55,12 @@ public interface UpgradeHandler { */ String GRAPH = "graph"; + /** + * root tag for the validation extension + * @since 5.0-M2 + */ + String VALIDATION = "validation"; + /** * @return target version for this handler */ @@ -108,9 +114,9 @@ public interface UpgradeHandler { } /** - * Update schema for the given extension + * Update schema for the given extension in a datamap file (root element: data-map) * @param upgradeUnit a unit to work with - * @param extension name of the extension (cgen, dbimport, graph ) + * @param extension name of the extension (cgen, dbImport, etc.) */ default void updateExtensionSchema(UpgradeUnit upgradeUnit, String extension) { XPath xpath = XPathFactory.newInstance().newXPath(); @@ -126,4 +132,25 @@ public interface UpgradeHandler { element.setAttribute("xmlns", "http://cayenne.apache.org/schema/"+getVersion()+"/"+extension.toLowerCase()); } } + + /** + * Update schema for the given extension in a project file (root element: domain) + * @param upgradeUnit a unit to work with + * @param extension name of the extension (e.g. validation) + * @since 5.0-M2 + */ + default void updateDomainExtensionSchema(UpgradeUnit upgradeUnit, String extension) { + XPath xpath = XPathFactory.newInstance().newXPath(); + NodeList nodes; + try { + nodes = (NodeList) xpath.evaluate("/domain/*[local-name()='"+extension+"']", + upgradeUnit.getDocument(), XPathConstants.NODESET); + } catch (XPathExpressionException e) { + return; + } + for (int j = 0; j < nodes.getLength(); j++) { + Element element = (Element) nodes.item(j); + element.setAttribute("xmlns", "http://cayenne.apache.org/schema/"+getVersion()+"/"+extension.toLowerCase()); + } + } } diff --git a/cayenne-project/src/main/java/org/apache/cayenne/project/upgrade/handlers/UpgradeHandler_V12.java b/cayenne-project/src/main/java/org/apache/cayenne/project/upgrade/handlers/UpgradeHandler_V12.java index 78a46d88f..1eccb0a10 100644 --- a/cayenne-project/src/main/java/org/apache/cayenne/project/upgrade/handlers/UpgradeHandler_V12.java +++ b/cayenne-project/src/main/java/org/apache/cayenne/project/upgrade/handlers/UpgradeHandler_V12.java @@ -41,7 +41,7 @@ import java.util.List; */ public class UpgradeHandler_V12 implements UpgradeHandler { - private static final Logger logger = LoggerFactory.getLogger(UpgradeHandler_V12.class); + private static final Logger LOGGER = LoggerFactory.getLogger(UpgradeHandler_V12.class); static final String GRAPH_SUFFIX = ".graph.xml"; @@ -54,11 +54,14 @@ public class UpgradeHandler_V12 implements UpgradeHandler { public void processProjectDom(UpgradeUnit upgradeUnit) { updateDomainSchemaAndVersion(upgradeUnit); removeGraphIncludes(upgradeUnit); + updateDomainExtensionSchema(upgradeUnit, VALIDATION); } @Override public void processDataMapDom(UpgradeUnit upgradeUnit) { updateDataMapSchemaAndVersion(upgradeUnit); + updateExtensionSchema(upgradeUnit, CGEN); + updateExtensionSchema(upgradeUnit, DB_IMPORT); } private void removeGraphIncludes(UpgradeUnit upgradeUnit) { @@ -90,10 +93,10 @@ public class UpgradeHandler_V12 implements UpgradeHandler { File projectFile = new File(upgradeUnit.getResource().getURL().toURI()); File graphFile = new File(projectFile.getParentFile(), href); if (!Files.deleteIfExists(graphFile.toPath())) { - logger.warn("Graph file not found, skipping deletion: {}", graphFile); + LOGGER.warn("Graph file not found, skipping deletion: {}", graphFile); } } catch (Exception e) { - logger.warn("Failed to delete graph file '{}': {}", href, e.getMessage()); + LOGGER.warn("Failed to delete graph file '{}': {}", href, e.getMessage()); } } } diff --git a/cayenne-project/src/test/java/org/apache/cayenne/project/upgrade/handlers/UpgradeHandler_V12Test.java b/cayenne-project/src/test/java/org/apache/cayenne/project/upgrade/handlers/UpgradeHandler_V12Test.java index af7ba9b99..b8d8fbef9 100644 --- a/cayenne-project/src/test/java/org/apache/cayenne/project/upgrade/handlers/UpgradeHandler_V12Test.java +++ b/cayenne-project/src/test/java/org/apache/cayenne/project/upgrade/handlers/UpgradeHandler_V12Test.java @@ -72,6 +72,12 @@ public class UpgradeHandler_V12Test extends BaseUpgradeHandlerTest { document, XPathConstants.NODESET); assertEquals("xi:include must be removed", 0, includes.getLength()); + NodeList validation = (NodeList) xpath.evaluate("/domain/*[local-name()='validation']", + document, XPathConstants.NODESET); + assertEquals(1, validation.getLength()); + assertEquals("http://cayenne.apache.org/schema/12/validation", + ((Element) validation.item(0)).getAttribute("xmlns")); + assertFalse("graph file must be deleted", graphFile.exists()); } @@ -98,6 +104,19 @@ public class UpgradeHandler_V12Test extends BaseUpgradeHandlerTest { Element root = document.getDocumentElement(); assertEquals("12", root.getAttribute("project-version")); assertEquals("http://cayenne.apache.org/schema/12/modelMap", root.getAttribute("xmlns")); + + XPath xpath = XPathFactory.newInstance().newXPath(); + NodeList cgen = (NodeList) xpath.evaluate("/data-map/*[local-name()='cgen']", + document, XPathConstants.NODESET); + assertEquals(1, cgen.getLength()); + assertEquals("http://cayenne.apache.org/schema/12/cgen", + ((Element) cgen.item(0)).getAttribute("xmlns")); + + NodeList dbImport = (NodeList) xpath.evaluate("/data-map/*[local-name()='dbImport']", + document, XPathConstants.NODESET); + assertEquals(1, dbImport.getLength()); + assertEquals("http://cayenne.apache.org/schema/12/dbimport", + ((Element) dbImport.item(0)).getAttribute("xmlns")); } @Test diff --git a/cayenne-project/src/test/resources/org/apache/cayenne/project/upgrade/v12/cayenne-project1.xml b/cayenne-project/src/test/resources/org/apache/cayenne/project/upgrade/v12/cayenne-project1.xml index b305de836..efc673e1b 100644 --- a/cayenne-project/src/test/resources/org/apache/cayenne/project/upgrade/v12/cayenne-project1.xml +++ b/cayenne-project/src/test/resources/org/apache/cayenne/project/upgrade/v12/cayenne-project1.xml @@ -16,4 +16,7 @@ </data-source> </node> <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="project1.graph.xml"/> + <validation xmlns="http://cayenne.apache.org/schema/11/validation"> + <exclude>DATA_MAP_NODE_LINKAGE</exclude> + </validation> </domain> diff --git a/cayenne/src/main/java/org/apache/cayenne/configuration/DataChannelDescriptor.java b/cayenne/src/main/java/org/apache/cayenne/configuration/DataChannelDescriptor.java index 54386801a..d9fab97f9 100644 --- a/cayenne/src/main/java/org/apache/cayenne/configuration/DataChannelDescriptor.java +++ b/cayenne/src/main/java/org/apache/cayenne/configuration/DataChannelDescriptor.java @@ -43,8 +43,8 @@ public class DataChannelDescriptor implements ConfigurationNode, Serializable, X /** * The namespace in which the data map XML file will be created. */ - public static final String SCHEMA_XSD = "http://cayenne.apache.org/schema/11/domain"; - public static final String SCHEMA_XSD_LOCATION = "https://cayenne.apache.org/schema/11/domain.xsd"; + public static final String SCHEMA_XSD = "http://cayenne.apache.org/schema/12/domain"; + public static final String SCHEMA_XSD_LOCATION = "https://cayenne.apache.org/schema/12/domain.xsd"; protected String name; protected Map<String, String> properties; diff --git a/cayenne/src/main/java/org/apache/cayenne/configuration/xml/XMLDataChannelDescriptorLoader.java b/cayenne/src/main/java/org/apache/cayenne/configuration/xml/XMLDataChannelDescriptorLoader.java index c2ea04420..7fb711a84 100644 --- a/cayenne/src/main/java/org/apache/cayenne/configuration/xml/XMLDataChannelDescriptorLoader.java +++ b/cayenne/src/main/java/org/apache/cayenne/configuration/xml/XMLDataChannelDescriptorLoader.java @@ -38,69 +38,69 @@ import java.net.URL; import java.util.Arrays; /** - * @since 3.1 - * @since 4.1 moved from org.apache.cayenne.configuration package + * @since 4.1 */ public class XMLDataChannelDescriptorLoader implements DataChannelDescriptorLoader { - private static final Logger logger = LoggerFactory.getLogger(XMLDataChannelDescriptorLoader.class); + private static final Logger logger = LoggerFactory.getLogger(XMLDataChannelDescriptorLoader.class); - /** - * Versions of project XML files that this loader can read. - */ - static final String[] SUPPORTED_PROJECT_VERSIONS = {"11"}; - static { - Arrays.sort(SUPPORTED_PROJECT_VERSIONS); - } + /** + * Versions of project XML files that this loader can read. + */ + static final String[] SUPPORTED_PROJECT_VERSIONS = {"12"}; - @Inject - protected Provider<XMLReader> xmlReaderProvider; + static { + Arrays.sort(SUPPORTED_PROJECT_VERSIONS); + } - @Inject - protected DataMapLoader dataMapLoader; + @Inject + protected Provider<XMLReader> xmlReaderProvider; - @Inject - protected ConfigurationNameMapper nameMapper; + @Inject + protected DataMapLoader dataMapLoader; - @Inject - protected AdhocObjectFactory objectFactory; + @Inject + protected ConfigurationNameMapper nameMapper; - @Inject - protected HandlerFactory handlerFactory; + @Inject + protected AdhocObjectFactory objectFactory; - @Override - public ConfigurationTree<DataChannelDescriptor> load(Resource configurationResource) throws ConfigurationException { + @Inject + protected HandlerFactory handlerFactory; - if (configurationResource == null) { - throw new NullPointerException("Null configurationResource"); - } + @Override + public ConfigurationTree<DataChannelDescriptor> load(Resource configurationResource) throws ConfigurationException { - URL configurationURL = configurationResource.getURL(); + if (configurationResource == null) { + throw new NullPointerException("Null configurationResource"); + } - logger.info("Loading XML configuration resource from " + configurationURL); + URL configurationURL = configurationResource.getURL(); - final DataChannelDescriptor descriptor = new DataChannelDescriptor(); - descriptor.setConfigurationSource(configurationResource); - descriptor.setName(nameMapper.configurationNodeName(DataChannelDescriptor.class, configurationResource)); + logger.info("Loading XML configuration resource from " + configurationURL); - try(InputStream in = configurationURL.openStream()) { - XMLReader parser = xmlReaderProvider.get(); - LoaderContext loaderContext = new LoaderContext(parser, handlerFactory); - loaderContext.addDataMapListener(dataMap -> descriptor.getDataMaps().add(dataMap)); + final DataChannelDescriptor descriptor = new DataChannelDescriptor(); + descriptor.setConfigurationSource(configurationResource); + descriptor.setName(nameMapper.configurationNodeName(DataChannelDescriptor.class, configurationResource)); - DataChannelHandler rootHandler = new DataChannelHandler(this, descriptor, loaderContext); - parser.setContentHandler(rootHandler); - parser.setErrorHandler(rootHandler); - InputSource input = new InputSource(in); - input.setSystemId(configurationURL.toString()); - parser.parse(input); + try (InputStream in = configurationURL.openStream()) { + XMLReader parser = xmlReaderProvider.get(); + LoaderContext loaderContext = new LoaderContext(parser, handlerFactory); + loaderContext.addDataMapListener(dataMap -> descriptor.getDataMaps().add(dataMap)); + + DataChannelHandler rootHandler = new DataChannelHandler(this, descriptor, loaderContext); + parser.setContentHandler(rootHandler); + parser.setErrorHandler(rootHandler); + InputSource input = new InputSource(in); + input.setSystemId(configurationURL.toString()); + parser.parse(input); loaderContext.dataChannelLoaded(descriptor); - } catch (Exception e) { - throw new ConfigurationException("Error loading configuration from %s", e, configurationURL); - } + } catch (Exception e) { + throw new ConfigurationException("Error loading configuration from %s", e, configurationURL); + } - // TODO: andrus 03/10/2010 - actually provide load failures here... - return new ConfigurationTree<>(descriptor, null); - } + // TODO: andrus 03/10/2010 - actually provide load failures here... + return new ConfigurationTree<>(descriptor, null); + } } diff --git a/cayenne/src/main/java/org/apache/cayenne/map/DataMap.java b/cayenne/src/main/java/org/apache/cayenne/map/DataMap.java index 216abe6fe..706a22438 100644 --- a/cayenne/src/main/java/org/apache/cayenne/map/DataMap.java +++ b/cayenne/src/main/java/org/apache/cayenne/map/DataMap.java @@ -92,8 +92,8 @@ public class DataMap implements Serializable, ConfigurationNode, XMLSerializable * The namespace in which the data map XML file will be created. This is * also the URI to locate a copy of the schema document. */ - public static final String SCHEMA_XSD = "http://cayenne.apache.org/schema/11/modelMap"; - public static final String SCHEMA_XSD_LOCATION = "https://cayenne.apache.org/schema/11/modelMap.xsd"; + public static final String SCHEMA_XSD = "http://cayenne.apache.org/schema/12/modelMap"; + public static final String SCHEMA_XSD_LOCATION = "https://cayenne.apache.org/schema/12/modelMap.xsd"; protected String name; protected String location; diff --git a/cayenne/src/main/resources/org/apache/cayenne/schema/12/cgen.xsd b/cayenne/src/main/resources/org/apache/cayenne/schema/12/cgen.xsd new file mode 100644 index 000000000..3c29cbac1 --- /dev/null +++ b/cayenne/src/main/resources/org/apache/cayenne/schema/12/cgen.xsd @@ -0,0 +1,52 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!--~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + ~ Licensed to the Apache Software Foundation (ASF) under one + ~ or more contributor license agreements. See the NOTICE file + ~ distributed with this work for additional information + ~ regarding copyright ownership. The ASF licenses this file + ~ to you under the Apache License, Version 2.0 (the + ~ "License"); you may not use this file except in compliance + ~ with the License. You may obtain a copy of the License at + ~ + ~ https://www.apache.org/licenses/LICENSE-2.0 + ~ + ~ Unless required by applicable law or agreed to in writing, + ~ software distributed under the License is distributed on an + ~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + ~ KIND, either express or implied. See the License for the + ~ specific language governing permissions and limitations + ~ under the License. + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~--> + +<xs:schema targetNamespace="http://cayenne.apache.org/schema/12/cgen" + elementFormDefault="qualified" version="12" + xmlns:cay="http://cayenne.apache.org/schema/12/cgen" + xmlns:xs="http://www.w3.org/2001/XMLSchema"> + + <xs:element name="cgen"> + <xs:complexType> + <xs:sequence> + <xs:element name="name" minOccurs="0" type="xs:string"/> + <xs:element name="excludeEntities" minOccurs="0" type="xs:string"/> + <xs:element name="excludeEmbeddables" minOccurs="0" type="xs:string"/> + <xs:element name="destDir" minOccurs="0" type="xs:string"/> + <xs:element name="mode" minOccurs="0" type="xs:string"/> + <xs:element name="template" minOccurs="0" type="xs:string"/> + <xs:element name="superTemplate" minOccurs="0" type="xs:string"/> + <xs:element name="embeddableTemplate" minOccurs="0" type="xs:string"/> + <xs:element name="embeddableSuperTemplate" minOccurs="0" type="xs:string"/> + <xs:element name="dataMapTemplate" minOccurs="0" type="xs:string"/> + <xs:element name="dataMapSuperTemplate" minOccurs="0" type="xs:string"/> + <xs:element name="outputPattern" minOccurs="0" type="xs:string"/> + <xs:element name="makePairs" minOccurs="0" type="xs:boolean"/> + <xs:element name="skipRelationshipsLoading" minOccurs="0" type="xs:boolean"/> + <xs:element name="usePkgPath" minOccurs="0" type="xs:boolean"/> + <xs:element name="overwrite" minOccurs="0" type="xs:boolean"/> + <xs:element name="createPropertyNames" minOccurs="0" type="xs:boolean"/> + <xs:element name="superPkg" minOccurs="0" type="xs:string"/> + <xs:element name="createPKProperties" minOccurs="0" type="xs:boolean"/> + </xs:sequence> + </xs:complexType> + </xs:element> + +</xs:schema> diff --git a/cayenne/src/main/resources/org/apache/cayenne/schema/12/dbimport.xsd b/cayenne/src/main/resources/org/apache/cayenne/schema/12/dbimport.xsd new file mode 100644 index 000000000..ba1f9004b --- /dev/null +++ b/cayenne/src/main/resources/org/apache/cayenne/schema/12/dbimport.xsd @@ -0,0 +1,110 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!--~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + ~ Licensed to the Apache Software Foundation (ASF) under one + ~ or more contributor license agreements. See the NOTICE file + ~ distributed with this work for additional information + ~ regarding copyright ownership. The ASF licenses this file + ~ to you under the Apache License, Version 2.0 (the + ~ "License"); you may not use this file except in compliance + ~ with the License. You may obtain a copy of the License at + ~ + ~ https://www.apache.org/licenses/LICENSE-2.0 + ~ + ~ Unless required by applicable law or agreed to in writing, + ~ software distributed under the License is distributed on an + ~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + ~ KIND, either express or implied. See the License for the + ~ specific language governing permissions and limitations + ~ under the License. + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~--> + +<xs:schema targetNamespace="http://cayenne.apache.org/schema/12/dbimport" + xmlns:dbi="http://cayenne.apache.org/schema/12/dbimport" + xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified" version="12"> + + <xs:element name="dbImport" substitutionGroup="dbi:config"/> + <xs:element name="config"> + <xs:complexType> + <xs:complexContent> + <xs:extension base="dbi:container"> + <xs:sequence> + <xs:element name="catalog" minOccurs="0" maxOccurs="unbounded" type="dbi:catalog"/> + <xs:element name="schema" minOccurs="0" maxOccurs="unbounded" type="dbi:schema"/> + <xs:element name="tableTypes" minOccurs="0" type="dbi:tableTypes"/> + + <xs:element name="defaultPackage" minOccurs="0" type="xs:string"/> + <xs:element name="forceDataMapCatalog" minOccurs="0" type="xs:boolean"/> + <xs:element name="forceDataMapSchema" minOccurs="0" type="xs:boolean"/> + <xs:element name="meaningfulPkTables" minOccurs="0" type="xs:string"/> + <xs:element name="namingStrategy" minOccurs="0" type="xs:string"/> + <xs:element name="skipPrimaryKeyLoading" minOccurs="0" type="xs:boolean"/> + <xs:element name="skipRelationshipsLoading" minOccurs="0" type="xs:boolean"/> + <xs:element name="stripFromTableNames" minOccurs="0" type="xs:string"/> + <xs:element name="useJava7Types" minOccurs="0" type="xs:boolean"/> + + <xs:any minOccurs="0" maxOccurs="unbounded" namespace="##other" processContents="lax"/> + </xs:sequence> + </xs:extension> + </xs:complexContent> + </xs:complexType> + </xs:element> + + <xs:simpleType name="db-type"> + <xs:restriction base="xs:string"> + <xs:pattern value="[0-9a-zA-Z$_.]+"/> + </xs:restriction> + </xs:simpleType> + + <xs:complexType name="tableTypes"> + <xs:sequence> + <xs:element name="tableType" type="dbi:db-type" maxOccurs="unbounded"/> + </xs:sequence> + </xs:complexType> + + <xs:complexType name="includeTable" mixed="true"> + <xs:sequence> + <xs:element name="name" minOccurs="0" type="xs:string"/> + <xs:element name="includeColumn" type="xs:string" minOccurs="0" maxOccurs="unbounded"/> + <xs:element name="excludeColumn" type="xs:string" minOccurs="0" maxOccurs="unbounded"/> + + <xs:any minOccurs="0" maxOccurs="unbounded" namespace="##other" processContents="lax"/> + </xs:sequence> + </xs:complexType> + + <xs:complexType name="container" abstract="true"> + <xs:sequence> + <xs:element name="includeTable" type="dbi:includeTable" minOccurs="0" maxOccurs="unbounded"/> + <xs:element name="excludeTable" type="xs:string" minOccurs="0" maxOccurs="unbounded"/> + <xs:element name="includeColumn" type="xs:string" minOccurs="0" maxOccurs="unbounded"/> + <xs:element name="excludeColumn" type="xs:string" minOccurs="0" maxOccurs="unbounded"/> + <xs:element name="includeProcedure" type="xs:string" minOccurs="0" maxOccurs="unbounded"/> + <xs:element name="excludeProcedure" type="xs:string" minOccurs="0" maxOccurs="unbounded"/> + </xs:sequence> + </xs:complexType> + + <xs:complexType name="schema"> + <xs:complexContent> + <xs:extension base="dbi:container"> + <xs:sequence> + <xs:element name="name" type="dbi:db-type"/> + + <xs:any minOccurs="0" maxOccurs="unbounded" namespace="##other" processContents="lax"/> + </xs:sequence> + </xs:extension> + </xs:complexContent> + </xs:complexType> + + <xs:complexType name="catalog"> + <xs:complexContent> + <xs:extension base="dbi:container"> + <xs:sequence> + <xs:element name="name" type="dbi:db-type"/> + <xs:element name="schema" type="dbi:schema" minOccurs="0" maxOccurs="unbounded"/> + + <xs:any minOccurs="0" maxOccurs="unbounded" namespace="##other" processContents="lax"/> + </xs:sequence> + </xs:extension> + </xs:complexContent> + </xs:complexType> + +</xs:schema> diff --git a/cayenne/src/main/resources/org/apache/cayenne/schema/12/domain.xsd b/cayenne/src/main/resources/org/apache/cayenne/schema/12/domain.xsd new file mode 100644 index 000000000..3bc36c36c --- /dev/null +++ b/cayenne/src/main/resources/org/apache/cayenne/schema/12/domain.xsd @@ -0,0 +1,130 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!--~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + ~ Licensed to the Apache Software Foundation (ASF) under one + ~ or more contributor license agreements. See the NOTICE file + ~ distributed with this work for additional information + ~ regarding copyright ownership. The ASF licenses this file + ~ to you under the Apache License, Version 2.0 (the + ~ "License"); you may not use this file except in compliance + ~ with the License. You may obtain a copy of the License at + ~ + ~ https://www.apache.org/licenses/LICENSE-2.0 + ~ + ~ Unless required by applicable law or agreed to in writing, + ~ software distributed under the License is distributed on an + ~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + ~ KIND, either express or implied. See the License for the + ~ specific language governing permissions and limitations + ~ under the License. + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~--> + +<xs:schema targetNamespace="http://cayenne.apache.org/schema/12/domain" + elementFormDefault="qualified" version="12" + xmlns:xs="http://www.w3.org/2001/XMLSchema" + xmlns:cay="http://cayenne.apache.org/schema/12/domain"> + + <xs:element name="domain"> + <xs:complexType> + <xs:sequence> + <xs:element minOccurs="0" maxOccurs="unbounded" ref="cay:property"/> + <xs:element minOccurs="0" maxOccurs="unbounded" ref="cay:map"/> + <xs:element minOccurs="0" maxOccurs="unbounded" ref="cay:node"/> + <xs:any minOccurs="0" maxOccurs="unbounded" namespace="##other" processContents="lax"/> + </xs:sequence> + <xs:attribute name="project-version" use="required" type="xs:string"/> + </xs:complexType> + </xs:element> + + <xs:element name="property"> + <xs:annotation> + <xs:documentation>A generic property used by other elements.</xs:documentation> + </xs:annotation> + <xs:complexType> + <xs:attribute name="name" use="required" type="xs:string"/> + <xs:attribute name="value" use="required" type="xs:string"/> + </xs:complexType> + </xs:element> + + <xs:element name="map"> + <xs:annotation> + <xs:documentation>Link to an external file with data map.</xs:documentation> + </xs:annotation> + <xs:complexType> + <xs:attribute name="name" use="required" type="xs:string"/> + </xs:complexType> + </xs:element> + + <xs:element name="node"> + <xs:annotation> + <xs:documentation>Data node description.</xs:documentation> + </xs:annotation> + <xs:complexType> + <xs:sequence> + <xs:element minOccurs="0" maxOccurs="unbounded" ref="cay:map-ref"/> + <xs:element minOccurs="0" maxOccurs="unbounded" ref="cay:data-source"/> + <xs:any minOccurs="0" maxOccurs="unbounded" namespace="##other" processContents="lax"/> + </xs:sequence> + <xs:attribute name="name" use="required" type="xs:string"/> + <xs:attribute name="factory" use="required" type="xs:string"/> + <xs:attribute name="adapter" type="xs:string"/> + <xs:attribute name="schema-update-strategy" type="xs:string"/> + <xs:attribute name="parameters" type="xs:string"/> + </xs:complexType> + </xs:element> + + <xs:element name="map-ref"> + <xs:annotation> + <xs:documentation>A reference to a map.</xs:documentation> + </xs:annotation> + <xs:complexType> + <xs:attribute name="name" use="required" type="xs:string"/> + </xs:complexType> + </xs:element> + + <xs:element name="data-source"> + <xs:annotation> + <xs:documentation>Data source configuration.</xs:documentation> + </xs:annotation> + <xs:complexType> + <xs:sequence> + <xs:element minOccurs="0" maxOccurs="1" ref="cay:driver"/> + <xs:element minOccurs="0" maxOccurs="1" ref="cay:url"/> + <xs:element minOccurs="0" maxOccurs="1" ref="cay:connectionPool"/> + <xs:element minOccurs="0" maxOccurs="1" ref="cay:login"/> + <xs:any minOccurs="0" maxOccurs="unbounded" namespace="##other" processContents="lax"/> + </xs:sequence> + </xs:complexType> + </xs:element> + + <xs:element name="driver"> + <xs:complexType> + <xs:attribute name="value" type="xs:string"/> + </xs:complexType> + </xs:element> + + <xs:element name="url"> + <xs:complexType> + <xs:attribute name="value" type="xs:string"/> + </xs:complexType> + </xs:element> + + <xs:element name="connectionPool"> + <xs:complexType> + <xs:attribute name="min" use="required" type="xs:int"/> + <xs:attribute name="max" use="required" type="xs:int"/> + </xs:complexType> + </xs:element> + + <xs:element name="login"> + <xs:complexType> + <xs:attribute name="userName" type="xs:string"/> + <xs:attribute name="password" type="xs:string"/> + <xs:attribute name="passwordLocation" type="xs:string"/> + <xs:attribute name="passwordSource" type="xs:string"/> + <xs:attribute name="encoderClass" type="xs:string"/> + <xs:attribute name="encoderKey" type="xs:string"/> + <xs:attribute name="encoderSalt" type="xs:string"/> + </xs:complexType> + </xs:element> + +</xs:schema> diff --git a/cayenne/src/main/resources/org/apache/cayenne/schema/12/info.xsd b/cayenne/src/main/resources/org/apache/cayenne/schema/12/info.xsd new file mode 100644 index 000000000..95e089f79 --- /dev/null +++ b/cayenne/src/main/resources/org/apache/cayenne/schema/12/info.xsd @@ -0,0 +1,29 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!--~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + ~ Licensed to the Apache Software Foundation (ASF) under one + ~ or more contributor license agreements. See the NOTICE file + ~ distributed with this work for additional information + ~ regarding copyright ownership. The ASF licenses this file + ~ to you under the Apache License, Version 2.0 (the + ~ "License"); you may not use this file except in compliance + ~ with the License. You may obtain a copy of the License at + ~ + ~ https://www.apache.org/licenses/LICENSE-2.0 + ~ + ~ Unless required by applicable law or agreed to in writing, + ~ software distributed under the License is distributed on an + ~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + ~ KIND, either express or implied. See the License for the + ~ specific language governing permissions and limitations + ~ under the License. + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~--> + +<xs:schema targetNamespace="http://cayenne.apache.org/schema/12/info" + xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified" version="12"> + <xs:element name="property"> + <xs:complexType> + <xs:attribute name="name" use="required" type="xs:string"/> + <xs:attribute name="value" type="xs:string"/> + </xs:complexType> + </xs:element> +</xs:schema> diff --git a/cayenne/src/main/resources/org/apache/cayenne/schema/12/modelMap.xsd b/cayenne/src/main/resources/org/apache/cayenne/schema/12/modelMap.xsd new file mode 100644 index 000000000..1911c0813 --- /dev/null +++ b/cayenne/src/main/resources/org/apache/cayenne/schema/12/modelMap.xsd @@ -0,0 +1,364 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!--~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + ~ Licensed to the Apache Software Foundation (ASF) under one + ~ or more contributor license agreements. See the NOTICE file + ~ distributed with this work for additional information + ~ regarding copyright ownership. The ASF licenses this file + ~ to you under the Apache License, Version 2.0 (the + ~ "License"); you may not use this file except in compliance + ~ with the License. You may obtain a copy of the License at + ~ + ~ https://www.apache.org/licenses/LICENSE-2.0 + ~ + ~ Unless required by applicable law or agreed to in writing, + ~ software distributed under the License is distributed on an + ~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + ~ KIND, either express or implied. See the License for the + ~ specific language governing permissions and limitations + ~ under the License. + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~--> + +<!-- + Cayenne entity map schema + Defines format of Cayenne DataMap XML files (*.map.xml). DataMap files contain + the metadata needed for Cayenne object-relational features. Multiple DataMaps + are usually combined in one shared namespace, so the elements of the DataMap + may reference objects from other DataMaps. +--> +<xs:schema targetNamespace="http://cayenne.apache.org/schema/12/modelMap" + xmlns:cay="http://cayenne.apache.org/schema/12/modelMap" + xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified" version="12"> + <xs:element name="data-map"> + <xs:complexType> + <xs:sequence> + <xs:element minOccurs="0" maxOccurs="unbounded" ref="cay:property"/> + <xs:element minOccurs="0" maxOccurs="unbounded" ref="cay:embeddable"/> + <xs:element minOccurs="0" maxOccurs="unbounded" ref="cay:procedure"/> + <xs:element minOccurs="0" maxOccurs="unbounded" ref="cay:db-entity"/> + <xs:element minOccurs="0" maxOccurs="unbounded" ref="cay:obj-entity"/> + <xs:element minOccurs="0" maxOccurs="unbounded" ref="cay:db-relationship"/> + <xs:element minOccurs="0" maxOccurs="unbounded" ref="cay:obj-relationship"/> + <xs:element minOccurs="0" maxOccurs="unbounded" ref="cay:query"/> + <xs:any minOccurs="0" maxOccurs="unbounded" namespace="##other" processContents="lax"/> + </xs:sequence> + <xs:attribute name="project-version" use="required" type="xs:string"/> + </xs:complexType> + </xs:element> + <xs:element name="db-entity"> + <xs:complexType> + <xs:sequence> + <xs:element maxOccurs="unbounded" ref="cay:db-attribute"/> + <xs:element minOccurs="0" ref="cay:db-key-generator"/> + + <!-- Qualifier for DB Entity --> + <xs:element minOccurs="0" ref="cay:qualifier"/> + + <xs:any minOccurs="0" maxOccurs="unbounded" namespace="##other" processContents="lax"/> + </xs:sequence> + <xs:attribute name="name" use="required" type="xs:string"/> + <xs:attribute name="schema" type="xs:string"/> + <xs:attribute name="catalog" type="xs:string"/> + </xs:complexType> + </xs:element> + <xs:element name="db-attribute"> + <xs:annotation> + <xs:documentation>A database column.</xs:documentation> + </xs:annotation> + <xs:complexType> + <xs:sequence> + <xs:any minOccurs="0" maxOccurs="unbounded" namespace="##other" processContents="lax"/> + </xs:sequence> + <xs:attribute name="isMandatory" type="xs:boolean"/> + <xs:attribute name="isPrimaryKey" type="xs:boolean"> + <xs:annotation> + <xs:documentation>If true, the value of attribute is unique and used as a primary key identifier.</xs:documentation> + </xs:annotation> + </xs:attribute> + <xs:attribute name="isGenerated" type="xs:boolean"/> + <xs:attribute name="length" type="xs:integer"/> + <xs:attribute name="name" use="required" type="xs:string"/> + <xs:attribute name="scale" type="xs:integer"/> + <xs:attribute name="type" use="required" type="xs:string"/> + </xs:complexType> + </xs:element> + + <xs:element name="obj-entity"> + <xs:annotation> + <xs:documentation>A persistent Java class managed by Cayenne.</xs:documentation> + </xs:annotation> + <xs:complexType> + <xs:sequence> + <xs:element minOccurs="0" ref="cay:qualifier"/> + <xs:element minOccurs="0" maxOccurs="unbounded" ref="cay:embedded-attribute"/> + <xs:element minOccurs="0" maxOccurs="unbounded" ref="cay:obj-attribute"/> + <xs:element minOccurs="0" maxOccurs="unbounded" ref="cay:attribute-override"/> + + <!-- Callbacks --> + <xs:element minOccurs="0" maxOccurs="unbounded" ref="cay:post-add"/> + <xs:element minOccurs="0" maxOccurs="unbounded" ref="cay:pre-persist"/> + <xs:element minOccurs="0" maxOccurs="unbounded" ref="cay:post-persist"/> + <xs:element minOccurs="0" maxOccurs="unbounded" ref="cay:pre-update"/> + <xs:element minOccurs="0" maxOccurs="unbounded" ref="cay:post-update"/> + <xs:element minOccurs="0" maxOccurs="unbounded" ref="cay:pre-remove"/> + <xs:element minOccurs="0" maxOccurs="unbounded" ref="cay:post-remove"/> + <xs:element minOccurs="0" maxOccurs="unbounded" ref="cay:post-load"/> + + <xs:any minOccurs="0" maxOccurs="unbounded" namespace="##other" processContents="lax"/> + </xs:sequence> + <xs:attribute name="className" type="xs:string"/> + <xs:attribute name="abstract" type="xs:boolean"/> + <xs:attribute name="readOnly" type="xs:boolean"/> + <xs:attribute name="dbEntityName" type="xs:string"/> + <xs:attribute name="lock-type" type="xs:string"/> + <xs:attribute name="name" use="required" type="xs:string"/> + <xs:attribute name="superClassName" type="xs:string"/> + <xs:attribute name="superEntityName" type="xs:string"/> + </xs:complexType> + </xs:element> + + <xs:element name="qualifier" type="xs:string"/> + + <xs:element name="obj-attribute"> + <xs:complexType> + <xs:sequence> + <xs:any minOccurs="0" maxOccurs="unbounded" namespace="##other" processContents="lax"/> + </xs:sequence> + <xs:attribute name="db-attribute-path" type="xs:string"/> + <xs:attribute name="lock" type="xs:boolean"/> + <xs:attribute name="name" use="required" type="xs:string"/> + <xs:attribute name="type" use="required" type="xs:string"/> + <xs:attribute name="lazy" type="xs:boolean"/> + </xs:complexType> + </xs:element> + + <xs:element name="attribute-override"> + <xs:complexType> + <xs:attribute name="db-attribute-path" type="xs:string"/> + <xs:attribute name="lock" type="xs:boolean"/> + <xs:attribute name="name" type="xs:string"/> + <xs:attribute name="type" type="xs:string"/> + </xs:complexType> + </xs:element> + + <xs:element name="db-relationship"> + <xs:complexType> + <xs:sequence> + <xs:element minOccurs="1" maxOccurs="unbounded" ref="cay:db-attribute-pair"/> + <xs:any minOccurs="0" maxOccurs="unbounded" namespace="##other" processContents="lax"/> + </xs:sequence> + <xs:attribute name="name" use="required" type="xs:string"/> + <xs:attribute name="source" use="required" type="xs:string"/> + <xs:attribute name="target" use="required" type="xs:string"/> + <xs:attribute name="toDependentPK" type="xs:boolean"/> + <xs:attribute name="toMany" type="xs:boolean"/> + </xs:complexType> + </xs:element> + <xs:element name="db-attribute-pair"> + <xs:complexType> + <xs:attribute name="source" use="required" type="xs:string"/> + <xs:attribute name="target" use="required" type="xs:string"/> + </xs:complexType> + </xs:element> + <xs:element name="obj-relationship"> + <xs:complexType> + <xs:sequence> + <xs:any minOccurs="0" maxOccurs="unbounded" namespace="##other" processContents="lax"/> + </xs:sequence> + <xs:attribute name="db-relationship-path" use="required" type="xs:string"/> + <xs:attribute name="deleteRule" type="xs:string"/> + <xs:attribute name="lock" type="xs:boolean"/> + <xs:attribute name="name" use="required" type="xs:string"/> + <xs:attribute name="source" use="required" type="xs:string"/> + <xs:attribute name="target" use="required" type="xs:string"/> + <xs:attribute name="collection-type" type="xs:string"/> + <xs:attribute name="map-key" type="xs:string"/> + </xs:complexType> + </xs:element> + + <xs:element name="query"> + <xs:complexType> + <xs:sequence> + <xs:element minOccurs="0" maxOccurs="unbounded" ref="cay:property"/> + <xs:element minOccurs="0" maxOccurs="unbounded" ref="cay:sql"/> + <xs:element minOccurs="0" maxOccurs="unbounded" ref="cay:ejbql"/> + <xs:element name="qualifier" minOccurs="0" maxOccurs="unbounded" type="xs:string"/> + <xs:element minOccurs="0" maxOccurs="unbounded" ref="cay:ordering"/> + <xs:element minOccurs="0" maxOccurs="unbounded" ref="cay:prefetch"/> + <xs:any minOccurs="0" maxOccurs="unbounded" namespace="##other" processContents="lax"/> + </xs:sequence> + <xs:attribute name="type" use="required" type="xs:string"/> + <xs:attribute name="name" use="required" type="xs:string"/> + <xs:attribute name="root" type="xs:string"/> + <xs:attribute name="root-name" type="xs:string"/> + <xs:attribute name="result-entity" type="xs:string"/> + </xs:complexType> + </xs:element> + + <xs:element name="ordering"> + <xs:complexType> + <xs:simpleContent> + <xs:extension base="xs:string"> + <xs:attribute name="descending" type="xs:boolean"/> + <xs:attribute name="ignore-case" type="xs:boolean"/> + </xs:extension> + </xs:simpleContent> + </xs:complexType> + </xs:element> + + <xs:element name="prefetch"> + <xs:complexType> + <xs:simpleContent> + <xs:extension base="xs:string"> + <xs:attribute name="type" type="xs:string"/> + </xs:extension> + </xs:simpleContent> + </xs:complexType> + </xs:element> + + <xs:element name="sql"> + <xs:annotation> + <xs:documentation>Defines arbitrary SQL statement. Note that SQL statement can be customized for different SQL dialects per DbAdapter class. If no adapter-specific statement is found, the one with no adapter label is used by default.</xs:documentation> + </xs:annotation> + <xs:complexType> + <xs:simpleContent> + <xs:extension base="xs:string"> + <xs:attribute name="adapter-class" type="xs:string"/> + </xs:extension> + </xs:simpleContent> + </xs:complexType> + </xs:element> + + <xs:element name="ejbql" type="xs:string"/> + + <xs:element name="property"> + <xs:annotation> + <xs:documentation>A generic property used by other elements.</xs:documentation> + </xs:annotation> + <xs:complexType> + <xs:attribute name="name" use="required" type="xs:string"/> + <xs:attribute name="value" use="required" type="xs:string"/> + </xs:complexType> + </xs:element> + <xs:element name="embeddable"> + <xs:complexType> + <xs:sequence> + <xs:element name="embeddable-attribute" minOccurs="0" maxOccurs="unbounded"> + <xs:complexType> + <xs:attribute name="name" use="required" type="xs:string"/> + <xs:attribute name="type" use="required" type="xs:string"/> + <xs:attribute name="db-attribute-name" use="required" type="xs:string"/> + </xs:complexType> + </xs:element> + <xs:any minOccurs="0" maxOccurs="unbounded" namespace="##other" processContents="lax"/> + </xs:sequence> + <xs:attribute name="className" use="required" type="xs:string"/> + </xs:complexType> + </xs:element> + + <xs:element name="embedded-attribute"> + <xs:complexType> + <xs:sequence> + <xs:element minOccurs="0" maxOccurs="unbounded" + ref="cay:embeddable-attribute-override"/> + </xs:sequence> + <xs:attribute name="type" use="required" type="xs:string"/> + <xs:attribute name="name" use="required" type="xs:string"/> + </xs:complexType> + </xs:element> + + <xs:element name="embeddable-attribute-override"> + <xs:complexType> + <xs:attribute name="db-attribute-path" use="required" type="xs:string"/> + <xs:attribute name="name" use="required" type="xs:string"/> + </xs:complexType> + </xs:element> + + <xs:element name="procedure"> + <xs:complexType> + <xs:sequence> + <xs:element minOccurs="0" maxOccurs="unbounded" name="procedure-parameter"> + <xs:complexType> + <xs:attribute name="name" use="required" type="xs:string"/> + <xs:attribute name="type" use="required" type="xs:string"/> + <xs:attribute name="length" type="xs:integer"/> + <xs:attribute name="direction" use="required" type="xs:string"/> + </xs:complexType> + </xs:element> + <xs:any minOccurs="0" maxOccurs="unbounded" namespace="##other" processContents="lax"/> + </xs:sequence> + <xs:attribute name="name" use="required" type="xs:string"/> + <xs:attribute name="schema" type="xs:string"/> + <xs:attribute name="catalog" type="xs:string"/> + <xs:attribute name="returningValue" type="xs:boolean"/> + </xs:complexType> + </xs:element> + <xs:element name="pre-update"> + <xs:complexType> + <xs:attribute name="method-name" use="required" type="xs:string"/> + </xs:complexType> + </xs:element> + <xs:element name="post-persist"> + <xs:complexType> + <xs:attribute name="method-name" use="required" type="xs:string"/> + </xs:complexType> + </xs:element> + <xs:element name="post-update"> + <xs:complexType> + <xs:attribute name="method-name" use="required" type="xs:string"/> + </xs:complexType> + </xs:element> + <xs:element name="post-add"> + <xs:complexType> + <xs:attribute name="method-name" use="required" type="xs:string"/> + </xs:complexType> + </xs:element> + <xs:element name="pre-persist"> + <xs:complexType> + <xs:attribute name="method-name" use="required" type="xs:string"/> + </xs:complexType> + </xs:element> + <xs:element name="post-remove"> + <xs:complexType> + <xs:attribute name="method-name" use="required" type="xs:string"/> + </xs:complexType> + </xs:element> + <xs:element name="post-load"> + <xs:complexType> + <xs:attribute name="method-name" use="required" type="xs:string"/> + </xs:complexType> + </xs:element> + <xs:element name="pre-remove"> + <xs:complexType> + <xs:attribute name="method-name" use="required" type="xs:string"/> + </xs:complexType> + </xs:element> + + <xs:element name="db-key-generator"> + <xs:annotation> + <xs:documentation>Used to install the Automatic Sequence/Key Generation facility for db-entity. This feature is intended for use with simple (non-compound) integral primary keys.</xs:documentation> + </xs:annotation> + <xs:complexType> + <xs:sequence> + <xs:element name="db-generator-type" type="xs:string"> + <xs:annotation> + <xs:documentation>Specifies the Key Generation Method that will be employed + 'ORACLE' - use Oracle's SEQUENCE + 'NAMED_SEQUENCE_TABLE' - use USER designated SEQUENCE TABLE. User specifies the name of a DBMS Table with the schema (sequence INT) which will be used to hold sequence values (not supported yet)</xs:documentation> + </xs:annotation> + </xs:element> + <xs:element minOccurs="0" name="db-generator-name" type="xs:string"> + <xs:annotation> + <xs:documentation>For db-generator-type ORACLE this is the name of the ORACLE SEQUENCE to use. The SEQUENCE is assumed to already exist in the Database. +If this is db-generator-type NAMED_SEQUENCE_TABLE Key Generation, this specifies the name of the SEQUENCE TABLE to use. The NAMED_SEQUENCE_TABLE is assumed to already exist in the database.</xs:documentation> + </xs:annotation> + </xs:element> + <xs:element minOccurs="0" name="db-key-cache-size" type="xs:integer"> + <xs:annotation> + <xs:documentation>Size of key cache. For db-generator-type ORACLE , this value MUST match the Oracle SEQUENCE INCREMENT value. If there is a mismatch between this value and the Oracle SEQUENCE INCREMENT value, then there will likely be duplicate key problems. +For db-generator-type NAMED_SEQUENCE_TABLE , this tells how many keys the Container will fetch in a single DBMS call.</xs:documentation> + </xs:annotation> + </xs:element> + </xs:sequence> + </xs:complexType> + </xs:element> +</xs:schema> diff --git a/cayenne/src/main/resources/org/apache/cayenne/schema/12/validation.xsd b/cayenne/src/main/resources/org/apache/cayenne/schema/12/validation.xsd new file mode 100644 index 000000000..c02320c2a --- /dev/null +++ b/cayenne/src/main/resources/org/apache/cayenne/schema/12/validation.xsd @@ -0,0 +1,30 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!--~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + ~ Licensed to the Apache Software Foundation (ASF) under one + ~ or more contributor license agreements. See the NOTICE file + ~ distributed with this work for additional information + ~ regarding copyright ownership. The ASF licenses this file + ~ to you under the Apache License, Version 2.0 (the + ~ "License"); you may not use this file except in compliance + ~ with the License. You may obtain a copy of the License at + ~ + ~ https://www.apache.org/licenses/LICENSE-2.0 + ~ + ~ Unless required by applicable law or agreed to in writing, + ~ software distributed under the License is distributed on an + ~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + ~ KIND, either express or implied. See the License for the + ~ specific language governing permissions and limitations + ~ under the License. + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~--> + +<xs:schema targetNamespace="http://cayenne.apache.org/schema/12/validation" + xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified" version="12"> + <xs:element name="validation"> + <xs:complexType> + <xs:sequence> + <xs:element name="exclude" minOccurs="0" type="xs:string"/> + </xs:sequence> + </xs:complexType> + </xs:element> +</xs:schema>
