You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cayenne.apache.org by nt...@apache.org on 2017/02/01 14:46:56 UTC
[09/10] cayenne git commit: CAY-2215 rename "plugins" folder and
"cayenne-plugins-parent" module New names are "maven-plugins" and
"cayenne-maven-plugins-parent"
http://git-wip-us.apache.org/repos/asf/cayenne/blob/a0cd93d6/maven-plugins/cayenne-maven-plugin/src/test/resources/cgen/testAdditionalMap.map.xml
----------------------------------------------------------------------
diff --git a/maven-plugins/cayenne-maven-plugin/src/test/resources/cgen/testAdditionalMap.map.xml b/maven-plugins/cayenne-maven-plugin/src/test/resources/cgen/testAdditionalMap.map.xml
new file mode 100644
index 0000000..f9a80fb
--- /dev/null
+++ b/maven-plugins/cayenne-maven-plugin/src/test/resources/cgen/testAdditionalMap.map.xml
@@ -0,0 +1,18 @@
+<?xml version="1.0" encoding="utf-8"?>
+<data-map xmlns="http://cayenne.apache.org/schema/3.0/modelMap"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://cayenne.apache.org/schema/3.0/modelMap http://cayenne.apache.org/schema/3.0/modelMap.xsd"
+ project-version="6">
+ <property name="defaultPackage" value="pack"/>
+ <db-entity name="TestRelEntity">
+ <db-attribute name="ID" type="INTEGER" isPrimaryKey="true" isMandatory="true"/>
+ <db-attribute name="NAME" type="VARCHAR" length="200"/>
+ </db-entity>
+ <obj-entity name="TestRelEntity" className="pack.TestRelEntity" dbEntityName="TestRelEntity">
+ <obj-attribute name="name" type="java.lang.String" db-attribute-path="NAME"/>
+ </obj-entity>
+ <db-relationship name="additionalRel" source="TestRelEntity" target="TestEntity" toMany="false">
+ <db-attribute-pair source="ID" target="TestRelEntity_ID"/>
+ </db-relationship>
+ <obj-relationship name="additionalRel" source="TestRelEntity" target="TestEntity" deleteRule="Nullify" db-relationship-path="additionalRel"/>
+</data-map>
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/cayenne/blob/a0cd93d6/maven-plugins/cayenne-maven-plugin/src/test/resources/cgen/testDomainMap.map.xml
----------------------------------------------------------------------
diff --git a/maven-plugins/cayenne-maven-plugin/src/test/resources/cgen/testDomainMap.map.xml b/maven-plugins/cayenne-maven-plugin/src/test/resources/cgen/testDomainMap.map.xml
new file mode 100644
index 0000000..d0ff3f5
--- /dev/null
+++ b/maven-plugins/cayenne-maven-plugin/src/test/resources/cgen/testDomainMap.map.xml
@@ -0,0 +1,45 @@
+<?xml version="1.0" encoding="utf-8"?>
+<data-map xmlns="http://cayenne.apache.org/schema/3.0/modelMap"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://cayenne.apache.org/schema/3.0/modelMap http://cayenne.apache.org/schema/3.0/modelMap.xsd"
+ project-version="6">
+ <property name="defaultPackage" value="pack"/>
+ <embeddable className="pack.Embeddable">
+ <embeddable-attribute name="embAttr" type="java.lang.String" db-attribute-name="EMB_ATTR"/>
+ </embeddable>
+ <db-entity name="NotIncludedEntity">
+ <db-attribute name="id" type="BIGINT" isPrimaryKey="true" isMandatory="true"/>
+ <db-attribute name="name" type="VARCHAR" length="255"/>
+ </db-entity>
+ <db-entity name="TestEntity">
+ <db-attribute name="id" type="BIGINT" isPrimaryKey="true" isMandatory="true"/>
+ <db-attribute name="testAttr" type="VARCHAR" length="255"/>
+ <db-attribute name="TestRelEntity_ID" type="INTEGER"/>
+ </db-entity>
+ <db-entity name="TestExcludedEntity">
+ <db-attribute name="id" type="BIGINT" isPrimaryKey="true" isMandatory="true"/>
+ <db-attribute name="name" type="VARCHAR" length="255"/>
+ </db-entity>
+ <obj-entity name="NotIncludedEntity" className="pack.NotIncludedEntity" dbEntityName="NotIncludedEntity">
+ <obj-attribute name="name" type="java.lang.String" db-attribute-path="name"/>
+ </obj-entity>
+ <obj-entity name="TestEntity" className="pack.TestEntity" dbEntityName="TestEntity">
+ <embedded-attribute name="embeddedAtr" type="pack.Embeddable"/>
+ <obj-attribute name="testAttr" type="java.lang.String" db-attribute-path="testAttr"/>
+ </obj-entity>
+ <obj-entity name="TestExcludedEntity" className="pack.TestExcludedEntity" dbEntityName="TestExcludedEntity">
+ <obj-attribute name="name" type="java.lang.String" db-attribute-path="name"/>
+ </obj-entity>
+ <db-relationship name="childrenRel" source="TestEntity" target="TestEntity" toMany="true">
+ <db-attribute-pair source="id" target="id"/>
+ </db-relationship>
+ <db-relationship name="parentRel" source="TestEntity" target="TestEntity" toMany="false">
+ <db-attribute-pair source="id" target="id"/>
+ </db-relationship>
+ <db-relationship name="additionalRel" source="TestEntity" target="TestRelEntity" toMany="true">
+ <db-attribute-pair source="TestRelEntity_ID" target="ID"/>
+ </db-relationship>
+ <obj-relationship name="childrenRel" source="TestEntity" target="TestEntity" deleteRule="Deny" db-relationship-path="childrenRel"/>
+ <obj-relationship name="parentRel" source="TestEntity" target="TestEntity" deleteRule="Nullify" db-relationship-path="parentRel"/>
+ <obj-relationship name="additionalRel" source="TestEntity" target="TestRelEntity" deleteRule="Deny" db-relationship-path="additionalRel"/>
+</data-map>
http://git-wip-us.apache.org/repos/asf/cayenne/blob/a0cd93d6/maven-plugins/cayenne-maven-plugin/src/test/resources/org/apache/cayenne/tools/config/pom-01.xml
----------------------------------------------------------------------
diff --git a/maven-plugins/cayenne-maven-plugin/src/test/resources/org/apache/cayenne/tools/config/pom-01.xml b/maven-plugins/cayenne-maven-plugin/src/test/resources/org/apache/cayenne/tools/config/pom-01.xml
new file mode 100644
index 0000000..90f5a14
--- /dev/null
+++ b/maven-plugins/cayenne-maven-plugin/src/test/resources/org/apache/cayenne/tools/config/pom-01.xml
@@ -0,0 +1,99 @@
+<?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
+ ~
+ ~ http://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.
+ -->
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
+ http://maven.apache.org/xsd/maven-4.0.0.xsd">
+
+ <name>DbImporterMojo Test1</name>
+
+ <build>
+ <plugins>
+ <plugin>
+ <artifactId>cayenne-maven-plugin</artifactId>
+ <configuration>
+ <map>target/test/org/apache/cayenne/tools/dbimporter-map1.map.xml</map>
+
+ <dbimport>
+ <catalog>catalog-name-01</catalog>
+
+ <catalog>
+ <name>catalog-name-02</name>
+
+ <schema>schema-name-01</schema>
+
+ <schema>
+ <name>schema-name-02</name>
+
+ <includeTable>incTable-01</includeTable>
+ <excludeTable>excTable-01</excludeTable>
+
+ <includeTable>
+ <pattern>incTable-02</pattern>
+
+ <includeColumn>includeColumn-01</includeColumn>
+ <excludeColumn>excludeColumn-01</excludeColumn>
+ </includeTable>
+
+ <includeColumn>includeColumn-02</includeColumn>
+ <excludeColumn>excludeColumn-02</excludeColumn>
+ </schema>
+
+ <includeColumn>includeColumn-03</includeColumn>
+ <excludeColumn>excludeColumn-03</excludeColumn>
+ </catalog>
+
+ <schema>schema-name-03</schema>
+
+ <schema>
+ <name>schema-name-04</name>
+
+ <includeTable>incTable-04</includeTable>
+ <excludeTable>excTable-04</excludeTable>
+
+ <includeTable>
+ <pattern>incTable-05</pattern>
+
+ <includeColumn>includeColumn-04</includeColumn>
+ <excludeColumn>excludeColumn-04</excludeColumn>
+ </includeTable>
+
+ <includeColumn>includeColumn-04</includeColumn>
+ <excludeColumn>excludeColumn-04</excludeColumn>
+ </schema>
+
+ <includeTable>incTable-06</includeTable>
+ <excludeTable>excTable-06</excludeTable>
+
+ <includeTable>
+ <pattern>incTable-07</pattern>
+
+ <includeColumn>includeColumn-06</includeColumn>
+ <excludeColumn>excludeColumn-06</excludeColumn>
+ </includeTable>
+
+ <includeColumn>includeColumn-05</includeColumn>
+ <excludeColumn>excludeColumn-05</excludeColumn>
+ </dbimport>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+
+</project>
http://git-wip-us.apache.org/repos/asf/cayenne/blob/a0cd93d6/maven-plugins/cayenne-maven-plugin/src/test/resources/org/apache/cayenne/tools/config/pom-catalog-and-schema.xml
----------------------------------------------------------------------
diff --git a/maven-plugins/cayenne-maven-plugin/src/test/resources/org/apache/cayenne/tools/config/pom-catalog-and-schema.xml b/maven-plugins/cayenne-maven-plugin/src/test/resources/org/apache/cayenne/tools/config/pom-catalog-and-schema.xml
new file mode 100644
index 0000000..a8df865
--- /dev/null
+++ b/maven-plugins/cayenne-maven-plugin/src/test/resources/org/apache/cayenne/tools/config/pom-catalog-and-schema.xml
@@ -0,0 +1,84 @@
+<?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
+ ~
+ ~ http://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.
+ -->
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
+ http://maven.apache.org/xsd/maven-4.0.0.xsd">
+
+ <build>
+ <plugins>
+ <plugin>
+ <artifactId>cayenne-maven-plugin</artifactId>
+ <configuration>
+ <map>target/test/org/apache/cayenne/tools/dbimporter-map1.map.xml</map>
+
+ <dbimport>
+ <catalog>
+ <name>catalog-name</name>
+ <schema>
+ <name>schema-name</name>
+ <includeTable>includeTable-01</includeTable>
+
+ <includeTable>
+ <pattern>includeTable-02</pattern>
+ </includeTable>
+
+ <includeTable>
+ <pattern>includeTable-03</pattern>
+
+ <includeColumn>includeColumn-01</includeColumn>
+ <excludeColumn>excludeColumn-01</excludeColumn>
+ </includeTable>
+
+ <excludeTable>excludeTable-01</excludeTable>
+ <excludeTable>
+ <pattern>excludeTable-02</pattern>
+ </excludeTable>
+ <excludeTable>excludeTable-03</excludeTable>
+
+ <includeColumn>includeColumn-01</includeColumn>
+ <includeColumn>
+ <pattern>includeColumn-02</pattern>
+ </includeColumn>
+ <includeColumn>includeColumn-03</includeColumn>
+ <excludeColumn>excludeColumn-01</excludeColumn>
+ <excludeColumn>
+ <pattern>excludeColumn-02</pattern>
+ </excludeColumn>
+ <excludeColumn>excludeColumn-03</excludeColumn>
+
+ <includeProcedure>includeProcedure-01</includeProcedure>
+ <includeProcedure>
+ <pattern>includeProcedure-02</pattern>
+ </includeProcedure>
+ <includeProcedure>includeProcedure-03</includeProcedure>
+ <excludeProcedure>excludeProcedure-01</excludeProcedure>
+ <excludeProcedure>
+ <pattern>excludeProcedure-02</pattern>
+ </excludeProcedure>
+ <excludeProcedure>excludeProcedure-03</excludeProcedure>
+ </schema>
+ </catalog>
+ </dbimport>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+
+</project>
http://git-wip-us.apache.org/repos/asf/cayenne/blob/a0cd93d6/maven-plugins/cayenne-maven-plugin/src/test/resources/org/apache/cayenne/tools/config/pom-catalog.xml
----------------------------------------------------------------------
diff --git a/maven-plugins/cayenne-maven-plugin/src/test/resources/org/apache/cayenne/tools/config/pom-catalog.xml b/maven-plugins/cayenne-maven-plugin/src/test/resources/org/apache/cayenne/tools/config/pom-catalog.xml
new file mode 100644
index 0000000..6cfe54d
--- /dev/null
+++ b/maven-plugins/cayenne-maven-plugin/src/test/resources/org/apache/cayenne/tools/config/pom-catalog.xml
@@ -0,0 +1,87 @@
+<?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
+ ~
+ ~ http://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.
+ -->
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
+ http://maven.apache.org/xsd/maven-4.0.0.xsd">
+
+ <build>
+ <plugins>
+ <plugin>
+ <artifactId>cayenne-maven-plugin</artifactId>
+ <configuration>
+ <map>target/test/org/apache/cayenne/tools/dbimporter-map1.map.xml</map>
+
+ <dbimport>
+ <catalog>catalog-name-01</catalog>
+
+ <catalog>
+ <name>catalog-name-02</name>
+ </catalog>
+
+ <catalog>
+ <name>catalog-name-03</name>
+ <includeTable>includeTable-01</includeTable>
+
+ <includeTable>
+ <pattern>includeTable-02</pattern>
+ </includeTable>
+
+ <includeTable>
+ <pattern>includeTable-03</pattern>
+
+ <includeColumn>includeColumn-01</includeColumn>
+ <excludeColumn>excludeColumn-01</excludeColumn>
+ </includeTable>
+
+ <excludeTable>excludeTable-01</excludeTable>
+ <excludeTable>
+ <pattern>excludeTable-02</pattern>
+ </excludeTable>
+ <excludeTable>excludeTable-03</excludeTable>
+
+ <includeColumn>includeColumn-01</includeColumn>
+ <includeColumn>
+ <pattern>includeColumn-02</pattern>
+ </includeColumn>
+ <includeColumn>includeColumn-03</includeColumn>
+ <excludeColumn>excludeColumn-01</excludeColumn>
+ <excludeColumn>
+ <pattern>excludeColumn-02</pattern>
+ </excludeColumn>
+ <excludeColumn>excludeColumn-03</excludeColumn>
+
+ <includeProcedure>includeProcedure-01</includeProcedure>
+ <includeProcedure>
+ <pattern>includeProcedure-02</pattern>
+ </includeProcedure>
+ <includeProcedure>includeProcedure-03</includeProcedure>
+ <excludeProcedure>excludeProcedure-01</excludeProcedure>
+ <excludeProcedure>
+ <pattern>excludeProcedure-02</pattern>
+ </excludeProcedure>
+ <excludeProcedure>excludeProcedure-03</excludeProcedure>
+ </catalog>
+ </dbimport>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+
+</project>
http://git-wip-us.apache.org/repos/asf/cayenne/blob/a0cd93d6/maven-plugins/cayenne-maven-plugin/src/test/resources/org/apache/cayenne/tools/config/pom-default-package.xml
----------------------------------------------------------------------
diff --git a/maven-plugins/cayenne-maven-plugin/src/test/resources/org/apache/cayenne/tools/config/pom-default-package.xml b/maven-plugins/cayenne-maven-plugin/src/test/resources/org/apache/cayenne/tools/config/pom-default-package.xml
new file mode 100644
index 0000000..f179f61
--- /dev/null
+++ b/maven-plugins/cayenne-maven-plugin/src/test/resources/org/apache/cayenne/tools/config/pom-default-package.xml
@@ -0,0 +1,38 @@
+<?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
+ ~
+ ~ http://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.
+ -->
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
+ http://maven.apache.org/xsd/maven-4.0.0.xsd">
+
+ <build>
+ <plugins>
+ <plugin>
+ <artifactId>cayenne-maven-plugin</artifactId>
+ <configuration>
+ <map>target/test/org/apache/cayenne/tools/dbimporter-map1.map.xml</map>
+ <dbimport>
+ <defaultPackage>com.example.test</defaultPackage>
+ </dbimport>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+
+</project>
http://git-wip-us.apache.org/repos/asf/cayenne/blob/a0cd93d6/maven-plugins/cayenne-maven-plugin/src/test/resources/org/apache/cayenne/tools/config/pom-flat.xml
----------------------------------------------------------------------
diff --git a/maven-plugins/cayenne-maven-plugin/src/test/resources/org/apache/cayenne/tools/config/pom-flat.xml b/maven-plugins/cayenne-maven-plugin/src/test/resources/org/apache/cayenne/tools/config/pom-flat.xml
new file mode 100644
index 0000000..7532039
--- /dev/null
+++ b/maven-plugins/cayenne-maven-plugin/src/test/resources/org/apache/cayenne/tools/config/pom-flat.xml
@@ -0,0 +1,78 @@
+<?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
+ ~
+ ~ http://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.
+ -->
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
+ http://maven.apache.org/xsd/maven-4.0.0.xsd">
+
+ <build>
+ <plugins>
+ <plugin>
+ <artifactId>cayenne-maven-plugin</artifactId>
+ <configuration>
+ <map>target/test/org/apache/cayenne/tools/dbimporter-map1.map.xml</map>
+
+ <dbimport>
+ <includeTable>includeTable-01</includeTable>
+
+ <includeTable>
+ <pattern>includeTable-02</pattern>
+ </includeTable>
+
+ <includeTable>
+ <pattern>includeTable-03</pattern>
+
+ <includeColumn>includeColumn-01</includeColumn>
+ <excludeColumn>excludeColumn-01</excludeColumn>
+ </includeTable>
+
+ <excludeTable>excludeTable-01</excludeTable>
+ <excludeTable>
+ <pattern>excludeTable-02</pattern>
+ </excludeTable>
+ <excludeTable>excludeTable-03</excludeTable>
+
+ <includeColumn>includeColumn-01</includeColumn>
+ <includeColumn>
+ <pattern>includeColumn-02</pattern>
+ </includeColumn>
+ <includeColumn>includeColumn-03</includeColumn>
+ <excludeColumn>excludeColumn-01</excludeColumn>
+ <excludeColumn>
+ <pattern>excludeColumn-02</pattern>
+ </excludeColumn>
+ <excludeColumn>excludeColumn-03</excludeColumn>
+
+ <includeProcedure>includeProcedure-01</includeProcedure>
+ <includeProcedure>
+ <pattern>includeProcedure-02</pattern>
+ </includeProcedure>
+ <includeProcedure>includeProcedure-03</includeProcedure>
+ <excludeProcedure>excludeProcedure-01</excludeProcedure>
+ <excludeProcedure>
+ <pattern>excludeProcedure-02</pattern>
+ </excludeProcedure>
+ <excludeProcedure>excludeProcedure-03</excludeProcedure>
+ </dbimport>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+
+</project>
http://git-wip-us.apache.org/repos/asf/cayenne/blob/a0cd93d6/maven-plugins/cayenne-maven-plugin/src/test/resources/org/apache/cayenne/tools/config/pom-mapping.xml
----------------------------------------------------------------------
diff --git a/maven-plugins/cayenne-maven-plugin/src/test/resources/org/apache/cayenne/tools/config/pom-mapping.xml b/maven-plugins/cayenne-maven-plugin/src/test/resources/org/apache/cayenne/tools/config/pom-mapping.xml
new file mode 100644
index 0000000..596eab7
--- /dev/null
+++ b/maven-plugins/cayenne-maven-plugin/src/test/resources/org/apache/cayenne/tools/config/pom-mapping.xml
@@ -0,0 +1,67 @@
+<?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
+
+ http://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.
+ -->
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
+ http://maven.apache.org/xsd/maven-4.0.0.xsd">
+
+ <build>
+ <plugins>
+ <plugin>
+ <artifactId>cayenne-maven-plugin</artifactId>
+ <configuration>
+ <map>target/test/org/apache/cayenne/tools/dbimporter-map1.map.xml</map>
+
+ <typeMapper >
+ <mapperClassName>class</mapperClassName>
+ <usePrimitives>false</usePrimitives>
+
+ <type>
+ <java>my.personal.type</java>
+ <jdbc>varchar</jdbc>
+ </type>
+ <type>
+ <java>java-01</java>
+ <jdbc>jdbc-01</jdbc>
+ </type>
+ <type>
+ <java>java-02</java>
+ <jdbc>jdbc-02</jdbc>
+ <length>21</length>
+ <notNull>true</notNull>
+ </type>
+ <type>
+ <java>java-03</java>
+ <jdbc>jdbc-03</jdbc>
+ <precision>5</precision>
+ <scale>2</scale>
+ </type>
+ <type>
+ <java>java-03</java>
+ <jdbc>jdbc-03</jdbc>
+ <precision>7</precision>
+ <notNull>true</notNull>
+ </type>
+ </typeMapper>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+
+</project>
http://git-wip-us.apache.org/repos/asf/cayenne/blob/a0cd93d6/maven-plugins/cayenne-maven-plugin/src/test/resources/org/apache/cayenne/tools/config/pom-schema-2.xml
----------------------------------------------------------------------
diff --git a/maven-plugins/cayenne-maven-plugin/src/test/resources/org/apache/cayenne/tools/config/pom-schema-2.xml b/maven-plugins/cayenne-maven-plugin/src/test/resources/org/apache/cayenne/tools/config/pom-schema-2.xml
new file mode 100644
index 0000000..de67dd3
--- /dev/null
+++ b/maven-plugins/cayenne-maven-plugin/src/test/resources/org/apache/cayenne/tools/config/pom-schema-2.xml
@@ -0,0 +1,41 @@
+<?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
+
+ http://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.
+ -->
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
+ http://maven.apache.org/xsd/maven-4.0.0.xsd">
+
+ <build>
+ <plugins>
+ <plugin>
+ <artifactId>cayenne-maven-plugin</artifactId>
+ <configuration>
+ <dbimport>
+ <schema>
+ <name>NHL_STATS</name>
+ <excludeTable>^ETL_.*</excludeTable>
+ <excludeColumn>^ETL_.*</excludeColumn>
+ </schema>
+ </dbimport>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+
+</project>
http://git-wip-us.apache.org/repos/asf/cayenne/blob/a0cd93d6/maven-plugins/cayenne-maven-plugin/src/test/resources/org/apache/cayenne/tools/config/pom-schema.xml
----------------------------------------------------------------------
diff --git a/maven-plugins/cayenne-maven-plugin/src/test/resources/org/apache/cayenne/tools/config/pom-schema.xml b/maven-plugins/cayenne-maven-plugin/src/test/resources/org/apache/cayenne/tools/config/pom-schema.xml
new file mode 100644
index 0000000..54cc365
--- /dev/null
+++ b/maven-plugins/cayenne-maven-plugin/src/test/resources/org/apache/cayenne/tools/config/pom-schema.xml
@@ -0,0 +1,87 @@
+<?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
+ ~
+ ~ http://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.
+ -->
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
+ http://maven.apache.org/xsd/maven-4.0.0.xsd">
+
+ <build>
+ <plugins>
+ <plugin>
+ <artifactId>cayenne-maven-plugin</artifactId>
+ <configuration>
+ <map>target/test/org/apache/cayenne/tools/dbimporter-map1.map.xml</map>
+
+ <dbimport>
+ <schema>schema-name-01</schema>
+
+ <schema>
+ <name>schema-name-02</name>
+ </schema>
+
+ <schema>
+ <name>schema-name-03</name>
+ <includeTable>includeTable-01</includeTable>
+
+ <includeTable>
+ <pattern>includeTable-02</pattern>
+ </includeTable>
+
+ <includeTable>
+ <pattern>includeTable-03</pattern>
+
+ <includeColumn>includeColumn-01</includeColumn>
+ <excludeColumn>excludeColumn-01</excludeColumn>
+ </includeTable>
+
+ <excludeTable>excludeTable-01</excludeTable>
+ <excludeTable>
+ <pattern>excludeTable-02</pattern>
+ </excludeTable>
+ <excludeTable>excludeTable-03</excludeTable>
+
+ <includeColumn>includeColumn-01</includeColumn>
+ <includeColumn>
+ <pattern>includeColumn-02</pattern>
+ </includeColumn>
+ <includeColumn>includeColumn-03</includeColumn>
+ <excludeColumn>excludeColumn-01</excludeColumn>
+ <excludeColumn>
+ <pattern>excludeColumn-02</pattern>
+ </excludeColumn>
+ <excludeColumn>excludeColumn-03</excludeColumn>
+
+ <includeProcedure>includeProcedure-01</includeProcedure>
+ <includeProcedure>
+ <pattern>includeProcedure-02</pattern>
+ </includeProcedure>
+ <includeProcedure>includeProcedure-03</includeProcedure>
+ <excludeProcedure>excludeProcedure-01</excludeProcedure>
+ <excludeProcedure>
+ <pattern>excludeProcedure-02</pattern>
+ </excludeProcedure>
+ <excludeProcedure>excludeProcedure-03</excludeProcedure>
+ </schema>
+ </dbimport>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+
+</project>
http://git-wip-us.apache.org/repos/asf/cayenne/blob/a0cd93d6/maven-plugins/cayenne-maven-plugin/src/test/resources/org/apache/cayenne/tools/config/pom-skip-primary-key-loading.xml
----------------------------------------------------------------------
diff --git a/maven-plugins/cayenne-maven-plugin/src/test/resources/org/apache/cayenne/tools/config/pom-skip-primary-key-loading.xml b/maven-plugins/cayenne-maven-plugin/src/test/resources/org/apache/cayenne/tools/config/pom-skip-primary-key-loading.xml
new file mode 100644
index 0000000..5414a25
--- /dev/null
+++ b/maven-plugins/cayenne-maven-plugin/src/test/resources/org/apache/cayenne/tools/config/pom-skip-primary-key-loading.xml
@@ -0,0 +1,39 @@
+<?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
+
+ http://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.
+ -->
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
+ http://maven.apache.org/xsd/maven-4.0.0.xsd">
+
+ <build>
+ <plugins>
+ <plugin>
+ <artifactId>cayenne-maven-plugin</artifactId>
+ <configuration>
+ <map>target/test/org/apache/cayenne/tools/dbimporter-map1.map.xml</map>
+
+ <dbimport>
+ <skipPrimaryKeyLoading>true</skipPrimaryKeyLoading>
+ </dbimport>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+
+</project>
http://git-wip-us.apache.org/repos/asf/cayenne/blob/a0cd93d6/maven-plugins/cayenne-maven-plugin/src/test/resources/org/apache/cayenne/tools/config/pom-skip-relationships-loading.xml
----------------------------------------------------------------------
diff --git a/maven-plugins/cayenne-maven-plugin/src/test/resources/org/apache/cayenne/tools/config/pom-skip-relationships-loading.xml b/maven-plugins/cayenne-maven-plugin/src/test/resources/org/apache/cayenne/tools/config/pom-skip-relationships-loading.xml
new file mode 100644
index 0000000..f09f5ad
--- /dev/null
+++ b/maven-plugins/cayenne-maven-plugin/src/test/resources/org/apache/cayenne/tools/config/pom-skip-relationships-loading.xml
@@ -0,0 +1,39 @@
+<?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
+
+ http://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.
+ -->
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
+ http://maven.apache.org/xsd/maven-4.0.0.xsd">
+
+ <build>
+ <plugins>
+ <plugin>
+ <artifactId>cayenne-maven-plugin</artifactId>
+ <configuration>
+ <map>target/test/org/apache/cayenne/tools/dbimporter-map1.map.xml</map>
+
+ <dbimport>
+ <skipRelationshipsLoading>true</skipRelationshipsLoading>
+ </dbimport>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+
+</project>
http://git-wip-us.apache.org/repos/asf/cayenne/blob/a0cd93d6/maven-plugins/cayenne-maven-plugin/src/test/resources/org/apache/cayenne/tools/config/pom-table-types.xml
----------------------------------------------------------------------
diff --git a/maven-plugins/cayenne-maven-plugin/src/test/resources/org/apache/cayenne/tools/config/pom-table-types.xml b/maven-plugins/cayenne-maven-plugin/src/test/resources/org/apache/cayenne/tools/config/pom-table-types.xml
new file mode 100644
index 0000000..2b5f07b
--- /dev/null
+++ b/maven-plugins/cayenne-maven-plugin/src/test/resources/org/apache/cayenne/tools/config/pom-table-types.xml
@@ -0,0 +1,41 @@
+<?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
+
+ http://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.
+ -->
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
+ http://maven.apache.org/xsd/maven-4.0.0.xsd">
+
+ <build>
+ <plugins>
+ <plugin>
+ <artifactId>cayenne-maven-plugin</artifactId>
+ <configuration>
+ <map>target/test/org/apache/cayenne/tools/dbimporter-map1.map.xml</map>
+
+ <dbimport>
+ <tableType>type1</tableType>
+ <tableType>type2</tableType>
+ <tableType>type3</tableType>
+ </dbimport>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+
+</project>
http://git-wip-us.apache.org/repos/asf/cayenne/blob/a0cd93d6/maven-plugins/cayenne-maven-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testComplexChangeOrder-pom.xml
----------------------------------------------------------------------
diff --git a/maven-plugins/cayenne-maven-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testComplexChangeOrder-pom.xml b/maven-plugins/cayenne-maven-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testComplexChangeOrder-pom.xml
new file mode 100644
index 0000000..98dc674
--- /dev/null
+++ b/maven-plugins/cayenne-maven-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testComplexChangeOrder-pom.xml
@@ -0,0 +1,44 @@
+<?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
+ ~
+ ~ http://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.
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~-->
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
+ http://maven.apache.org/xsd/maven-4.0.0.xsd">
+
+ <name>DbImporterMojo Test1</name>
+
+ <build>
+ <plugins>
+ <plugin>
+ <artifactId>cayenne-maven-plugin</artifactId>
+ <configuration>
+ <map>target/test-classes/org/apache/cayenne/tools/dbimport/testComplexChangeOrder.map.xml</map>
+ <dataSource>
+ <driver>org.apache.derby.jdbc.EmbeddedDriver</driver>
+ <url>jdbc:derby:memory:DbImporterMojoTest;create=true</url>
+ </dataSource>
+ <dbimport>
+ <schema>SCHEMA_01</schema>
+ </dbimport>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+
+</project>
http://git-wip-us.apache.org/repos/asf/cayenne/blob/a0cd93d6/maven-plugins/cayenne-maven-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testComplexChangeOrder.map.xml
----------------------------------------------------------------------
diff --git a/maven-plugins/cayenne-maven-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testComplexChangeOrder.map.xml b/maven-plugins/cayenne-maven-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testComplexChangeOrder.map.xml
new file mode 100644
index 0000000..20ccc69
--- /dev/null
+++ b/maven-plugins/cayenne-maven-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testComplexChangeOrder.map.xml
@@ -0,0 +1,64 @@
+<?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
+
+ http://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.
+-->
+<data-map xmlns="http://cayenne.apache.org/schema/9/modelMap"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://cayenne.apache.org/schema/9/modelMap http://cayenne.apache.org/schema/9/modelMap.xsd"
+ project-version="9">
+ <property name="defaultSchema" value="SCHEMA_01"/>
+
+
+ <db-entity name="ADDRESS" schema="SCHEMA_01">
+ <db-attribute name="addressString" type="VARCHAR" length="250"/>
+ <db-attribute name="id" type="INTEGER" isPrimaryKey="true" isMandatory="true"/>
+ </db-entity>
+ <db-entity name="CHILD" schema="SCHEMA_01">
+ <db-attribute name="date" type="TIME"/>
+ <db-attribute name="id" type="INTEGER" length="10"/>
+ <db-attribute name="name" type="VARCHAR" length="30"/>
+ <db-attribute name="parent_id" type="INTEGER" length="10"/>
+ </db-entity>
+ <db-entity name="PARENT" schema="SCHEMA_01">
+ <db-attribute name="id" type="INTEGER" isPrimaryKey="true" isMandatory="true" length="10"/>
+ </db-entity>
+
+
+ <obj-entity name="Address" className="Address" dbEntityName="ADDRESS">
+ <obj-attribute name="addrStr" type="java.lang.String" db-attribute-path="addressString"/>
+ </obj-entity>
+ <obj-entity name="Child" className="Child" dbEntityName="CHILD">
+ <obj-attribute name="id" type="java.lang.Integer" db-attribute-path="id"/>
+ <obj-attribute name="name" type="java.lang.String"/>
+ </obj-entity>
+ <obj-entity name="Parent" className="Parent" dbEntityName="PARENT">
+ </obj-entity>
+
+
+ <db-relationship name="parent" source="CHILD" target="PARENT" toMany="false">
+ <db-attribute-pair source="parent_id" target="id"/>
+ </db-relationship>
+ <db-relationship name="children" source="PARENT" target="CHILD" toMany="true">
+ <db-attribute-pair source="id" target="parent_id"/>
+ </db-relationship>
+
+
+ <obj-relationship name="parent" source="Child" target="Parent" deleteRule="Nullify" db-relationship-path="parent"/>
+ <obj-relationship name="children" source="Parent" target="Child" deleteRule="Deny" db-relationship-path="children"/>
+</data-map>
+
http://git-wip-us.apache.org/repos/asf/cayenne/blob/a0cd93d6/maven-plugins/cayenne-maven-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testComplexChangeOrder.map.xml-result
----------------------------------------------------------------------
diff --git a/maven-plugins/cayenne-maven-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testComplexChangeOrder.map.xml-result b/maven-plugins/cayenne-maven-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testComplexChangeOrder.map.xml-result
new file mode 100644
index 0000000..d68faf1
--- /dev/null
+++ b/maven-plugins/cayenne-maven-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testComplexChangeOrder.map.xml-result
@@ -0,0 +1,53 @@
+<?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
+ ~
+ ~ http://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.
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~-->
+<data-map xmlns="http://cayenne.apache.org/schema/9/modelMap"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://cayenne.apache.org/schema/9/modelMap http://cayenne.apache.org/schema/9/modelMap.xsd"
+ project-version="9">
+ <property name="defaultSchema" value="SCHEMA_01"/>
+
+ <db-entity name="ADDRESS" schema="SCHEMA_01">
+ <db-attribute name="ADDRSTR" type="VARCHAR" length="250"/>
+ <db-attribute name="id" type="INTEGER" isPrimaryKey="true" isMandatory="true"/>
+ </db-entity>
+ <db-entity name="CHILD" schema="SCHEMA_01">
+ <db-attribute name="ADDRESS_ID" type="INTEGER" length="10"/>
+ <db-attribute name="date" type="DATE" length="10" />
+ <db-attribute name="id" type="INTEGER" length="10"/>
+ <db-attribute name="name" type="VARCHAR" isMandatory="true" length="30" />
+ <db-attribute name="parent_id" type="INTEGER" length="10"/>
+ </db-entity>
+ <obj-entity name="Address" className="Address" dbEntityName="ADDRESS">
+ <obj-attribute name="addrstr" type="java.lang.String" db-attribute-path="ADDRSTR"/>
+ </obj-entity>
+ <obj-entity name="Child" className="Child" dbEntityName="CHILD">
+ <obj-attribute name="id" type="java.lang.Integer" db-attribute-path="id"/>
+ <obj-attribute name="name" type="java.lang.String"/>
+ </obj-entity>
+ <db-relationship name="children" source="ADDRESS" target="CHILD" toMany="true">
+ <db-attribute-pair source="id" target="ADDRESS_ID"/>
+ </db-relationship>
+ <db-relationship name="address" source="CHILD" target="ADDRESS" toMany="false">
+ <db-attribute-pair source="ADDRESS_ID" target="id"/>
+ </db-relationship>
+ <obj-relationship name="children" source="Address" target="Child" deleteRule="Deny" db-relationship-path="children"/>
+ <obj-relationship name="address" source="Child" target="Address" deleteRule="Nullify" db-relationship-path="address"/>
+
+</data-map>
http://git-wip-us.apache.org/repos/asf/cayenne/blob/a0cd93d6/maven-plugins/cayenne-maven-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testComplexChangeOrder.sql
----------------------------------------------------------------------
diff --git a/maven-plugins/cayenne-maven-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testComplexChangeOrder.sql b/maven-plugins/cayenne-maven-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testComplexChangeOrder.sql
new file mode 100644
index 0000000..9885bc7
--- /dev/null
+++ b/maven-plugins/cayenne-maven-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testComplexChangeOrder.sql
@@ -0,0 +1,34 @@
+-- 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
+--
+-- http://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.
+
+CREATE SCHEMA schema_01;
+SET SCHEMA schema_01;
+
+CREATE TABLE schema_01.address (
+ addrStr VARCHAR (250),
+ id INTEGER NOT NULL,
+ PRIMARY KEY (id)
+);
+
+CREATE TABLE schema_01.child (
+ address_id INTEGER ,
+ "date" DATE,
+ id INTEGER ,
+ name VARCHAR(30) NOT NULL,
+ parent_id INTEGER ,
+ CONSTRAINT fk_address FOREIGN KEY (address_id) REFERENCES schema_01.address (id)
+);
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/cayenne/blob/a0cd93d6/maven-plugins/cayenne-maven-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testCustomObjectLayerSettings-pom.xml
----------------------------------------------------------------------
diff --git a/maven-plugins/cayenne-maven-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testCustomObjectLayerSettings-pom.xml b/maven-plugins/cayenne-maven-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testCustomObjectLayerSettings-pom.xml
new file mode 100644
index 0000000..8ba74e2
--- /dev/null
+++ b/maven-plugins/cayenne-maven-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testCustomObjectLayerSettings-pom.xml
@@ -0,0 +1,51 @@
+<?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
+ ~
+ ~ http://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.
+ -->
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
+ http://maven.apache.org/xsd/maven-4.0.0.xsd">
+
+ <name>DbImporterMojo Test1</name>
+
+ <build>
+ <plugins>
+ <plugin>
+ <artifactId>cayenne-maven-plugin</artifactId>
+ <configuration>
+ <map>
+ target/test-classes/org/apache/cayenne/tools/dbimport/testCustomObjectLayerSettings.map.xml
+ </map>
+ <dataSource>
+ <driver>org.apache.derby.jdbc.EmbeddedDriver</driver>
+ <url>jdbc:derby:memory:DbImporterMojoTest;create=true</url>
+ </dataSource>
+ <dbimport>
+ <meaningfulPkTables>^*$</meaningfulPkTables>
+ <usePrimitives>true</usePrimitives>
+ <stripFromTableNames>^xyz_</stripFromTableNames>
+ <schema>
+ <name>SCHEMA_01</name>
+ </schema>
+ </dbimport>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+
+</project>
http://git-wip-us.apache.org/repos/asf/cayenne/blob/a0cd93d6/maven-plugins/cayenne-maven-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testCustomObjectLayerSettings.map.xml
----------------------------------------------------------------------
diff --git a/maven-plugins/cayenne-maven-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testCustomObjectLayerSettings.map.xml b/maven-plugins/cayenne-maven-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testCustomObjectLayerSettings.map.xml
new file mode 100644
index 0000000..acbc62c
--- /dev/null
+++ b/maven-plugins/cayenne-maven-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testCustomObjectLayerSettings.map.xml
@@ -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
+
+ http://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.
+-->
+<data-map xmlns="http://cayenne.apache.org/schema/9/modelMap"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://cayenne.apache.org/schema/9/modelMap http://cayenne.apache.org/schema/9/modelMap.xsd"
+ project-version="9">
+ <property name="defaultSchema" value="SCHEMA_01"/>
+ <db-entity name="EXISTING_TABLE" schema="SCHEMA_01">
+ <db-attribute name="ID" type="INTEGER" isPrimaryKey="true" isMandatory="true" length="10"/>
+ </db-entity>
+ <obj-entity name="ExistingTable" className="ExistingTable" dbEntityName="EXISTING_TABLE">
+ </obj-entity>
+</data-map>
http://git-wip-us.apache.org/repos/asf/cayenne/blob/a0cd93d6/maven-plugins/cayenne-maven-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testCustomObjectLayerSettings.map.xml-result
----------------------------------------------------------------------
diff --git a/maven-plugins/cayenne-maven-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testCustomObjectLayerSettings.map.xml-result b/maven-plugins/cayenne-maven-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testCustomObjectLayerSettings.map.xml-result
new file mode 100644
index 0000000..9f36c0f
--- /dev/null
+++ b/maven-plugins/cayenne-maven-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testCustomObjectLayerSettings.map.xml-result
@@ -0,0 +1,46 @@
+<?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
+
+ http://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.
+-->
+<data-map xmlns="http://cayenne.apache.org/schema/9/modelMap"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://cayenne.apache.org/schema/9/modelMap http://cayenne.apache.org/schema/9/modelMap.xsd"
+ project-version="9">
+ <property name="defaultSchema" value="SCHEMA_01"/>
+ <db-entity name="EXISTING_TABLE" schema="SCHEMA_01">
+ <db-attribute name="COL2" type="INTEGER" length="10"/>
+ <db-attribute name="ID" type="INTEGER" isPrimaryKey="true" isMandatory="true" length="10"/>
+ </db-entity>
+ <db-entity name="NEW_TABLE" schema="SCHEMA_01">
+ <db-attribute name="COL2" type="INTEGER" length="10"/>
+ <db-attribute name="ID" type="INTEGER" isPrimaryKey="true" isMandatory="true" length="10"/>
+ </db-entity>
+ <db-entity name="XYZ_PREFIXED_NEW_TABLE" schema="SCHEMA_01">
+ <db-attribute name="ID" type="INTEGER" isPrimaryKey="true" isMandatory="true" length="10"/>
+ </db-entity>
+ <obj-entity name="ExistingTable" className="ExistingTable" dbEntityName="EXISTING_TABLE">
+ <obj-attribute name="col2" type="int" db-attribute-path="COL2"/>
+ </obj-entity>
+ <obj-entity name="NewTable" className="NewTable" dbEntityName="NEW_TABLE">
+ <obj-attribute name="col2" type="int" db-attribute-path="COL2"/>
+ <obj-attribute name="id" type="int" db-attribute-path="ID"/>
+ </obj-entity>
+ <obj-entity name="PrefixedNewTable" className="PrefixedNewTable" dbEntityName="XYZ_PREFIXED_NEW_TABLE">
+ <obj-attribute name="id" type="int" db-attribute-path="ID"/>
+ </obj-entity>
+</data-map>
http://git-wip-us.apache.org/repos/asf/cayenne/blob/a0cd93d6/maven-plugins/cayenne-maven-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testCustomObjectLayerSettings.sql
----------------------------------------------------------------------
diff --git a/maven-plugins/cayenne-maven-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testCustomObjectLayerSettings.sql b/maven-plugins/cayenne-maven-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testCustomObjectLayerSettings.sql
new file mode 100644
index 0000000..fe9ccd5
--- /dev/null
+++ b/maven-plugins/cayenne-maven-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testCustomObjectLayerSettings.sql
@@ -0,0 +1,36 @@
+-- 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
+--
+-- http://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.
+
+CREATE SCHEMA schema_01;
+SET SCHEMA schema_01;
+
+CREATE TABLE schema_01.new_table (
+ id INTEGER NOT NULL,
+ COL2 INTEGER,
+ PRIMARY KEY (id)
+ );
+
+CREATE TABLE schema_01.existing_table (
+ id INTEGER NOT NULL,
+ COL2 INTEGER,
+ PRIMARY KEY (id)
+ );
+
+CREATE TABLE schema_01.xyz_prefixed_new_table (
+ id INTEGER NOT NULL,
+ PRIMARY KEY (id)
+ );
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/cayenne/blob/a0cd93d6/maven-plugins/cayenne-maven-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testDbAttributeChange-pom.xml
----------------------------------------------------------------------
diff --git a/maven-plugins/cayenne-maven-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testDbAttributeChange-pom.xml b/maven-plugins/cayenne-maven-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testDbAttributeChange-pom.xml
new file mode 100644
index 0000000..0fcafcb
--- /dev/null
+++ b/maven-plugins/cayenne-maven-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testDbAttributeChange-pom.xml
@@ -0,0 +1,47 @@
+<?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
+ ~
+ ~ http://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.
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~-->
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
+ http://maven.apache.org/xsd/maven-4.0.0.xsd">
+
+ <name>DbImporterMojo Test1</name>
+
+ <build>
+ <plugins>
+ <plugin>
+ <artifactId>cayenne-maven-plugin</artifactId>
+ <configuration>
+ <map>target/test-classes/org/apache/cayenne/tools/dbimport/testDbAttributeChange.map.xml</map>
+ <dataSource>
+ <driver>org.apache.derby.jdbc.EmbeddedDriver</driver>
+ <url>jdbc:derby:memory:DbImporterMojoTest;create=true</url>
+ </dataSource>
+
+ <dbimport>
+ <schema>
+ <name>SCHEMA_01</name>
+ </schema>
+ </dbimport>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+
+</project>
http://git-wip-us.apache.org/repos/asf/cayenne/blob/a0cd93d6/maven-plugins/cayenne-maven-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testDbAttributeChange.map.xml
----------------------------------------------------------------------
diff --git a/maven-plugins/cayenne-maven-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testDbAttributeChange.map.xml b/maven-plugins/cayenne-maven-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testDbAttributeChange.map.xml
new file mode 100644
index 0000000..759090a
--- /dev/null
+++ b/maven-plugins/cayenne-maven-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testDbAttributeChange.map.xml
@@ -0,0 +1,62 @@
+<?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
+ ~
+ ~ http://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.
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~-->
+<data-map xmlns="http://cayenne.apache.org/schema/9/modelMap"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://cayenne.apache.org/schema/9/modelMap http://cayenne.apache.org/schema/9/modelMap.xsd"
+ project-version="9">
+
+ <db-entity name="parent" schema="SCHEMA_01">
+ <db-attribute name="COL2" type="CHAR" length="25"/>
+ <db-attribute name="COL3" type="DECIMAL" length="10" scale="2"/>
+ <db-attribute name="COL4" type="VARCHAR" length="25"/>
+ <db-attribute name="COL5" type="DATE" length="10"/>
+ <db-attribute name="ID" type="INTEGER" isPrimaryKey="true" isMandatory="true" length="10"/>
+ </db-entity>
+ <db-entity name="CHILD" schema="SCHEMA_01">
+ <db-attribute name="col1" type="INTEGER"/>
+ <db-attribute name="col2" type="DECIMAL" length="10" scale="2"/>
+ <db-attribute name="COL4" type="VARCHAR" length="25"/>
+ <db-attribute name="COL5" type="DATE" length="10"/>
+ <db-attribute name="ID" type="INTEGER" isPrimaryKey="true" isMandatory="true" length="10"/>
+ <db-attribute name="parent_id" type="CHAR" length="25"/>
+ </db-entity>
+ <obj-entity name="Child" className="Child" dbEntityName="CHILD">
+ <obj-attribute name="col3" type="java.math.BigDecimal" db-attribute-path="COL3"/>
+ <obj-attribute name="col4" type="java.lang.String" db-attribute-path="COL4"/>
+ <obj-attribute name="col5" type="java.util.Date" db-attribute-path="COL5"/>
+ <obj-attribute name="parentId" type="java.lang.String" db-attribute-path="PARENT_ID"/>
+ </obj-entity>
+ <obj-entity name="Parent" className="Parent" dbEntityName="parent">
+ <obj-attribute name="col2" type="java.lang.String" db-attribute-path="COL2"/>
+ <obj-attribute name="col3" type="java.math.BigDecimal" db-attribute-path="COL3"/>
+ <obj-attribute name="col4" type="java.lang.String" db-attribute-path="COL4"/>
+ <obj-attribute name="col5" type="java.util.Date" db-attribute-path="COL5"/>
+ </obj-entity>
+
+ <db-relationship name="parent" source="CHILD" target="parent" toMany="false">
+ <db-attribute-pair source="parent_id" target="ID"/>
+ </db-relationship>
+ <db-relationship name="children" source="parent" target="CHILD" toMany="true">
+ <db-attribute-pair source="ID" target="parent_id"/>
+ </db-relationship>
+
+ <obj-relationship name="parent" source="Child" target="Parent" deleteRule="Nullify" db-relationship-path="parent"/>
+ <obj-relationship name="children" source="Parent" target="Child" deleteRule="Deny" db-relationship-path="children"/>
+</data-map>
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/cayenne/blob/a0cd93d6/maven-plugins/cayenne-maven-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testDbAttributeChange.map.xml-result
----------------------------------------------------------------------
diff --git a/maven-plugins/cayenne-maven-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testDbAttributeChange.map.xml-result b/maven-plugins/cayenne-maven-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testDbAttributeChange.map.xml-result
new file mode 100644
index 0000000..c53bde2
--- /dev/null
+++ b/maven-plugins/cayenne-maven-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testDbAttributeChange.map.xml-result
@@ -0,0 +1,62 @@
+<?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
+ ~
+ ~ http://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.
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~-->
+<data-map xmlns="http://cayenne.apache.org/schema/9/modelMap"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://cayenne.apache.org/schema/9/modelMap http://cayenne.apache.org/schema/9/modelMap.xsd"
+ project-version="9">
+
+ <db-entity name="CHILD" schema="SCHEMA_01">
+ <db-attribute name="COL3" type="DECIMAL" length="5" scale="1"/>
+ <db-attribute name="COL4" type="VARCHAR" length="25"/>
+ <db-attribute name="COL5" type="DATE" length="10"/>
+ <db-attribute name="ID" type="INTEGER" isPrimaryKey="true" isMandatory="true" length="10"/>
+ <db-attribute name="col1" type="DOUBLE" length="52"/>
+ <db-attribute name="col2" type="CHAR" length="25"/>
+ <db-attribute name="parent_id" type="INTEGER" length="10"/>
+ </db-entity>
+ <db-entity name="parent" schema="SCHEMA_01">
+ <db-attribute name="COL2" type="CHAR" length="20"/>
+ <db-attribute name="COL3" type="DECIMAL" length="10" scale="2"/>
+ <db-attribute name="COL4" type="VARCHAR" length="50"/>
+ <db-attribute name="COL5" type="TIME" length="8"/>
+ <db-attribute name="ID" type="INTEGER" isPrimaryKey="true" isMandatory="true" length="10"/>
+ </db-entity>
+ <obj-entity name="Child" className="Child" dbEntityName="CHILD">
+ <obj-attribute name="col3" type="java.math.BigDecimal" db-attribute-path="COL3"/>
+ <obj-attribute name="col4" type="java.lang.String" db-attribute-path="COL4"/>
+ <obj-attribute name="col5" type="java.util.Date" db-attribute-path="COL5"/>
+ <obj-attribute name="parentId" type="java.lang.String" db-attribute-path="PARENT_ID"/>
+ </obj-entity>
+ <obj-entity name="Parent" className="Parent" dbEntityName="parent">
+ <obj-attribute name="col2" type="java.lang.String" db-attribute-path="COL2"/>
+ <obj-attribute name="col3" type="java.math.BigDecimal" db-attribute-path="COL3"/>
+ <obj-attribute name="col4" type="java.lang.String" db-attribute-path="COL4"/>
+ <obj-attribute name="col5" type="java.util.Date" db-attribute-path="COL5"/>
+ </obj-entity>
+ <db-relationship name="parent" source="CHILD" target="parent" toMany="false">
+ <db-attribute-pair source="parent_id" target="ID"/>
+ </db-relationship>
+ <db-relationship name="children" source="parent" target="CHILD" toMany="true">
+ <db-attribute-pair source="ID" target="parent_id"/>
+ </db-relationship>
+ <obj-relationship name="parent" source="Child" target="Parent" deleteRule="Nullify" db-relationship-path="parent"/>
+ <obj-relationship name="children" source="Parent" target="Child" deleteRule="Deny" db-relationship-path="children"/>
+</data-map>
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/cayenne/blob/a0cd93d6/maven-plugins/cayenne-maven-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testDbAttributeChange.sql
----------------------------------------------------------------------
diff --git a/maven-plugins/cayenne-maven-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testDbAttributeChange.sql b/maven-plugins/cayenne-maven-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testDbAttributeChange.sql
new file mode 100644
index 0000000..c93c802
--- /dev/null
+++ b/maven-plugins/cayenne-maven-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testDbAttributeChange.sql
@@ -0,0 +1,46 @@
+-- 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
+--
+-- http://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.
+
+CREATE SCHEMA schema_01;
+SET SCHEMA schema_01;
+
+CREATE TABLE schema_01.parent (
+ id INTEGER NOT NULL,
+ COL2 CHAR(20),
+ COL3 DECIMAL(10,2),
+ COL4 VARCHAR(50),
+ COL5 TIME,
+
+ PRIMARY KEY (id),
+ UNIQUE (COL3)
+);
+
+CREATE TABLE schema_01.child (
+ id INTEGER NOT NULL,
+ parent_id INTEGER,
+ COL1 FLOAT,
+ COL2 CHAR(25),
+ COL3 DECIMAL(5,1),
+ COL4 VARCHAR(25),
+ COL5 DATE,
+
+ PRIMARY KEY (id)
+);
+
+ALTER TABLE schema_01.child
+ ADD FOREIGN KEY (parent_id)
+ REFERENCES schema_01.parent (id);
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/cayenne/blob/a0cd93d6/maven-plugins/cayenne-maven-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testDefaultPackage-pom.xml
----------------------------------------------------------------------
diff --git a/maven-plugins/cayenne-maven-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testDefaultPackage-pom.xml b/maven-plugins/cayenne-maven-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testDefaultPackage-pom.xml
new file mode 100644
index 0000000..c62c68f
--- /dev/null
+++ b/maven-plugins/cayenne-maven-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testDefaultPackage-pom.xml
@@ -0,0 +1,47 @@
+<?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
+ ~
+ ~ http://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.
+ -->
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
+ http://maven.apache.org/xsd/maven-4.0.0.xsd">
+
+ <name>DbImporterMojo Test1</name>
+
+ <build>
+ <plugins>
+ <plugin>
+ <artifactId>cayenne-maven-plugin</artifactId>
+ <configuration>
+ <map>target/test-classes/org/apache/cayenne/tools/dbimport/testDefaultPackage.map.xml</map>
+
+ <dataSource>
+ <driver>org.apache.derby.jdbc.EmbeddedDriver</driver>
+ <url>jdbc:derby:memory:DbImporterMojoTest;create=true</url>
+ </dataSource>
+
+ <dbimport>
+ <defaultPackage>com.example.test</defaultPackage>
+ <schema>SCHEMA_01</schema>
+ </dbimport>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+
+</project>
http://git-wip-us.apache.org/repos/asf/cayenne/blob/a0cd93d6/maven-plugins/cayenne-maven-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testDefaultPackage.map.xml-result
----------------------------------------------------------------------
diff --git a/maven-plugins/cayenne-maven-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testDefaultPackage.map.xml-result b/maven-plugins/cayenne-maven-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testDefaultPackage.map.xml-result
new file mode 100644
index 0000000..5373617
--- /dev/null
+++ b/maven-plugins/cayenne-maven-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testDefaultPackage.map.xml-result
@@ -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
+
+ http://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.
+-->
+<data-map xmlns="http://cayenne.apache.org/schema/9/modelMap"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://cayenne.apache.org/schema/9/modelMap http://cayenne.apache.org/schema/9/modelMap.xsd"
+ project-version="9">
+ <property name="defaultPackage" value="com.example.test"/>
+ <property name="defaultSchema" value="SCHEMA_01"/>
+ <db-entity name="CHILD" schema="SCHEMA_01">
+ <db-attribute name="COL3" type="DECIMAL" length="10" scale="2"/>
+ <db-attribute name="COL4" type="VARCHAR" length="25"/>
+ <db-attribute name="COL5" type="DATE" length="10"/>
+ <db-attribute name="ID" type="INTEGER" isPrimaryKey="true" isMandatory="true" length="10"/>
+ <db-attribute name="PARENT_ID" type="CHAR" length="25"/>
+ </db-entity>
+ <db-entity name="PARENT" schema="SCHEMA_01">
+ <db-attribute name="COL2" type="CHAR" length="25"/>
+ <db-attribute name="COL3" type="DECIMAL" length="10" scale="2"/>
+ <db-attribute name="COL4" type="VARCHAR" length="25"/>
+ <db-attribute name="COL5" type="DATE" length="10"/>
+ <db-attribute name="ID" type="INTEGER" isPrimaryKey="true" isMandatory="true" length="10"/>
+ </db-entity>
+ <obj-entity name="Child" className="com.example.test.Child" dbEntityName="CHILD">
+ <obj-attribute name="col3" type="java.math.BigDecimal" db-attribute-path="COL3"/>
+ <obj-attribute name="col4" type="java.lang.String" db-attribute-path="COL4"/>
+ <obj-attribute name="col5" type="java.util.Date" db-attribute-path="COL5"/>
+ <obj-attribute name="parentId" type="java.lang.String" db-attribute-path="PARENT_ID"/>
+ </obj-entity>
+ <obj-entity name="Parent" className="com.example.test.Parent" dbEntityName="PARENT">
+ <obj-attribute name="col2" type="java.lang.String" db-attribute-path="COL2"/>
+ <obj-attribute name="col3" type="java.math.BigDecimal" db-attribute-path="COL3"/>
+ <obj-attribute name="col4" type="java.lang.String" db-attribute-path="COL4"/>
+ <obj-attribute name="col5" type="java.util.Date" db-attribute-path="COL5"/>
+ </obj-entity>
+</data-map>
http://git-wip-us.apache.org/repos/asf/cayenne/blob/a0cd93d6/maven-plugins/cayenne-maven-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testDefaultPackage.sql
----------------------------------------------------------------------
diff --git a/maven-plugins/cayenne-maven-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testDefaultPackage.sql b/maven-plugins/cayenne-maven-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testDefaultPackage.sql
new file mode 100644
index 0000000..279065c
--- /dev/null
+++ b/maven-plugins/cayenne-maven-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testDefaultPackage.sql
@@ -0,0 +1,40 @@
+-- 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
+--
+-- http://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.
+
+CREATE SCHEMA schema_01;
+SET SCHEMA schema_01;
+
+CREATE TABLE schema_01.Parent (
+ id INTEGER NOT NULL,
+ COL2 CHAR(25),
+ COL3 DECIMAL(10,2),
+ COL4 VARCHAR(25),
+ COL5 DATE,
+
+ PRIMARY KEY (id),
+ UNIQUE (COL3)
+);
+
+CREATE TABLE schema_01.Child (
+ id INTEGER NOT NULL,
+ Parent_id CHAR(25),
+ COL3 DECIMAL(10,2),
+ COL4 VARCHAR(25),
+ COL5 DATE,
+
+ PRIMARY KEY (id)
+);