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/01/31 07:38:02 UTC
[1/8] cayenne git commit: CAY-2214 cdbimport: rename
maven-cayenne-plugin - change module and folder name to
"cayenne-maven-plugin" - artifactId still is "maven-cayenne-plugin"
Repository: cayenne
Updated Branches:
refs/heads/master a148a2895 -> 2cddff91a
http://git-wip-us.apache.org/repos/asf/cayenne/blob/2cddff91/plugins/maven-cayenne-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testSupportsCatalogsOnReverseEngineering-pom.xml
----------------------------------------------------------------------
diff --git a/plugins/maven-cayenne-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testSupportsCatalogsOnReverseEngineering-pom.xml b/plugins/maven-cayenne-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testSupportsCatalogsOnReverseEngineering-pom.xml
deleted file mode 100644
index f3409fa..0000000
--- a/plugins/maven-cayenne-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testSupportsCatalogsOnReverseEngineering-pom.xml
+++ /dev/null
@@ -1,50 +0,0 @@
-<?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>maven-cayenne-plugin</artifactId>
- <configuration>
- <map>
- target/test-classes/org/apache/cayenne/tools/dbimport/testSupportsCatalogsOnReverseEngineering.map.xml
- </map>
-
- <dataSource>
- <driver>org.apache.derby.jdbc.EmbeddedDriver</driver>
- <url>jdbc:derby:memory:DbImporterMojoTest;create=true</url>
- </dataSource>
-
- <adapter>org.apache.cayenne.dba.postgres.PostgresAdapter</adapter>
-
- <dbimport>
- <catalog>DbImporterMojoTest1</catalog>
- </dbimport>
- </configuration>
- </plugin>
- </plugins>
- </build>
-
-</project>
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/cayenne/blob/2cddff91/plugins/maven-cayenne-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testSupportsCatalogsOnReverseEngineering.map.xml
----------------------------------------------------------------------
diff --git a/plugins/maven-cayenne-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testSupportsCatalogsOnReverseEngineering.map.xml b/plugins/maven-cayenne-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testSupportsCatalogsOnReverseEngineering.map.xml
deleted file mode 100644
index 81fc363..0000000
--- a/plugins/maven-cayenne-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testSupportsCatalogsOnReverseEngineering.map.xml
+++ /dev/null
@@ -1,25 +0,0 @@
-<?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.my.home"/>
-</data-map>
http://git-wip-us.apache.org/repos/asf/cayenne/blob/2cddff91/plugins/maven-cayenne-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testTableTypes-pom.xml
----------------------------------------------------------------------
diff --git a/plugins/maven-cayenne-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testTableTypes-pom.xml b/plugins/maven-cayenne-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testTableTypes-pom.xml
deleted file mode 100644
index 2f60ff5..0000000
--- a/plugins/maven-cayenne-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testTableTypes-pom.xml
+++ /dev/null
@@ -1,45 +0,0 @@
-<?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>maven-cayenne-plugin</artifactId>
- <configuration>
- <map>target/test-classes/org/apache/cayenne/tools/dbimport/testTableTypes.map.xml</map>
- <dataSource>
- <driver>org.apache.derby.jdbc.EmbeddedDriver</driver>
- <url>jdbc:derby:memory:DbImporterMojoTest;create=true</url>
- </dataSource>
-
- <dbimport>
- <tableType>TABLE</tableType>
- </dbimport>
- </configuration>
- </plugin>
- </plugins>
- </build>
-
-</project>
http://git-wip-us.apache.org/repos/asf/cayenne/blob/2cddff91/plugins/maven-cayenne-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testTableTypes.map.xml-result
----------------------------------------------------------------------
diff --git a/plugins/maven-cayenne-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testTableTypes.map.xml-result b/plugins/maven-cayenne-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testTableTypes.map.xml-result
deleted file mode 100644
index cdc9ddd..0000000
--- a/plugins/maven-cayenne-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testTableTypes.map.xml-result
+++ /dev/null
@@ -1,29 +0,0 @@
-<?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="PERSON" schema="APP">
- <db-attribute name="ID" type="INTEGER" isPrimaryKey="true" isMandatory="true" length="10"/>
- </db-entity>
- <obj-entity name="Person" className="Person" dbEntityName="PERSON">
- </obj-entity>
-</data-map>
http://git-wip-us.apache.org/repos/asf/cayenne/blob/2cddff91/plugins/maven-cayenne-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testTableTypes.sql
----------------------------------------------------------------------
diff --git a/plugins/maven-cayenne-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testTableTypes.sql b/plugins/maven-cayenne-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testTableTypes.sql
deleted file mode 100644
index cb7d3f5..0000000
--- a/plugins/maven-cayenne-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testTableTypes.sql
+++ /dev/null
@@ -1,25 +0,0 @@
--- 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 TABLE Person (
- id INTEGER NOT NULL,
-
- PRIMARY KEY (id)
-);
-
-CREATE VIEW girl (id) AS SELECT id FROM Person;
-CREATE VIEW v_vview (id) AS SELECT id FROM Person;
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/cayenne/blob/2cddff91/plugins/maven-cayenne-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testUnFlattensManyToMany-pom.xml
----------------------------------------------------------------------
diff --git a/plugins/maven-cayenne-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testUnFlattensManyToMany-pom.xml b/plugins/maven-cayenne-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testUnFlattensManyToMany-pom.xml
deleted file mode 100644
index bd43bb0..0000000
--- a/plugins/maven-cayenne-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testUnFlattensManyToMany-pom.xml
+++ /dev/null
@@ -1,44 +0,0 @@
-<?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>maven-cayenne-plugin</artifactId>
- <configuration>
- <map>target/test-classes/org/apache/cayenne/tools/dbimport/testUnFlattensManyToMany.map.xml</map>
- <dataSource>
- <driver>org.apache.derby.jdbc.EmbeddedDriver</driver>
- <url>jdbc:derby:memory:DbImporterMojoTest;create=true</url>
- </dataSource>
- <dbimport>
- <defaultPackage>org.not.my.home</defaultPackage>
- </dbimport>
- </configuration>
- </plugin>
- </plugins>
- </build>
-
-</project>
http://git-wip-us.apache.org/repos/asf/cayenne/blob/2cddff91/plugins/maven-cayenne-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testUnFlattensManyToMany.map.xml
----------------------------------------------------------------------
diff --git a/plugins/maven-cayenne-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testUnFlattensManyToMany.map.xml b/plugins/maven-cayenne-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testUnFlattensManyToMany.map.xml
deleted file mode 100644
index 689a94a..0000000
--- a/plugins/maven-cayenne-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testUnFlattensManyToMany.map.xml
+++ /dev/null
@@ -1,55 +0,0 @@
-<?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.my.home"/>
- <db-entity name="A" schema="APP">
- <db-attribute name="ID" type="INTEGER" isPrimaryKey="true" isMandatory="true" length="10"/>
- </db-entity>
- <db-entity name="A_B" schema="APP">
- <db-attribute name="A_ID" type="INTEGER" isPrimaryKey="true" isMandatory="true" length="10"/>
- <db-attribute name="B_ID" type="INTEGER" isPrimaryKey="true" isMandatory="true" length="10"/>
- </db-entity>
- <db-entity name="B" schema="APP">
- <db-attribute name="ID" type="INTEGER" isPrimaryKey="true" isMandatory="true" length="10"/>
- </db-entity>
- <obj-entity name="A" className="A" dbEntityName="A">
- </obj-entity>
- <obj-entity name="AB" className="AB" dbEntityName="A_B">
- </obj-entity>
- <obj-entity name="B" className="B" dbEntityName="B">
- </obj-entity>
- <db-relationship name="aBs" source="A" target="A_B" toDependentPK="true" toMany="true">
- <db-attribute-pair source="ID" target="A_ID"/>
- </db-relationship>
- <db-relationship name="toA" source="A_B" target="A" toMany="false">
- <db-attribute-pair source="A_ID" target="ID"/>
- </db-relationship>
- <db-relationship name="toB" source="A_B" target="B" toMany="false">
- <db-attribute-pair source="B_ID" target="ID"/>
- </db-relationship>
- <db-relationship name="aBs" source="B" target="A_B" toDependentPK="true" toMany="true">
- <db-attribute-pair source="ID" target="B_ID"/>
- </db-relationship>
- <obj-relationship name="toA" source="AB" target="A" deleteRule="Nullify" db-relationship-path="toA"/>
- <obj-relationship name="aBs" source="B" target="AB" deleteRule="Deny" db-relationship-path="aBs"/>
-</data-map>
http://git-wip-us.apache.org/repos/asf/cayenne/blob/2cddff91/plugins/maven-cayenne-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testUnFlattensManyToMany.map.xml-result
----------------------------------------------------------------------
diff --git a/plugins/maven-cayenne-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testUnFlattensManyToMany.map.xml-result b/plugins/maven-cayenne-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testUnFlattensManyToMany.map.xml-result
deleted file mode 100644
index 46d6a84..0000000
--- a/plugins/maven-cayenne-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testUnFlattensManyToMany.map.xml-result
+++ /dev/null
@@ -1,88 +0,0 @@
-<?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="org.not.my.home"/>
- <db-entity name="A" schema="APP">
- <db-attribute name="ID" type="INTEGER" isPrimaryKey="true" isMandatory="true" length="10"/>
- </db-entity>
- <db-entity name="A_B" schema="APP">
- <db-attribute name="A_ID" type="INTEGER" isPrimaryKey="true" isMandatory="true" length="10"/>
- <db-attribute name="B_ID" type="INTEGER" isPrimaryKey="true" isMandatory="true" length="10"/>
- </db-entity>
- <db-entity name="B" schema="APP">
- <db-attribute name="ID" type="INTEGER" isPrimaryKey="true" isMandatory="true" length="10"/>
- </db-entity>
- <db-entity name="C" schema="APP">
- <db-attribute name="ID" type="INTEGER" isPrimaryKey="true" isMandatory="true" length="10"/>
- </db-entity>
- <db-entity name="X" schema="APP">
- <db-attribute name="ID" type="INTEGER" isPrimaryKey="true" isMandatory="true" length="10"/>
- </db-entity>
- <db-entity name="X_Y" schema="APP">
- <db-attribute name="X_ID" type="INTEGER" isPrimaryKey="true" isMandatory="true" length="10"/>
- <db-attribute name="Y_ID" type="INTEGER" isPrimaryKey="true" isMandatory="true" length="10"/>
- </db-entity>
- <db-entity name="Y" schema="APP">
- <db-attribute name="ID" type="INTEGER" isPrimaryKey="true" isMandatory="true" length="10"/>
- </db-entity>
- <obj-entity name="A" className="A" dbEntityName="A">
- </obj-entity>
- <obj-entity name="AB" className="AB" dbEntityName="A_B">
- </obj-entity>
- <obj-entity name="B" className="B" dbEntityName="B">
- </obj-entity>
- <obj-entity name="C" className="org.not.my.home.C" dbEntityName="C">
- </obj-entity>
- <obj-entity name="X" className="org.not.my.home.X" dbEntityName="X">
- </obj-entity>
- <obj-entity name="Y" className="org.not.my.home.Y" dbEntityName="Y">
- </obj-entity>
- <db-relationship name="aBs" source="A" target="A_B" toDependentPK="true" toMany="true">
- <db-attribute-pair source="ID" target="A_ID"/>
- </db-relationship>
- <db-relationship name="toA" source="A_B" target="A" toMany="false">
- <db-attribute-pair source="A_ID" target="ID"/>
- </db-relationship>
- <db-relationship name="toB" source="A_B" target="B" toMany="false">
- <db-attribute-pair source="B_ID" target="ID"/>
- </db-relationship>
- <db-relationship name="aBs" source="B" target="A_B" toDependentPK="true" toMany="true">
- <db-attribute-pair source="ID" target="B_ID"/>
- </db-relationship>
- <db-relationship name="xIes" source="X" target="X_Y" toDependentPK="true" toMany="true">
- <db-attribute-pair source="ID" target="X_ID"/>
- </db-relationship>
- <db-relationship name="x" source="X_Y" target="X" toMany="false">
- <db-attribute-pair source="X_ID" target="ID"/>
- </db-relationship>
- <db-relationship name="y" source="X_Y" target="Y" toMany="false">
- <db-attribute-pair source="Y_ID" target="ID"/>
- </db-relationship>
- <db-relationship name="xIes" source="Y" target="X_Y" toDependentPK="true" toMany="true">
- <db-attribute-pair source="ID" target="Y_ID"/>
- </db-relationship>
- <obj-relationship name="toA" source="AB" target="A" deleteRule="Nullify" db-relationship-path="toA"/>
- <obj-relationship name="aBs" source="B" target="AB" deleteRule="Deny" db-relationship-path="aBs"/>
- <obj-relationship name="ies" source="X" target="Y" db-relationship-path="xIes.y"/>
- <obj-relationship name="xes" source="Y" target="X" db-relationship-path="xIes.x"/>
-</data-map>
http://git-wip-us.apache.org/repos/asf/cayenne/blob/2cddff91/plugins/maven-cayenne-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testUnFlattensManyToMany.sql
----------------------------------------------------------------------
diff --git a/plugins/maven-cayenne-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testUnFlattensManyToMany.sql b/plugins/maven-cayenne-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testUnFlattensManyToMany.sql
deleted file mode 100644
index b6f4eac..0000000
--- a/plugins/maven-cayenne-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testUnFlattensManyToMany.sql
+++ /dev/null
@@ -1,64 +0,0 @@
--- 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 TABLE APP.A (
- id INTEGER NOT NULL,
-
- PRIMARY KEY (id)
-);
-
-CREATE TABLE APP.B (
- id INTEGER NOT NULL,
-
- PRIMARY KEY (id)
-);
-
-CREATE TABLE APP.A_B (
- A_ID INTEGER NOT NULL,
- B_ID INTEGER NOT NULL,
-
- PRIMARY KEY (A_ID, B_ID),
- CONSTRAINT A_B_A FOREIGN KEY (A_ID) REFERENCES APP.A (ID),
- CONSTRAINT A_B_B FOREIGN KEY (B_ID) REFERENCES APP.B (ID)
-);
-
-CREATE TABLE APP.C (
- id INTEGER NOT NULL,
-
- PRIMARY KEY (id)
-);
-
-CREATE TABLE APP.X (
- id INTEGER NOT NULL,
-
- PRIMARY KEY (id)
-);
-
-CREATE TABLE APP.Y (
- id INTEGER NOT NULL,
-
- PRIMARY KEY (id)
-);
-
-CREATE TABLE APP.X_Y (
- X_ID INTEGER NOT NULL,
- Y_ID INTEGER NOT NULL,
-
- PRIMARY KEY (X_ID, Y_ID),
- CONSTRAINT X_Y_X FOREIGN KEY (X_ID) REFERENCES APP.X (ID),
- CONSTRAINT X_Y_Y FOREIGN KEY (Y_ID) REFERENCES APP.Y (ID)
-);
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/cayenne/blob/2cddff91/plugins/maven-cayenne-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testViewsExclude-pom.xml
----------------------------------------------------------------------
diff --git a/plugins/maven-cayenne-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testViewsExclude-pom.xml b/plugins/maven-cayenne-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testViewsExclude-pom.xml
deleted file mode 100644
index 749b309..0000000
--- a/plugins/maven-cayenne-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testViewsExclude-pom.xml
+++ /dev/null
@@ -1,45 +0,0 @@
-<?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>maven-cayenne-plugin</artifactId>
- <configuration>
- <map>target/test-classes/org/apache/cayenne/tools/dbimport/testViewsExclude.map.xml</map>
- <dataSource>
- <driver>org.apache.derby.jdbc.EmbeddedDriver</driver>
- <url>jdbc:derby:memory:DbImporterMojoTest;create=true</url>
- </dataSource>
-
- <dbimport>
- <excludeTable>^V_.*</excludeTable>
- </dbimport>
- </configuration>
- </plugin>
- </plugins>
- </build>
-
-</project>
http://git-wip-us.apache.org/repos/asf/cayenne/blob/2cddff91/plugins/maven-cayenne-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testViewsExclude.map.xml-result
----------------------------------------------------------------------
diff --git a/plugins/maven-cayenne-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testViewsExclude.map.xml-result b/plugins/maven-cayenne-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testViewsExclude.map.xml-result
deleted file mode 100644
index d24df6e..0000000
--- a/plugins/maven-cayenne-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testViewsExclude.map.xml-result
+++ /dev/null
@@ -1,43 +0,0 @@
-<?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="GIRL" schema="APP">
- <db-attribute name="ID" type="INTEGER" isMandatory="true" length="10"/>
- </db-entity>
- <db-entity name="PERSON" schema="APP">
- <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="Girl" className="Girl" dbEntityName="GIRL">
- <obj-attribute name="id" type="int" db-attribute-path="ID"/>
- </obj-entity>
- <obj-entity name="Person" className="Person" dbEntityName="PERSON">
- <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/2cddff91/plugins/maven-cayenne-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testViewsExclude.sql
----------------------------------------------------------------------
diff --git a/plugins/maven-cayenne-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testViewsExclude.sql b/plugins/maven-cayenne-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testViewsExclude.sql
deleted file mode 100644
index 1af3f84..0000000
--- a/plugins/maven-cayenne-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testViewsExclude.sql
+++ /dev/null
@@ -1,30 +0,0 @@
--- 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 TABLE Person (
- id INTEGER NOT NULL,
- COL2 CHAR(25),
- COL3 DECIMAL(10,2),
- COL4 VARCHAR(25),
- COL5 DATE,
-
- PRIMARY KEY (id),
- UNIQUE (COL3)
-);
-
-CREATE VIEW girl (id) AS SELECT id FROM Person;
-CREATE VIEW v_vview (id) AS SELECT id FROM Person;
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/cayenne/blob/2cddff91/plugins/maven-cayenne-plugin/src/test/resources/org/apache/cayenne/tools/dbimporter-pom1.xml
----------------------------------------------------------------------
diff --git a/plugins/maven-cayenne-plugin/src/test/resources/org/apache/cayenne/tools/dbimporter-pom1.xml b/plugins/maven-cayenne-plugin/src/test/resources/org/apache/cayenne/tools/dbimporter-pom1.xml
deleted file mode 100644
index 43f71c1..0000000
--- a/plugins/maven-cayenne-plugin/src/test/resources/org/apache/cayenne/tools/dbimporter-pom1.xml
+++ /dev/null
@@ -1,37 +0,0 @@
-<?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>maven-cayenne-plugin</artifactId>
- <configuration>
- <map>target/test/org/apache/cayenne/tools/dbimporter-map1.map.xml</map>
- </configuration>
- </plugin>
- </plugins>
- </build>
-
-</project>
http://git-wip-us.apache.org/repos/asf/cayenne/blob/2cddff91/plugins/maven-cayenne-plugin/src/test/resources/org/apache/cayenne/tools/dbimporter-pom2.xml
----------------------------------------------------------------------
diff --git a/plugins/maven-cayenne-plugin/src/test/resources/org/apache/cayenne/tools/dbimporter-pom2.xml b/plugins/maven-cayenne-plugin/src/test/resources/org/apache/cayenne/tools/dbimporter-pom2.xml
deleted file mode 100644
index 24c065a..0000000
--- a/plugins/maven-cayenne-plugin/src/test/resources/org/apache/cayenne/tools/dbimporter-pom2.xml
+++ /dev/null
@@ -1,39 +0,0 @@
-<?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 Test2</name>
-
- <build>
- <plugins>
- <plugin>
- <artifactId>maven-cayenne-plugin</artifactId>
- <configuration>
- <dbimport>
- <meaningfulPkTables>x,b*</meaningfulPkTables>
- </dbimport>
- </configuration>
- </plugin>
- </plugins>
- </build>
-
-</project>
http://git-wip-us.apache.org/repos/asf/cayenne/blob/2cddff91/plugins/maven-cayenne-plugin/src/test/resources/org/apache/cayenne/tools/dbimporter-pom3.xml
----------------------------------------------------------------------
diff --git a/plugins/maven-cayenne-plugin/src/test/resources/org/apache/cayenne/tools/dbimporter-pom3.xml b/plugins/maven-cayenne-plugin/src/test/resources/org/apache/cayenne/tools/dbimporter-pom3.xml
deleted file mode 100644
index 73e65c5..0000000
--- a/plugins/maven-cayenne-plugin/src/test/resources/org/apache/cayenne/tools/dbimporter-pom3.xml
+++ /dev/null
@@ -1,39 +0,0 @@
-<?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>maven-cayenne-plugin</artifactId>
- <configuration>
- <dbimport>
- <meaningfulPkTables>*</meaningfulPkTables>
- </dbimport>
- </configuration>
- </plugin>
- </plugins>
- </build>
-
-</project>
http://git-wip-us.apache.org/repos/asf/cayenne/blob/2cddff91/plugins/pom.xml
----------------------------------------------------------------------
diff --git a/plugins/pom.xml b/plugins/pom.xml
index 43239e5..ed5cac3 100644
--- a/plugins/pom.xml
+++ b/plugins/pom.xml
@@ -22,7 +22,7 @@
<packaging>pom</packaging>
<modules>
- <module>maven-cayenne-plugin</module>
+ <module>cayenne-maven-plugin</module>
<module>maven-cayenne-modeler-plugin</module>
</modules>
[2/8] cayenne git commit: CAY-2214 cdbimport: rename
maven-cayenne-plugin - change module and folder name to
"cayenne-maven-plugin" - artifactId still is "maven-cayenne-plugin"
Posted by nt...@apache.org.
http://git-wip-us.apache.org/repos/asf/cayenne/blob/2cddff91/plugins/maven-cayenne-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testForceDataMapSchema.map.xml-result
----------------------------------------------------------------------
diff --git a/plugins/maven-cayenne-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testForceDataMapSchema.map.xml-result b/plugins/maven-cayenne-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testForceDataMapSchema.map.xml-result
deleted file mode 100644
index 0eaaffd..0000000
--- a/plugins/maven-cayenne-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testForceDataMapSchema.map.xml-result
+++ /dev/null
@@ -1,52 +0,0 @@
-<?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="defaultCatalog" value="XCATALOG"/>
- <db-entity name="CHILD" catalog="XCATALOG">
- <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" catalog="XCATALOG">
- <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/2cddff91/plugins/maven-cayenne-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testForceDataMapSchema.sql
----------------------------------------------------------------------
diff --git a/plugins/maven-cayenne-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testForceDataMapSchema.sql b/plugins/maven-cayenne-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testForceDataMapSchema.sql
deleted file mode 100644
index 279065c..0000000
--- a/plugins/maven-cayenne-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testForceDataMapSchema.sql
+++ /dev/null
@@ -1,40 +0,0 @@
--- 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)
-);
http://git-wip-us.apache.org/repos/asf/cayenne/blob/2cddff91/plugins/maven-cayenne-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testImportAddTableAndColumn-pom.xml
----------------------------------------------------------------------
diff --git a/plugins/maven-cayenne-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testImportAddTableAndColumn-pom.xml b/plugins/maven-cayenne-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testImportAddTableAndColumn-pom.xml
deleted file mode 100644
index 598607d..0000000
--- a/plugins/maven-cayenne-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testImportAddTableAndColumn-pom.xml
+++ /dev/null
@@ -1,41 +0,0 @@
-<?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>maven-cayenne-plugin</artifactId>
- <configuration>
- <map>target/test-classes/org/apache/cayenne/tools/dbimport/testImportAddTableAndColumn.map.xml</map>
- <dataSource>
- <driver>org.apache.derby.jdbc.EmbeddedDriver</driver>
- <url>jdbc:derby:memory:DbImporterMojoTest;create=true</url>
- </dataSource>
- </configuration>
- </plugin>
- </plugins>
- </build>
-
-</project>
http://git-wip-us.apache.org/repos/asf/cayenne/blob/2cddff91/plugins/maven-cayenne-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testImportAddTableAndColumn.map.xml
----------------------------------------------------------------------
diff --git a/plugins/maven-cayenne-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testImportAddTableAndColumn.map.xml b/plugins/maven-cayenne-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testImportAddTableAndColumn.map.xml
deleted file mode 100644
index 2317476..0000000
--- a/plugins/maven-cayenne-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testImportAddTableAndColumn.map.xml
+++ /dev/null
@@ -1,37 +0,0 @@
-<?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="testImportAddTableAndColumn" schema="APP">
- <db-attribute name="COL1" type="INTEGER" isPrimaryKey="true" isMandatory="true" length="10"/>
- <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-entity>
- <obj-entity name="testImportAddTableAndColumn" className="TestTable" dbEntityName="testImportAddTableAndColumn">
- <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/2cddff91/plugins/maven-cayenne-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testImportAddTableAndColumn.map.xml-result
----------------------------------------------------------------------
diff --git a/plugins/maven-cayenne-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testImportAddTableAndColumn.map.xml-result b/plugins/maven-cayenne-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testImportAddTableAndColumn.map.xml-result
deleted file mode 100644
index a5dd466..0000000
--- a/plugins/maven-cayenne-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testImportAddTableAndColumn.map.xml-result
+++ /dev/null
@@ -1,50 +0,0 @@
-<?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="APP">
- <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="APP">
- <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="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>
-</data-map>
http://git-wip-us.apache.org/repos/asf/cayenne/blob/2cddff91/plugins/maven-cayenne-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testImportAddTableAndColumn.sql
----------------------------------------------------------------------
diff --git a/plugins/maven-cayenne-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testImportAddTableAndColumn.sql b/plugins/maven-cayenne-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testImportAddTableAndColumn.sql
deleted file mode 100644
index 0bdef9a..0000000
--- a/plugins/maven-cayenne-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testImportAddTableAndColumn.sql
+++ /dev/null
@@ -1,37 +0,0 @@
--- 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 TABLE Parent (
- id INTEGER NOT NULL,
- COL2 CHAR(25),
- COL3 DECIMAL(10,2),
- COL4 VARCHAR(25),
- COL5 DATE,
-
- PRIMARY KEY (id),
- UNIQUE (COL3)
-);
-
-CREATE TABLE Child (
- id INTEGER NOT NULL,
- Parent_id CHAR(25),
- COL3 DECIMAL(10,2),
- COL4 VARCHAR(25),
- COL5 DATE,
-
- PRIMARY KEY (id)
-);
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/cayenne/blob/2cddff91/plugins/maven-cayenne-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testImportNewDataMap-pom.xml
----------------------------------------------------------------------
diff --git a/plugins/maven-cayenne-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testImportNewDataMap-pom.xml b/plugins/maven-cayenne-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testImportNewDataMap-pom.xml
deleted file mode 100644
index 440d340..0000000
--- a/plugins/maven-cayenne-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testImportNewDataMap-pom.xml
+++ /dev/null
@@ -1,41 +0,0 @@
-<?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>maven-cayenne-plugin</artifactId>
- <configuration>
- <map>target/test-classes/org/apache/cayenne/tools/dbimport/testImportNewDataMap.map.xml</map>
- <dataSource>
- <driver>org.apache.derby.jdbc.EmbeddedDriver</driver>
- <url>jdbc:derby:memory:DbImporterMojoTest;create=true</url>
- </dataSource>
- </configuration>
- </plugin>
- </plugins>
- </build>
-
-</project>
http://git-wip-us.apache.org/repos/asf/cayenne/blob/2cddff91/plugins/maven-cayenne-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testImportNewDataMap.map.xml-result
----------------------------------------------------------------------
diff --git a/plugins/maven-cayenne-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testImportNewDataMap.map.xml-result b/plugins/maven-cayenne-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testImportNewDataMap.map.xml-result
deleted file mode 100644
index 6133ac4..0000000
--- a/plugins/maven-cayenne-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testImportNewDataMap.map.xml-result
+++ /dev/null
@@ -1,37 +0,0 @@
-<?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="TEST_TABLE" schema="APP">
- <db-attribute name="COL1" type="INTEGER" isPrimaryKey="true" isMandatory="true" length="10"/>
- <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-entity>
- <obj-entity name="TestTable" className="TestTable" dbEntityName="TEST_TABLE">
- <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/2cddff91/plugins/maven-cayenne-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testImportNewDataMap.sql
----------------------------------------------------------------------
diff --git a/plugins/maven-cayenne-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testImportNewDataMap.sql b/plugins/maven-cayenne-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testImportNewDataMap.sql
deleted file mode 100644
index cb5b3c6..0000000
--- a/plugins/maven-cayenne-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testImportNewDataMap.sql
+++ /dev/null
@@ -1,27 +0,0 @@
--- 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 TABLE TEST_TABLE (
- COL1 INTEGER NOT NULL,
- COL2 CHAR(25),
- COL3 DECIMAL(10,2),
- COL4 VARCHAR(25),
- COL5 DATE,
-
- PRIMARY KEY (COL1),
- UNIQUE (COL3)
-)
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/cayenne/blob/2cddff91/plugins/maven-cayenne-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testImportWithoutChanges-pom.xml
----------------------------------------------------------------------
diff --git a/plugins/maven-cayenne-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testImportWithoutChanges-pom.xml b/plugins/maven-cayenne-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testImportWithoutChanges-pom.xml
deleted file mode 100644
index c1affd7..0000000
--- a/plugins/maven-cayenne-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testImportWithoutChanges-pom.xml
+++ /dev/null
@@ -1,41 +0,0 @@
-<?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>maven-cayenne-plugin</artifactId>
- <configuration>
- <map>target/test-classes/org/apache/cayenne/tools/dbimport/testImportWithoutChanges.map.xml</map>
- <dataSource>
- <driver>org.apache.derby.jdbc.EmbeddedDriver</driver>
- <url>jdbc:derby:memory:DbImporterMojoTest;create=true</url>
- </dataSource>
- </configuration>
- </plugin>
- </plugins>
- </build>
-
-</project>
http://git-wip-us.apache.org/repos/asf/cayenne/blob/2cddff91/plugins/maven-cayenne-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testImportWithoutChanges.map.xml
----------------------------------------------------------------------
diff --git a/plugins/maven-cayenne-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testImportWithoutChanges.map.xml b/plugins/maven-cayenne-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testImportWithoutChanges.map.xml
deleted file mode 100644
index a22e016..0000000
--- a/plugins/maven-cayenne-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testImportWithoutChanges.map.xml
+++ /dev/null
@@ -1,37 +0,0 @@
-<?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="testImportWithoutChanges" schema="APP">
- <db-attribute name="COL1" type="INTEGER" isPrimaryKey="true" isMandatory="true" length="10"/>
- <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-entity>
- <obj-entity name="testImportWithoutChanges" className="TestTable" dbEntityName="testImportWithoutChanges">
- <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/2cddff91/plugins/maven-cayenne-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testImportWithoutChanges.map.xml-result
----------------------------------------------------------------------
diff --git a/plugins/maven-cayenne-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testImportWithoutChanges.map.xml-result b/plugins/maven-cayenne-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testImportWithoutChanges.map.xml-result
deleted file mode 100644
index 25c85af..0000000
--- a/plugins/maven-cayenne-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testImportWithoutChanges.map.xml-result
+++ /dev/null
@@ -1,37 +0,0 @@
-<?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="testImportWithoutChanges" schema="APP">
- <db-attribute name="COL1" type="INTEGER" isPrimaryKey="true" isMandatory="true" length="10"/>
- <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-entity>
- <obj-entity name="testImportWithoutChanges" className="TestTable" dbEntityName="testImportWithoutChanges">
- <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/2cddff91/plugins/maven-cayenne-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testImportWithoutChanges.sql
----------------------------------------------------------------------
diff --git a/plugins/maven-cayenne-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testImportWithoutChanges.sql b/plugins/maven-cayenne-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testImportWithoutChanges.sql
deleted file mode 100644
index beca35a..0000000
--- a/plugins/maven-cayenne-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testImportWithoutChanges.sql
+++ /dev/null
@@ -1,27 +0,0 @@
--- 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 TABLE testImportWithoutChanges (
- COL1 INTEGER NOT NULL,
- COL2 CHAR(25),
- COL3 DECIMAL(10,2),
- COL4 VARCHAR(25),
- COL5 DATE,
-
- PRIMARY KEY (COL1),
- UNIQUE (COL3)
-)
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/cayenne/blob/2cddff91/plugins/maven-cayenne-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testOneToOne-pom.xml
----------------------------------------------------------------------
diff --git a/plugins/maven-cayenne-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testOneToOne-pom.xml b/plugins/maven-cayenne-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testOneToOne-pom.xml
deleted file mode 100644
index 418fd59..0000000
--- a/plugins/maven-cayenne-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testOneToOne-pom.xml
+++ /dev/null
@@ -1,41 +0,0 @@
-<?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>maven-cayenne-plugin</artifactId>
- <configuration>
- <map>target/test-classes/org/apache/cayenne/tools/dbimport/testOneToOne.map.xml</map>
- <dataSource>
- <driver>org.apache.derby.jdbc.EmbeddedDriver</driver>
- <url>jdbc:derby:memory:DbImporterMojoTest;create=true</url>
- </dataSource>
- </configuration>
- </plugin>
- </plugins>
- </build>
-
-</project>
http://git-wip-us.apache.org/repos/asf/cayenne/blob/2cddff91/plugins/maven-cayenne-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testOneToOne.map.xml-result
----------------------------------------------------------------------
diff --git a/plugins/maven-cayenne-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testOneToOne.map.xml-result b/plugins/maven-cayenne-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testOneToOne.map.xml-result
deleted file mode 100644
index 203c001..0000000
--- a/plugins/maven-cayenne-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testOneToOne.map.xml-result
+++ /dev/null
@@ -1,58 +0,0 @@
-<?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="PICK_SCHEDULE" schema="APP">
- <db-attribute name="ID" type="INTEGER" isPrimaryKey="true" isMandatory="true" length="10"/>
- <db-attribute name="OWNER_ID" type="INTEGER" length="10"/>
- <db-attribute name="SELECTED_PLAYER_ID" type="INTEGER" length="10"/>
- </db-entity>
- <db-entity name="PLAYER" schema="APP">
- <db-attribute name="ID" type="INTEGER" isPrimaryKey="true" isMandatory="true" length="10"/>
- </db-entity>
- <db-entity name="PLAYER_INFO" schema="APP">
- <db-attribute name="PLAYER_ID" type="INTEGER" isPrimaryKey="true" isMandatory="true" length="10"/>
- </db-entity>
- <obj-entity name="PickSchedule" className="PickSchedule" dbEntityName="PICK_SCHEDULE">
- <obj-attribute name="ownerId" type="int" db-attribute-path="OWNER_ID"/>
- </obj-entity>
- <obj-entity name="Player" className="Player" dbEntityName="PLAYER">
- </obj-entity>
- <obj-entity name="PlayerInfo" className="PlayerInfo" dbEntityName="PLAYER_INFO">
- </obj-entity>
- <db-relationship name="selectedPlayer" source="PICK_SCHEDULE" target="PLAYER" toMany="false">
- <db-attribute-pair source="SELECTED_PLAYER_ID" target="ID"/>
- </db-relationship>
- <db-relationship name="pickSchedules" source="PLAYER" target="PICK_SCHEDULE" toMany="true">
- <db-attribute-pair source="ID" target="SELECTED_PLAYER_ID"/>
- </db-relationship>
- <db-relationship name="playerInfo" source="PLAYER" target="PLAYER_INFO" toDependentPK="true" toMany="false">
- <db-attribute-pair source="ID" target="PLAYER_ID"/>
- </db-relationship>
- <db-relationship name="player" source="PLAYER_INFO" target="PLAYER" toMany="false">
- <db-attribute-pair source="PLAYER_ID" target="ID"/>
- </db-relationship>
- <obj-relationship name="selectedPlayer" source="PickSchedule" target="Player" deleteRule="Nullify" db-relationship-path="selectedPlayer"/>
- <obj-relationship name="pickSchedules" source="Player" target="PickSchedule" deleteRule="Deny" db-relationship-path="pickSchedules"/>
- <obj-relationship name="playerInfo" source="Player" target="PlayerInfo" deleteRule="Nullify" db-relationship-path="playerInfo"/>
- <obj-relationship name="player" source="PlayerInfo" target="Player" deleteRule="Nullify" db-relationship-path="player"/>
-</data-map>
http://git-wip-us.apache.org/repos/asf/cayenne/blob/2cddff91/plugins/maven-cayenne-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testOneToOne.sql
----------------------------------------------------------------------
diff --git a/plugins/maven-cayenne-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testOneToOne.sql b/plugins/maven-cayenne-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testOneToOne.sql
deleted file mode 100644
index b676ed9..0000000
--- a/plugins/maven-cayenne-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testOneToOne.sql
+++ /dev/null
@@ -1,41 +0,0 @@
--- 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 TABLE player (
- id INTEGER NOT NULL,
-
- PRIMARY KEY (id)
-);
-
-
--- one-to-one relationship
-CREATE TABLE player_info (
- player_id INTEGER NOT NULL,
-
- PRIMARY KEY (player_id),
- CONSTRAINT fk_player_info FOREIGN KEY (player_id) REFERENCES player (id)
-);
-
--- one-to-many relationship
-CREATE TABLE pick_schedule (
- id INTEGER NOT NULL,
- owner_id INTEGER,
- selected_player_id INTEGER,
- PRIMARY KEY (id),
-
- CONSTRAINT fk_pick_schedule_player1 FOREIGN KEY (selected_player_id) REFERENCES player (id)
-)
http://git-wip-us.apache.org/repos/asf/cayenne/blob/2cddff91/plugins/maven-cayenne-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testPreserveCustomObjMappings-pom.xml
----------------------------------------------------------------------
diff --git a/plugins/maven-cayenne-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testPreserveCustomObjMappings-pom.xml b/plugins/maven-cayenne-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testPreserveCustomObjMappings-pom.xml
deleted file mode 100644
index ea24dc8..0000000
--- a/plugins/maven-cayenne-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testPreserveCustomObjMappings-pom.xml
+++ /dev/null
@@ -1,47 +0,0 @@
-<?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>maven-cayenne-plugin</artifactId>
- <configuration>
- <map>target/test-classes/org/apache/cayenne/tools/dbimport/testPreserveCustomObjMappings.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/2cddff91/plugins/maven-cayenne-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testPreserveCustomObjMappings.map.xml
----------------------------------------------------------------------
diff --git a/plugins/maven-cayenne-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testPreserveCustomObjMappings.map.xml b/plugins/maven-cayenne-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testPreserveCustomObjMappings.map.xml
deleted file mode 100644
index 909c5f9..0000000
--- a/plugins/maven-cayenne-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testPreserveCustomObjMappings.map.xml
+++ /dev/null
@@ -1,33 +0,0 @@
-<?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="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="ID" type="INTEGER" isPrimaryKey="true" isMandatory="true" length="10"/>
- </db-entity>
- <obj-entity name="Parent" className="Parent" dbEntityName="PARENT">
- <obj-attribute name="col2" type="java.lang.String" db-attribute-path="COL2"/>
- </obj-entity>
-</data-map>
http://git-wip-us.apache.org/repos/asf/cayenne/blob/2cddff91/plugins/maven-cayenne-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testPreserveCustomObjMappings.map.xml-result
----------------------------------------------------------------------
diff --git a/plugins/maven-cayenne-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testPreserveCustomObjMappings.map.xml-result b/plugins/maven-cayenne-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testPreserveCustomObjMappings.map.xml-result
deleted file mode 100644
index d874808..0000000
--- a/plugins/maven-cayenne-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testPreserveCustomObjMappings.map.xml-result
+++ /dev/null
@@ -1,35 +0,0 @@
-<?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="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="ID" type="INTEGER" isPrimaryKey="true" isMandatory="true" length="10"/>
- </db-entity>
- <obj-entity name="Parent" className="Parent" dbEntityName="PARENT">
- <obj-attribute name="col2" type="java.lang.String" db-attribute-path="COL2"/>
- <obj-attribute name="col4" type="java.lang.String" db-attribute-path="COL4"/>
- </obj-entity>
-</data-map>
http://git-wip-us.apache.org/repos/asf/cayenne/blob/2cddff91/plugins/maven-cayenne-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testPreserveCustomObjMappings.sql
----------------------------------------------------------------------
diff --git a/plugins/maven-cayenne-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testPreserveCustomObjMappings.sql b/plugins/maven-cayenne-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testPreserveCustomObjMappings.sql
deleted file mode 100644
index 32be3a5..0000000
--- a/plugins/maven-cayenne-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testPreserveCustomObjMappings.sql
+++ /dev/null
@@ -1,28 +0,0 @@
--- 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),
-
- PRIMARY KEY (id)
- );
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/cayenne/blob/2cddff91/plugins/maven-cayenne-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testPreserveRelationships-pom.xml
----------------------------------------------------------------------
diff --git a/plugins/maven-cayenne-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testPreserveRelationships-pom.xml b/plugins/maven-cayenne-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testPreserveRelationships-pom.xml
deleted file mode 100644
index 8056381..0000000
--- a/plugins/maven-cayenne-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testPreserveRelationships-pom.xml
+++ /dev/null
@@ -1,45 +0,0 @@
-<?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>maven-cayenne-plugin</artifactId>
- <configuration>
- <map>target/test-classes/org/apache/cayenne/tools/dbimport/testPreserveRelationships.map.xml</map>
- <dataSource>
- <driver>org.apache.derby.jdbc.EmbeddedDriver</driver>
- <url>jdbc:derby:memory:DbImporterMojoTest;create=true</url>
- </dataSource>
- <dbimport>
- <!-- it doesn't matter true or false, but initial question was about this flag -->
- <skipRelationshipsLoading>true</skipRelationshipsLoading>
- </dbimport>
- </configuration>
- </plugin>
- </plugins>
- </build>
-
-</project>
http://git-wip-us.apache.org/repos/asf/cayenne/blob/2cddff91/plugins/maven-cayenne-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testPreserveRelationships.map.xml
----------------------------------------------------------------------
diff --git a/plugins/maven-cayenne-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testPreserveRelationships.map.xml b/plugins/maven-cayenne-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testPreserveRelationships.map.xml
deleted file mode 100644
index 5d3c059..0000000
--- a/plugins/maven-cayenne-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testPreserveRelationships.map.xml
+++ /dev/null
@@ -1,44 +0,0 @@
-<?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="APP">
- <db-attribute name="ID" type="INTEGER" isPrimaryKey="true" isMandatory="true" length="10"/>
- <db-attribute name="PARENT_ID" type="INTEGER" length="10"/>
- </db-entity>
- <db-entity name="PARENT" schema="APP">
- <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="parentId" type="java.lang.Integer" db-attribute-path="PARENT_ID"/>
- </obj-entity>
- <obj-entity name="Parent" className="Parent" dbEntityName="PARENT">
- </obj-entity>
- <db-relationship name="toParent" source="CHILD" target="PARENT" toMany="false">
- <db-attribute-pair source="PARENT_ID" target="ID"/>
- </db-relationship>
- <db-relationship name="toParent" source="PARENT" target="CHILD" toMany="false">
- <db-attribute-pair source="ID" target="PARENT_ID"/>
- </db-relationship>
- <obj-relationship name="toParent" source="Child" target="Parent" deleteRule="Nullify" db-relationship-path="toParent"/>
- <obj-relationship name="toParent" source="Parent" target="Child" deleteRule="Nullify" db-relationship-path="toParent"/>
-</data-map>
http://git-wip-us.apache.org/repos/asf/cayenne/blob/2cddff91/plugins/maven-cayenne-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testPreserveRelationships.map.xml-result
----------------------------------------------------------------------
diff --git a/plugins/maven-cayenne-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testPreserveRelationships.map.xml-result b/plugins/maven-cayenne-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testPreserveRelationships.map.xml-result
deleted file mode 100644
index 818c17f..0000000
--- a/plugins/maven-cayenne-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testPreserveRelationships.map.xml-result
+++ /dev/null
@@ -1,34 +0,0 @@
-<?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="APP">
- <db-attribute name="ID" type="INTEGER" isPrimaryKey="true" isMandatory="true" length="10"/>
- </db-entity>
- <db-entity name="PARENT" schema="APP">
- <db-attribute name="ID" type="INTEGER" isPrimaryKey="true" isMandatory="true" length="10"/>
- </db-entity>
- <obj-entity name="Child" className="Child" dbEntityName="CHILD">
- </obj-entity>
- <obj-entity name="Parent" className="Parent" dbEntityName="PARENT">
- </obj-entity>
-</data-map>
http://git-wip-us.apache.org/repos/asf/cayenne/blob/2cddff91/plugins/maven-cayenne-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testPreserveRelationships.sql
----------------------------------------------------------------------
diff --git a/plugins/maven-cayenne-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testPreserveRelationships.sql b/plugins/maven-cayenne-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testPreserveRelationships.sql
deleted file mode 100644
index 86b26bc..0000000
--- a/plugins/maven-cayenne-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testPreserveRelationships.sql
+++ /dev/null
@@ -1,28 +0,0 @@
--- 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 TABLE APP.Parent (
- id INTEGER NOT NULL,
-
- PRIMARY KEY (id)
-);
-
-CREATE TABLE APP.Child (
- id INTEGER NOT NULL,
-
- PRIMARY KEY (id)
-);
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/cayenne/blob/2cddff91/plugins/maven-cayenne-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testSchemasAndTableExclude-pom.xml
----------------------------------------------------------------------
diff --git a/plugins/maven-cayenne-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testSchemasAndTableExclude-pom.xml b/plugins/maven-cayenne-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testSchemasAndTableExclude-pom.xml
deleted file mode 100644
index 488a560..0000000
--- a/plugins/maven-cayenne-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testSchemasAndTableExclude-pom.xml
+++ /dev/null
@@ -1,48 +0,0 @@
-<?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>maven-cayenne-plugin</artifactId>
- <configuration>
- <map>target/test-classes/org/apache/cayenne/tools/dbimport/testSchemasAndTableExclude.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>
- <excludeTable>Child</excludeTable>
- </dbimport>
- </configuration>
- </plugin>
- </plugins>
- </build>
-
-</project>
http://git-wip-us.apache.org/repos/asf/cayenne/blob/2cddff91/plugins/maven-cayenne-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testSchemasAndTableExclude.map.xml-result
----------------------------------------------------------------------
diff --git a/plugins/maven-cayenne-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testSchemasAndTableExclude.map.xml-result b/plugins/maven-cayenne-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testSchemasAndTableExclude.map.xml-result
deleted file mode 100644
index 1870f1b..0000000
--- a/plugins/maven-cayenne-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testSchemasAndTableExclude.map.xml-result
+++ /dev/null
@@ -1,38 +0,0 @@
-<?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="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="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>
-</data-map>
http://git-wip-us.apache.org/repos/asf/cayenne/blob/2cddff91/plugins/maven-cayenne-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testSchemasAndTableExclude.sql
----------------------------------------------------------------------
diff --git a/plugins/maven-cayenne-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testSchemasAndTableExclude.sql b/plugins/maven-cayenne-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testSchemasAndTableExclude.sql
deleted file mode 100644
index dba8da6..0000000
--- a/plugins/maven-cayenne-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testSchemasAndTableExclude.sql
+++ /dev/null
@@ -1,64 +0,0 @@
--- 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)
-);
-
-CREATE SCHEMA schema_02;
-SET SCHEMA schema_02;
-
-CREATE TABLE schema_02.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_02.Child (
- id INTEGER NOT NULL,
- Parent_id CHAR(25),
- COL3 DECIMAL(10,2),
- COL4 VARCHAR(25),
- COL5 DATE,
-
- PRIMARY KEY (id)
-);
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/cayenne/blob/2cddff91/plugins/maven-cayenne-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testSkipPrimaryKeyLoading-pom.xml
----------------------------------------------------------------------
diff --git a/plugins/maven-cayenne-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testSkipPrimaryKeyLoading-pom.xml b/plugins/maven-cayenne-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testSkipPrimaryKeyLoading-pom.xml
deleted file mode 100644
index e8f41ea..0000000
--- a/plugins/maven-cayenne-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testSkipPrimaryKeyLoading-pom.xml
+++ /dev/null
@@ -1,45 +0,0 @@
-<?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>maven-cayenne-plugin</artifactId>
- <configuration>
- <map>target/test-classes/org/apache/cayenne/tools/dbimport/testSkipPrimaryKeyLoading.map.xml</map>
- <dataSource>
- <driver>org.apache.derby.jdbc.EmbeddedDriver</driver>
- <url>jdbc:derby:memory:DbImporterMojoTest;create=true</url>
- </dataSource>
-
- <dbimport>
- <skipPrimaryKeyLoading>true</skipPrimaryKeyLoading>
- </dbimport>
- </configuration>
- </plugin>
- </plugins>
- </build>
-
-</project>
http://git-wip-us.apache.org/repos/asf/cayenne/blob/2cddff91/plugins/maven-cayenne-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testSkipPrimaryKeyLoading.map.xml
----------------------------------------------------------------------
diff --git a/plugins/maven-cayenne-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testSkipPrimaryKeyLoading.map.xml b/plugins/maven-cayenne-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testSkipPrimaryKeyLoading.map.xml
deleted file mode 100644
index 1f08680..0000000
--- a/plugins/maven-cayenne-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testSkipPrimaryKeyLoading.map.xml
+++ /dev/null
@@ -1,35 +0,0 @@
-<?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.my.home"/>
- <db-entity name="A" schema="APP">
- <db-attribute name="ID" type="INTEGER" isPrimaryKey="true" isMandatory="true" length="10"/>
- </db-entity>
- <db-entity name="B" schema="APP">
- <db-attribute name="ID" type="INTEGER" isPrimaryKey="true" isMandatory="true" length="10"/>
- </db-entity>
- <obj-entity name="NewName" className="NewName" dbEntityName="A">
- </obj-entity>
- <obj-entity name="B" className="B" dbEntityName="B">
- </obj-entity>
-</data-map>
http://git-wip-us.apache.org/repos/asf/cayenne/blob/2cddff91/plugins/maven-cayenne-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testSkipPrimaryKeyLoading.map.xml-result
----------------------------------------------------------------------
diff --git a/plugins/maven-cayenne-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testSkipPrimaryKeyLoading.map.xml-result b/plugins/maven-cayenne-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testSkipPrimaryKeyLoading.map.xml-result
deleted file mode 100644
index 4da960f..0000000
--- a/plugins/maven-cayenne-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testSkipPrimaryKeyLoading.map.xml-result
+++ /dev/null
@@ -1,41 +0,0 @@
-<?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.my.home"/>
- <db-entity name="A" schema="APP">
- <db-attribute name="ID" type="INTEGER" isPrimaryKey="true" isMandatory="true" length="10"/>
- </db-entity>
- <db-entity name="B" schema="APP">
- <db-attribute name="ID" type="INTEGER" isPrimaryKey="true" isMandatory="true" length="10"/>
- </db-entity>
- <db-entity name="C" schema="APP">
- <db-attribute name="ID" type="INTEGER" isMandatory="true" length="10"/>
- </db-entity>
- <obj-entity name="NewName" className="NewName" dbEntityName="A">
- </obj-entity>
- <obj-entity name="B" className="B" dbEntityName="B">
- </obj-entity>
- <obj-entity name="C" className="com.my.home.C" dbEntityName="C">
- <obj-attribute name="id" type="int" db-attribute-path="ID"/>
- </obj-entity>
-</data-map>
http://git-wip-us.apache.org/repos/asf/cayenne/blob/2cddff91/plugins/maven-cayenne-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testSkipPrimaryKeyLoading.sql
----------------------------------------------------------------------
diff --git a/plugins/maven-cayenne-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testSkipPrimaryKeyLoading.sql b/plugins/maven-cayenne-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testSkipPrimaryKeyLoading.sql
deleted file mode 100644
index 4bf663c..0000000
--- a/plugins/maven-cayenne-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testSkipPrimaryKeyLoading.sql
+++ /dev/null
@@ -1,30 +0,0 @@
--- 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 TABLE APP.A (
- id INTEGER NOT NULL,
-
- PRIMARY KEY (id)
-);
-
-CREATE TABLE APP.B (
- id INTEGER NOT NULL
-);
-
-CREATE TABLE APP.C (
- id INTEGER NOT NULL
-);
http://git-wip-us.apache.org/repos/asf/cayenne/blob/2cddff91/plugins/maven-cayenne-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testSkipRelationshipsLoading-pom.xml
----------------------------------------------------------------------
diff --git a/plugins/maven-cayenne-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testSkipRelationshipsLoading-pom.xml b/plugins/maven-cayenne-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testSkipRelationshipsLoading-pom.xml
deleted file mode 100644
index df9d7d5..0000000
--- a/plugins/maven-cayenne-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testSkipRelationshipsLoading-pom.xml
+++ /dev/null
@@ -1,45 +0,0 @@
-<?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>maven-cayenne-plugin</artifactId>
- <configuration>
- <map>target/test-classes/org/apache/cayenne/tools/dbimport/testSkipRelationshipsLoading.map.xml</map>
- <dataSource>
- <driver>org.apache.derby.jdbc.EmbeddedDriver</driver>
- <url>jdbc:derby:memory:DbImporterMojoTest;create=true</url>
- </dataSource>
-
- <dbimport>
- <skipRelationshipsLoading>true</skipRelationshipsLoading>
- </dbimport>
- </configuration>
- </plugin>
- </plugins>
- </build>
-
-</project>
http://git-wip-us.apache.org/repos/asf/cayenne/blob/2cddff91/plugins/maven-cayenne-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testSkipRelationshipsLoading.map.xml
----------------------------------------------------------------------
diff --git a/plugins/maven-cayenne-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testSkipRelationshipsLoading.map.xml b/plugins/maven-cayenne-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testSkipRelationshipsLoading.map.xml
deleted file mode 100644
index a245765..0000000
--- a/plugins/maven-cayenne-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testSkipRelationshipsLoading.map.xml
+++ /dev/null
@@ -1,55 +0,0 @@
-<?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.my.home"/>
- <db-entity name="A" schema="APP">
- <db-attribute name="ID" type="INTEGER" isPrimaryKey="true" isMandatory="true" length="10"/>
- </db-entity>
- <db-entity name="A_B" schema="APP">
- <db-attribute name="A_ID" type="INTEGER" isMandatory="true" length="10"/>
- <db-attribute name="B_ID" type="INTEGER" isMandatory="true" length="10"/>
- </db-entity>
- <db-entity name="B" schema="APP">
- <db-attribute name="ID" type="INTEGER" isPrimaryKey="true" isMandatory="true" length="10"/>
- </db-entity>
- <obj-entity name="A" className="A" dbEntityName="A">
- </obj-entity>
- <obj-entity name="AB" className="AB" dbEntityName="A_B">
- </obj-entity>
- <obj-entity name="B" className="B" dbEntityName="B">
- </obj-entity>
- <db-relationship name="aBArray" source="A" target="A_B" toMany="true">
- <db-attribute-pair source="ID" target="A_ID"/>
- </db-relationship>
- <db-relationship name="toA" source="A_B" target="A" toMany="false">
- <db-attribute-pair source="A_ID" target="ID"/>
- </db-relationship>
- <db-relationship name="toB" source="A_B" target="B" toMany="false">
- <db-attribute-pair source="B_ID" target="ID"/>
- </db-relationship>
- <db-relationship name="aBArray" source="B" target="A_B" toMany="true">
- <db-attribute-pair source="ID" target="B_ID"/>
- </db-relationship>
- <obj-relationship name="toA" source="AB" target="A" deleteRule="Nullify" db-relationship-path="toA"/>
- <obj-relationship name="aBArray" source="B" target="AB" deleteRule="Deny" db-relationship-path="aBArray"/>
-</data-map>
http://git-wip-us.apache.org/repos/asf/cayenne/blob/2cddff91/plugins/maven-cayenne-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testSkipRelationshipsLoading.map.xml-result
----------------------------------------------------------------------
diff --git a/plugins/maven-cayenne-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testSkipRelationshipsLoading.map.xml-result b/plugins/maven-cayenne-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testSkipRelationshipsLoading.map.xml-result
deleted file mode 100644
index a245765..0000000
--- a/plugins/maven-cayenne-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testSkipRelationshipsLoading.map.xml-result
+++ /dev/null
@@ -1,55 +0,0 @@
-<?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.my.home"/>
- <db-entity name="A" schema="APP">
- <db-attribute name="ID" type="INTEGER" isPrimaryKey="true" isMandatory="true" length="10"/>
- </db-entity>
- <db-entity name="A_B" schema="APP">
- <db-attribute name="A_ID" type="INTEGER" isMandatory="true" length="10"/>
- <db-attribute name="B_ID" type="INTEGER" isMandatory="true" length="10"/>
- </db-entity>
- <db-entity name="B" schema="APP">
- <db-attribute name="ID" type="INTEGER" isPrimaryKey="true" isMandatory="true" length="10"/>
- </db-entity>
- <obj-entity name="A" className="A" dbEntityName="A">
- </obj-entity>
- <obj-entity name="AB" className="AB" dbEntityName="A_B">
- </obj-entity>
- <obj-entity name="B" className="B" dbEntityName="B">
- </obj-entity>
- <db-relationship name="aBArray" source="A" target="A_B" toMany="true">
- <db-attribute-pair source="ID" target="A_ID"/>
- </db-relationship>
- <db-relationship name="toA" source="A_B" target="A" toMany="false">
- <db-attribute-pair source="A_ID" target="ID"/>
- </db-relationship>
- <db-relationship name="toB" source="A_B" target="B" toMany="false">
- <db-attribute-pair source="B_ID" target="ID"/>
- </db-relationship>
- <db-relationship name="aBArray" source="B" target="A_B" toMany="true">
- <db-attribute-pair source="ID" target="B_ID"/>
- </db-relationship>
- <obj-relationship name="toA" source="AB" target="A" deleteRule="Nullify" db-relationship-path="toA"/>
- <obj-relationship name="aBArray" source="B" target="AB" deleteRule="Deny" db-relationship-path="aBArray"/>
-</data-map>
http://git-wip-us.apache.org/repos/asf/cayenne/blob/2cddff91/plugins/maven-cayenne-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testSkipRelationshipsLoading.sql
----------------------------------------------------------------------
diff --git a/plugins/maven-cayenne-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testSkipRelationshipsLoading.sql b/plugins/maven-cayenne-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testSkipRelationshipsLoading.sql
deleted file mode 100644
index 0241d1d..0000000
--- a/plugins/maven-cayenne-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testSkipRelationshipsLoading.sql
+++ /dev/null
@@ -1,36 +0,0 @@
--- 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 TABLE APP.A (
- id INTEGER NOT NULL,
-
- PRIMARY KEY (id)
-);
-
-CREATE TABLE APP.B (
- id INTEGER NOT NULL,
-
- PRIMARY KEY (id)
-);
-
-CREATE TABLE APP.A_B (
- A_ID INTEGER NOT NULL,
- B_ID INTEGER NOT NULL,
-
- CONSTRAINT A_B_A FOREIGN KEY (A_ID) REFERENCES APP.A (ID),
- CONSTRAINT A_B_B FOREIGN KEY (B_ID) REFERENCES APP.B (ID)
-);
\ No newline at end of file
[4/8] cayenne git commit: CAY-2214 cdbimport: rename
maven-cayenne-plugin - change module and folder name to
"cayenne-maven-plugin" - artifactId still is "maven-cayenne-plugin"
Posted by nt...@apache.org.
http://git-wip-us.apache.org/repos/asf/cayenne/blob/2cddff91/plugins/maven-cayenne-plugin/src/main/java/org/apache/cayenne/tools/DbGeneratorMojo.java
----------------------------------------------------------------------
diff --git a/plugins/maven-cayenne-plugin/src/main/java/org/apache/cayenne/tools/DbGeneratorMojo.java b/plugins/maven-cayenne-plugin/src/main/java/org/apache/cayenne/tools/DbGeneratorMojo.java
deleted file mode 100644
index 72c524f..0000000
--- a/plugins/maven-cayenne-plugin/src/main/java/org/apache/cayenne/tools/DbGeneratorMojo.java
+++ /dev/null
@@ -1,192 +0,0 @@
-/*****************************************************************
- * 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.
- ****************************************************************/
-
-package org.apache.cayenne.tools;
-
-import org.apache.cayenne.access.DbGenerator;
-import org.apache.cayenne.datasource.DriverDataSource;
-import org.apache.cayenne.dba.DbAdapter;
-import org.apache.cayenne.dba.JdbcAdapter;
-import org.apache.cayenne.dbsync.DbSyncModule;
-import org.apache.cayenne.di.AdhocObjectFactory;
-import org.apache.cayenne.di.DIBootstrap;
-import org.apache.cayenne.di.Injector;
-import org.apache.cayenne.log.NoopJdbcEventLogger;
-import org.apache.cayenne.map.DataMap;
-import org.apache.cayenne.map.MapLoader;
-import org.apache.cayenne.tools.configuration.ToolsModule;
-import org.apache.cayenne.util.Util;
-import org.apache.commons.logging.Log;
-import org.apache.maven.plugin.AbstractMojo;
-import org.apache.maven.plugin.MojoExecutionException;
-import org.apache.maven.plugin.MojoFailureException;
-import org.xml.sax.InputSource;
-
-import java.io.File;
-import java.sql.Driver;
-
-/**
- * Maven mojo to perform class generation from data map. This class is a Maven
- * adapter to DefaultClassGenerator class.
- *
- * @since 3.0
- *
- * @phase pre-integration-test
- * @goal cdbgen
- */
-public class DbGeneratorMojo extends AbstractMojo {
-
- /**
- * DataMap XML file to use as a schema descriptor.
- *
- * @parameter map="map"
- * @required
- */
- private File map;
-
- /**
- * Java class implementing org.apache.cayenne.dba.DbAdapter. While this
- * attribute is optional (a generic JdbcAdapter is used if not set), it is
- * highly recommended to specify correct target adapter.
- *
- * @parameter adapter="adapter"
- */
- private String adapter;
-
- /**
- * A class of JDBC driver to use for the target database.
- *
- * @parameter driver="driver"
- * @required
- */
- private String driver;
-
- /**
- * JDBC connection URL of a target database.
- *
- * @parameter url="url"
- * @required
- */
- private String url;
-
- /**
- * Database user name.
- *
- * @parameter username="username"
- */
- private String username;
-
- /**
- * Database user password.
- *
- * @parameter password="password"
- */
- private String password;
-
- /**
- * Defines whether cdbgen should drop the tables before attempting to create
- * new ones. Default is <code>false</code>.
- *
- * @parameter dropTables="dropTables" default-value="false"
- */
- private boolean dropTables;
-
- /**
- * Defines whether cdbgen should drop Cayenne primary key support objects.
- * Default is <code>false</code>.
- *
- * @parameter dropPK="dropPK" default-value="false"
- */
- private boolean dropPK;
-
- /**
- * Defines whether cdbgen should create new tables. Default is
- * <code>true</code>.
- *
- * @parameter createTables="createTables" default-value="true"
- */
- private boolean createTables;
-
- /**
- * Defines whether cdbgen should create Cayenne-specific auto PK objects.
- * Default is <code>true</code>.
- *
- * @parameter createPK="createPK" default-value="true"
- */
- private boolean createPK;
-
- /**
- * Defines whether cdbgen should create foreign key copnstraints. Default is
- * <code>true</code>.
- *
- * @parameter createFK="createFK" default-value="true"
- */
- private boolean createFK;
-
- public void execute() throws MojoExecutionException, MojoFailureException {
-
- Log logger = new MavenLogger(this);
- Injector injector = DIBootstrap.createInjector(new DbSyncModule(), new ToolsModule(logger));
- AdhocObjectFactory objectFactory = injector.getInstance(AdhocObjectFactory.class);
-
- logger.info(String.format("connection settings - [driver: %s, url: %s, username: %s]", driver, url, username));
-
- logger.info(String.format(
- "generator options - [dropTables: %s, dropPK: %s, createTables: %s, createPK: %s, createFK: %s]",
- dropTables, dropPK, createTables, createPK, createFK));
-
- try {
- final DbAdapter adapterInst = (adapter == null) ? (DbAdapter) objectFactory.newInstance(DbAdapter.class,
- JdbcAdapter.class.getName()) : (DbAdapter) objectFactory.newInstance(DbAdapter.class, adapter);
-
- // Load the data map and run the db generator.
- DataMap dataMap = loadDataMap();
- DbGenerator generator = new DbGenerator(adapterInst, dataMap, NoopJdbcEventLogger.getInstance());
- generator.setShouldCreateFKConstraints(createFK);
- generator.setShouldCreatePKSupport(createPK);
- generator.setShouldCreateTables(createTables);
- generator.setShouldDropPKSupport(dropPK);
- generator.setShouldDropTables(dropTables);
-
- // load driver taking custom CLASSPATH into account...
- DriverDataSource dataSource = new DriverDataSource((Driver) Class.forName(driver).newInstance(), url,
- username, password);
-
- generator.runGenerator(dataSource);
- } catch (Exception ex) {
- Throwable th = Util.unwindException(ex);
-
- String message = "Error generating database";
-
- if (th.getLocalizedMessage() != null) {
- message += ": " + th.getLocalizedMessage();
- }
-
- logger.error(message);
- throw new MojoExecutionException(message, th);
- }
- }
-
- /** Loads and returns DataMap based on <code>map</code> attribute. */
- protected DataMap loadDataMap() throws Exception {
- InputSource in = new InputSource(map.getCanonicalPath());
- return new MapLoader().loadDataMap(in);
- }
-
-}
http://git-wip-us.apache.org/repos/asf/cayenne/blob/2cddff91/plugins/maven-cayenne-plugin/src/main/java/org/apache/cayenne/tools/DbImportDataSourceConfig.java
----------------------------------------------------------------------
diff --git a/plugins/maven-cayenne-plugin/src/main/java/org/apache/cayenne/tools/DbImportDataSourceConfig.java b/plugins/maven-cayenne-plugin/src/main/java/org/apache/cayenne/tools/DbImportDataSourceConfig.java
deleted file mode 100644
index 8fa4b56..0000000
--- a/plugins/maven-cayenne-plugin/src/main/java/org/apache/cayenne/tools/DbImportDataSourceConfig.java
+++ /dev/null
@@ -1,62 +0,0 @@
-/*****************************************************************
- * 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.
- ****************************************************************/
-
-package org.apache.cayenne.tools;
-
-/**
- * @since 4.0
- */
-public class DbImportDataSourceConfig {
-
- /**
- * A class of JDBC driver to use for the target database.
- */
- private String driver;
-
- /**
- * JDBC connection URL of a target database.
- */
- private String url;
-
- /**
- * Database user name.
- */
- private String username;
-
- /**
- * Database user password.
- */
- private String password;
-
- public String getDriver() {
- return driver;
- }
-
- public String getUrl() {
- return url;
- }
-
- public String getUsername() {
- return username;
- }
-
- public String getPassword() {
- return password;
- }
-}
http://git-wip-us.apache.org/repos/asf/cayenne/blob/2cddff91/plugins/maven-cayenne-plugin/src/main/java/org/apache/cayenne/tools/DbImporterMojo.java
----------------------------------------------------------------------
diff --git a/plugins/maven-cayenne-plugin/src/main/java/org/apache/cayenne/tools/DbImporterMojo.java b/plugins/maven-cayenne-plugin/src/main/java/org/apache/cayenne/tools/DbImporterMojo.java
deleted file mode 100644
index 9c9cddf..0000000
--- a/plugins/maven-cayenne-plugin/src/main/java/org/apache/cayenne/tools/DbImporterMojo.java
+++ /dev/null
@@ -1,211 +0,0 @@
-/*****************************************************************
- * 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.
- ****************************************************************/
-package org.apache.cayenne.tools;
-
-import org.apache.cayenne.dbimport.ReverseEngineering;
-import org.apache.cayenne.dbsync.DbSyncModule;
-import org.apache.cayenne.dbsync.reverse.filters.FiltersConfigBuilder;
-import org.apache.cayenne.di.DIBootstrap;
-import org.apache.cayenne.di.Injector;
-import org.apache.cayenne.tools.configuration.ToolsModule;
-import org.apache.cayenne.tools.dbimport.DbImportAction;
-import org.apache.cayenne.tools.dbimport.DbImportConfiguration;
-import org.apache.cayenne.tools.dbimport.DbImportModule;
-import org.apache.cayenne.util.Util;
-import org.apache.commons.logging.Log;
-import org.apache.maven.plugin.AbstractMojo;
-import org.apache.maven.plugin.MojoExecutionException;
-import org.apache.maven.plugin.MojoFailureException;
-import org.apache.maven.plugins.annotations.LifecyclePhase;
-import org.apache.maven.plugins.annotations.Mojo;
-import org.apache.maven.plugins.annotations.Parameter;
-
-import java.io.File;
-
-/**
- * Maven mojo to reverse engineer datamap from DB.
- *
- * @since 3.0
- */
-@Mojo(name = "cdbimport", defaultPhase = LifecyclePhase.GENERATE_SOURCES)
-public class DbImporterMojo extends AbstractMojo {
-
- /**
- * Java class implementing org.apache.cayenne.dba.DbAdapter. This attribute
- * is optional, the default is AutoAdapter, i.e. Cayenne would try to guess
- * the DB type.
- */
- @Parameter(defaultValue = "org.apache.cayenne.dba.AutoAdapter")
- private String adapter;
-
- /**
- * Connection properties.
- *
- * @see DbImportDataSourceConfig
- * @since 4.0
- */
- @Parameter(required = true)
- private DbImportDataSourceConfig dataSource = new DbImportDataSourceConfig();
-
- /**
- * DataMap XML file to use as a base for DB importing.
- */
- @Parameter(required = true)
- private File map;
-
- /**
- * An object that contains reverse engineering rules.
- */
- @Parameter(name = "dbimport", property = "dbimport", alias = "dbImport")
- private ReverseEngineering dbImportConfig = new ReverseEngineering();
-
- /**
- * @deprecated use {@code <dataSource>} tag to set connection properties
- */
- @Deprecated @Parameter(name = "url", property = "url")
- private final String oldUrl = ""; // TODO remove in 4.0.BETA
-
- /**
- * @deprecated moved to {@code <dbimport>} section
- */
- @Deprecated @Parameter(name = "meaningfulPkTables", property = "meaningfulPkTables")
- private final String oldMeaningfulPkTables = ""; // TODO remove in 4.0.BETA
-
- /**
- * @deprecated use {@code <dataSource>} tag to set connection properties
- */
- @Deprecated @Parameter(name = "driver", property = "driver")
- private final String oldDriver = ""; // TODO remove in 4.0.BETA
-
- /**
- * @deprecated moved to {@code <dbimport>} section
- */
- @Deprecated @Parameter(name = "defaultPackage", property = "defaultPackage")
- private final String oldDefaultPackage = ""; // TODO remove in 4.0.BETA
-
-
- public void execute() throws MojoExecutionException, MojoFailureException {
-
- Log logger = new MavenLogger(this);
-
- DbImportConfiguration config = createConfig(logger);
- Injector injector = DIBootstrap.createInjector(
- new DbSyncModule(), new ToolsModule(logger), new DbImportModule());
-
- DbImportConfigurationValidator validator = new DbImportConfigurationValidator(
- dbImportConfig, config, injector);
- try {
- validator.validate();
- } catch (Exception ex) {
- throw new MojoExecutionException(ex.getMessage(), ex);
- }
-
- try {
- injector.getInstance(DbImportAction.class).execute(config);
- } catch (Exception ex) {
- Throwable th = Util.unwindException(ex);
-
- String message = "Error importing database schema";
-
- if (th.getLocalizedMessage() != null) {
- message += ": " + th.getLocalizedMessage();
- }
-
- getLog().error(message);
- throw new MojoExecutionException(message, th);
- }
- }
-
- DbImportConfiguration createConfig(Log logger) {
-
- DbImportConfiguration config = new DbImportConfiguration();
- config.setAdapter(adapter);
- config.setDefaultPackage(dbImportConfig.getDefaultPackage());
- config.setDriver(dataSource.getDriver());
- config.setFiltersConfig(new FiltersConfigBuilder(dbImportConfig).build());
- config.setForceDataMapCatalog(dbImportConfig.isForceDataMapCatalog());
- config.setForceDataMapSchema(dbImportConfig.isForceDataMapSchema());
- config.setLogger(logger);
- config.setMeaningfulPkTables(dbImportConfig.getMeaningfulPkTables());
- config.setNamingStrategy(dbImportConfig.getNamingStrategy());
- config.setPassword(dataSource.getPassword());
- config.setSkipRelationshipsLoading(dbImportConfig.getSkipRelationshipsLoading());
- config.setSkipPrimaryKeyLoading(dbImportConfig.getSkipPrimaryKeyLoading());
- config.setStripFromTableNames(dbImportConfig.getStripFromTableNames());
- config.setTableTypes(dbImportConfig.getTableTypes());
- config.setTargetDataMap(map);
- config.setUrl(dataSource.getUrl());
- config.setUsername(dataSource.getUsername());
- config.setUsePrimitives(dbImportConfig.isUsePrimitives());
-
- return config;
- }
-
- public File getMap() {
- return map;
- }
-
- /**
- * Used only in tests, Maven will inject value directly into the "map" field
- */
- public void setMap(File map) {
- this.map = map;
- }
-
- /**
- * This setter is used by Maven when defined {@code <dbimport>} tag
- */
- public void setDbimport(ReverseEngineering dbImportConfig) {
- this.dbImportConfig = dbImportConfig;
- }
-
- /**
- * This setter is used by Maven {@code <dbImport>} tag
- */
- public void setDbImport(ReverseEngineering dbImportConfig) {
- this.dbImportConfig = dbImportConfig;
- }
-
- public ReverseEngineering getReverseEngineering() {
- return dbImportConfig;
- }
-
- // TODO \u2b07\u2b07\u2b07 All following setters should be removed in 4.0.BETA \u2b07\u2b07\u2b07
- @Deprecated
- public void setUrl(String url) {
- throw new UnsupportedOperationException("Connection properties were replaced with <dataSource> tag since 4.0.M5.\n\tFor additional information see http://cayenne.apache.org/docs/4.0/cayenne-guide/including-cayenne-in-project.html#maven-projects");
- }
-
- @Deprecated
- public void setDriver(String driver) {
- throw new UnsupportedOperationException("Connection properties were replaced with <dataSource> tag since 4.0.M5.\n\tFor additional information see http://cayenne.apache.org/docs/4.0/cayenne-guide/including-cayenne-in-project.html#maven-projects");
- }
-
- @Deprecated
- public void setMeaningfulPkTables(String meaningfulPkTables) {
- throw new UnsupportedOperationException("meaningfulPkTables property has been moved to <dbimport> tag since 4.0.M5.\n\tFor additional information see http://cayenne.apache.org/docs/4.0/cayenne-guide/including-cayenne-in-project.html#maven-projects");
- }
-
- @Deprecated
- public void setDefaultPackage(String defaultPackage) {
- throw new UnsupportedOperationException("defaultPackage property has been deprecated since 4.0.M5.\n\tFor additional information see http://cayenne.apache.org/docs/4.0/cayenne-guide/including-cayenne-in-project.html#maven-projects");
- }
-}
-
-
http://git-wip-us.apache.org/repos/asf/cayenne/blob/2cddff91/plugins/maven-cayenne-plugin/src/main/java/org/apache/cayenne/tools/MavenLogger.java
----------------------------------------------------------------------
diff --git a/plugins/maven-cayenne-plugin/src/main/java/org/apache/cayenne/tools/MavenLogger.java b/plugins/maven-cayenne-plugin/src/main/java/org/apache/cayenne/tools/MavenLogger.java
deleted file mode 100644
index c439f98..0000000
--- a/plugins/maven-cayenne-plugin/src/main/java/org/apache/cayenne/tools/MavenLogger.java
+++ /dev/null
@@ -1,105 +0,0 @@
-/*****************************************************************
- * 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.
- ****************************************************************/
-package org.apache.cayenne.tools;
-
-import org.apache.maven.plugin.AbstractMojo;
-
-/**
- * @since 3.0
- */
-class MavenLogger implements org.apache.commons.logging.Log {
-
- private org.apache.maven.plugin.logging.Log logger;
-
- public MavenLogger(AbstractMojo parent) {
- this.logger = parent.getLog();
- }
-
- public void debug(Object message, Throwable th) {
- logger.debug(String.valueOf(message), th);
- }
-
- public void debug(Object message) {
- logger.debug(String.valueOf(message));
- }
-
- public void error(Object message, Throwable th) {
- logger.error(String.valueOf(message), th);
- }
-
- public void error(Object message) {
- logger.error(String.valueOf(message));
- }
-
- public void fatal(Object message, Throwable th) {
- logger.error(String.valueOf(message), th);
- }
-
- public void fatal(Object message) {
- logger.error(String.valueOf(message));
- }
-
- public void info(Object message, Throwable th) {
- logger.info(String.valueOf(message), th);
- }
-
- public void info(Object message) {
- logger.info(String.valueOf(message));
- }
-
- public boolean isDebugEnabled() {
- return logger.isDebugEnabled();
- }
-
- public boolean isErrorEnabled() {
- return logger.isErrorEnabled();
- }
-
- public boolean isFatalEnabled() {
- return logger.isErrorEnabled();
- }
-
- public boolean isInfoEnabled() {
- return logger.isInfoEnabled();
- }
-
- public boolean isTraceEnabled() {
- return logger.isDebugEnabled();
- }
-
- public boolean isWarnEnabled() {
- return logger.isWarnEnabled();
- }
-
- public void trace(Object message, Throwable th) {
- logger.debug(String.valueOf(message), th);
- }
-
- public void trace(Object message) {
- logger.debug(String.valueOf(message));
- }
-
- public void warn(Object message, Throwable th) {
- logger.warn(String.valueOf(message), th);
- }
-
- public void warn(Object message) {
- logger.warn(String.valueOf(message));
- }
-}
http://git-wip-us.apache.org/repos/asf/cayenne/blob/2cddff91/plugins/maven-cayenne-plugin/src/main/resources/META-INF/m2e/lifecycle-mapping-metadata.xml
----------------------------------------------------------------------
diff --git a/plugins/maven-cayenne-plugin/src/main/resources/META-INF/m2e/lifecycle-mapping-metadata.xml b/plugins/maven-cayenne-plugin/src/main/resources/META-INF/m2e/lifecycle-mapping-metadata.xml
deleted file mode 100644
index e5de2d0..0000000
--- a/plugins/maven-cayenne-plugin/src/main/resources/META-INF/m2e/lifecycle-mapping-metadata.xml
+++ /dev/null
@@ -1,32 +0,0 @@
-<!--
- 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.
--->
-<lifecycleMappingMetadata>
- <pluginExecutions>
- <pluginExecution>
- <pluginExecutionFilter>
- <goals>
- <goal>cgen</goal>
- </goals>
- </pluginExecutionFilter>
- <action>
- <execute>
- <runOnIncremental>true</runOnIncremental>
- <runOnConfiguration>true</runOnConfiguration>
- </execute>
- </action>
- </pluginExecution>
- </pluginExecutions>
-</lifecycleMappingMetadata>
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/cayenne/blob/2cddff91/plugins/maven-cayenne-plugin/src/test/java/org/apache/cayenne/tools/CayenneGeneratorMojoTest.java
----------------------------------------------------------------------
diff --git a/plugins/maven-cayenne-plugin/src/test/java/org/apache/cayenne/tools/CayenneGeneratorMojoTest.java b/plugins/maven-cayenne-plugin/src/test/java/org/apache/cayenne/tools/CayenneGeneratorMojoTest.java
deleted file mode 100644
index 734e93c..0000000
--- a/plugins/maven-cayenne-plugin/src/test/java/org/apache/cayenne/tools/CayenneGeneratorMojoTest.java
+++ /dev/null
@@ -1,78 +0,0 @@
-/*****************************************************************
- * 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.
- ****************************************************************/
-package org.apache.cayenne.tools;
-
-import org.apache.commons.io.FileUtils;
-import org.apache.maven.plugin.testing.AbstractMojoTestCase;
-
-import java.io.File;
-
-public class CayenneGeneratorMojoTest extends AbstractMojoTestCase {
-
- public void testCgenExecution() throws Exception {
-
- File pom = getTestFile("src/test/resources/cgen/project-to-test/pom.xml");
- assertNotNull(pom);
- assertTrue(pom.exists());
-
- CayenneGeneratorMojo myMojo = (CayenneGeneratorMojo) lookupMojo("cgen",
- pom);
- assertNotNull(myMojo);
- myMojo.execute();
-
- File superTestEntity = new File(
- "target/cayenneGeneratedClasses/superPkg/_TestEntity.txt");
- File testEntity = new File(
- "target/cayenneGeneratedClasses/pack/TestEntity.txt");
-
- File superEmbeddable = new File(
- "target/cayenneGeneratedClasses/superPkg/_Embeddable.txt");
- File embeddable = new File(
- "target/cayenneGeneratedClasses/pack/Embeddable.txt");
-
- File superNotIncludedEntity = new File(
- "target/cayenneGeneratedClasses/pack/_NotIncludedEntity.txt");
-
- File notIncludedEntity = new File(
- "target/cayenneGeneratedClasses/pack/NotIncludedEntity.txt");
-
- File superExcludedEntity = new File(
- "target/cayenneGeneratedClasses/pack/_TestExcludedEntity.txt");
- File excludedEntity = new File(
- "target/cayenneGeneratedClasses/pack/TestExcludedEntity.txt");
-
- assertTrue(superTestEntity.exists());
- assertTrue(testEntity.exists());
-
- assertTrue(superEmbeddable.exists());
- assertTrue(embeddable.exists());
-
- assertFalse(superNotIncludedEntity.exists());
- assertFalse(notIncludedEntity.exists());
-
- assertFalse(superExcludedEntity.exists());
- assertFalse(excludedEntity.exists());
-
- String content = FileUtils.readFileToString(superTestEntity);
- assertTrue(content.contains("public static final Property<List<TestRelEntity>> ADDITIONAL_REL = Property.create(\"additionalRel\", List.class);"));
- assertTrue(content.contains("public void addToAdditionalRel(TestRelEntity obj)"));
- assertTrue(content.contains("public void removeFromAdditionalRel(TestRelEntity obj)"));
-
- }
-}
http://git-wip-us.apache.org/repos/asf/cayenne/blob/2cddff91/plugins/maven-cayenne-plugin/src/test/java/org/apache/cayenne/tools/DbImporterMojoConfigurationTest.java
----------------------------------------------------------------------
diff --git a/plugins/maven-cayenne-plugin/src/test/java/org/apache/cayenne/tools/DbImporterMojoConfigurationTest.java b/plugins/maven-cayenne-plugin/src/test/java/org/apache/cayenne/tools/DbImporterMojoConfigurationTest.java
deleted file mode 100644
index 5b871f6..0000000
--- a/plugins/maven-cayenne-plugin/src/test/java/org/apache/cayenne/tools/DbImporterMojoConfigurationTest.java
+++ /dev/null
@@ -1,125 +0,0 @@
-/*****************************************************************
- * 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.
- ****************************************************************/
-package org.apache.cayenne.tools;
-
-import org.apache.cayenne.dbimport.Catalog;
-import org.apache.cayenne.dbimport.Schema;
-import org.apache.cayenne.dbsync.reverse.filters.FiltersConfig;
-import org.apache.cayenne.dbsync.reverse.filters.IncludeTableFilter;
-import org.apache.cayenne.dbsync.reverse.filters.PatternFilter;
-import org.apache.cayenne.dbsync.reverse.filters.TableFilter;
-import org.apache.cayenne.tools.dbimport.DbImportConfiguration;
-import org.apache.commons.logging.Log;
-import org.apache.maven.plugin.testing.AbstractMojoTestCase;
-import org.junit.Test;
-
-import java.util.HashMap;
-import java.util.Map;
-import java.util.TreeSet;
-import java.util.regex.Pattern;
-
-import static org.apache.cayenne.dbimport.DefaultReverseEngineeringLoaderTest.assertCatalog;
-import static org.apache.cayenne.dbimport.DefaultReverseEngineeringLoaderTest.assertCatalogAndSchema;
-import static org.apache.cayenne.dbimport.DefaultReverseEngineeringLoaderTest.assertFlat;
-import static org.apache.cayenne.dbimport.DefaultReverseEngineeringLoaderTest.assertSchemaContent;
-import static org.apache.cayenne.dbimport.DefaultReverseEngineeringLoaderTest.assertSkipPrimaryKeyLoading;
-import static org.apache.cayenne.dbimport.DefaultReverseEngineeringLoaderTest.assertSkipRelationshipsLoading;
-import static org.apache.cayenne.dbimport.DefaultReverseEngineeringLoaderTest.assertTableTypes;
-import static org.mockito.Mockito.mock;
-
-public class DbImporterMojoConfigurationTest extends AbstractMojoTestCase {
-
- @Test
- public void testLoadCatalog() throws Exception {
- Map<String, Catalog> catalogs = new HashMap<>();
- for (Catalog c : getCdbImport("pom-catalog.xml").getReverseEngineering().getCatalogs()) {
- catalogs.put(c.getName(), c);
- }
-
- assertEquals(3, catalogs.size());
- Catalog c3 = catalogs.get("catalog-name-03");
- assertNotNull(c3);
- assertCatalog(c3);
- }
-
- @Test
- public void testLoadSchema() throws Exception {
- Map<String, Schema> schemas = new HashMap<>();
- for (Schema s : getCdbImport("pom-schema.xml").getReverseEngineering().getSchemas()) {
- schemas.put(s.getName(), s);
- }
-
- assertEquals(3, schemas.size());
- Schema s3 = schemas.get("schema-name-03");
- assertNotNull(s3);
- assertSchemaContent(s3);
- }
-
- @Test
- public void testLoadSchema2() throws Exception {
- FiltersConfig filters = getCdbImport("pom-schema-2.xml").createConfig(mock(Log.class))
- .getDbLoaderConfig().getFiltersConfig();
-
- TreeSet<IncludeTableFilter> includes = new TreeSet<>();
- includes.add(new IncludeTableFilter(null, new PatternFilter().exclude("^ETL_.*")));
-
- TreeSet<Pattern> excludes = new TreeSet<>(PatternFilter.PATTERN_COMPARATOR);
- excludes.add(PatternFilter.pattern("^ETL_.*"));
-
- assertEquals(filters.tableFilter(null, "NHL_STATS"),
- new TableFilter(includes, excludes));
- }
-
- @Test
- public void testLoadCatalogAndSchema() throws Exception {
- assertCatalogAndSchema(getCdbImport("pom-catalog-and-schema.xml").getReverseEngineering());
- }
-
- @Test
- public void testDefaultPackage() throws Exception {
- DbImportConfiguration config = getCdbImport("pom-default-package.xml").createConfig(mock(Log.class));
- assertEquals("com.example.test", config.getDefaultPackage());
- }
-
- @Test
- public void testLoadFlat() throws Exception {
- assertFlat(getCdbImport("pom-flat.xml").getReverseEngineering());
- }
-
- @Test
- public void testSkipRelationshipsLoading() throws Exception {
- assertSkipRelationshipsLoading(getCdbImport("pom-skip-relationships-loading.xml").getReverseEngineering());
- }
-
- @Test
- public void testSkipPrimaryKeyLoading() throws Exception {
- assertSkipPrimaryKeyLoading(getCdbImport("pom-skip-primary-key-loading.xml").getReverseEngineering());
- }
-
- @Test
- public void testTableTypes() throws Exception {
- assertTableTypes(getCdbImport("pom-table-types.xml").getReverseEngineering());
- }
-
- private DbImporterMojo getCdbImport(String pomFileName) throws Exception {
- return (DbImporterMojo) lookupMojo("cdbimport",
- getTestFile("src/test/resources/org/apache/cayenne/tools/config/" + pomFileName));
- }
-
-}
http://git-wip-us.apache.org/repos/asf/cayenne/blob/2cddff91/plugins/maven-cayenne-plugin/src/test/java/org/apache/cayenne/tools/DbImporterMojoTest.java
----------------------------------------------------------------------
diff --git a/plugins/maven-cayenne-plugin/src/test/java/org/apache/cayenne/tools/DbImporterMojoTest.java b/plugins/maven-cayenne-plugin/src/test/java/org/apache/cayenne/tools/DbImporterMojoTest.java
deleted file mode 100644
index 7d8cbfe..0000000
--- a/plugins/maven-cayenne-plugin/src/test/java/org/apache/cayenne/tools/DbImporterMojoTest.java
+++ /dev/null
@@ -1,431 +0,0 @@
-/*****************************************************************
- * 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.
- ****************************************************************/
-package org.apache.cayenne.tools;
-
-import org.apache.cayenne.dbimport.Catalog;
-import org.apache.cayenne.dbimport.IncludeTable;
-import org.apache.cayenne.dbimport.Schema;
-import org.apache.cayenne.test.jdbc.SQLReader;
-import org.apache.cayenne.test.resource.ResourceUtil;
-import org.apache.cayenne.tools.dbimport.DbImportConfiguration;
-import org.apache.commons.logging.Log;
-import org.apache.maven.plugin.MojoExecutionException;
-import org.apache.maven.plugin.testing.AbstractMojoTestCase;
-import org.codehaus.plexus.util.FileUtils;
-import org.custommonkey.xmlunit.DetailedDiff;
-import org.custommonkey.xmlunit.Diff;
-import org.custommonkey.xmlunit.ElementNameAndAttributeQualifier;
-import org.custommonkey.xmlunit.XMLUnit;
-import org.junit.AfterClass;
-import org.junit.BeforeClass;
-import org.junit.Ignore;
-import org.junit.Test;
-
-import java.io.File;
-import java.io.FileReader;
-import java.io.IOException;
-import java.net.URL;
-import java.sql.Connection;
-import java.sql.DriverManager;
-import java.sql.ResultSet;
-import java.sql.SQLException;
-import java.sql.Statement;
-import java.util.Iterator;
-import java.util.Objects;
-
-import static org.apache.commons.lang.StringUtils.isBlank;
-import static org.mockito.Mockito.mock;
-
-
-public class DbImporterMojoTest extends AbstractMojoTestCase {
-
- private static DerbyManager derbyAssembly;
-
- static {
- XMLUnit.setIgnoreWhitespace(true);
- }
-
- @BeforeClass
- public static void beforeClass() throws IOException, SQLException {
- derbyAssembly = new DerbyManager("target/derby");
- }
-
- @AfterClass
- public static void afterClass() throws IOException, SQLException {
- derbyAssembly.shutdown();
- derbyAssembly = null;
- }
-
- @Test
- public void testToParameters_MeaningfulPkTables() throws Exception {
-
- DbImportConfiguration parameters1 = getCdbImport("dbimporter-pom1.xml").createConfig(mock(Log.class));
- assertNull(parameters1.getMeaningfulPkTables());
- assertPathEquals("target/test/org/apache/cayenne/tools/dbimporter-map1.map.xml", parameters1.getTargetDataMap()
- .getPath());
-
- assertEquals("x,b*", getCdbImport("dbimporter-pom2.xml").createConfig(mock(Log.class)).getMeaningfulPkTables());
- assertEquals("*", getCdbImport("dbimporter-pom3.xml").createConfig(mock(Log.class)).getMeaningfulPkTables());
- }
-
- public void testToParameters_Map() throws Exception {
-
- DbImportConfiguration parameters1 = getCdbImport("dbimporter-pom1.xml").createConfig(mock(Log.class));
- assertNotNull(parameters1.getTargetDataMap());
- assertPathEquals("target/test/org/apache/cayenne/tools/dbimporter-map1.map.xml", parameters1.getTargetDataMap()
- .getPath());
-
- assertNull(getCdbImport("dbimporter-pom2.xml").createConfig(mock(Log.class)).getTargetDataMap());
- }
-
- private DbImporterMojo getCdbImport(String pomFileName) throws Exception {
- return (DbImporterMojo) lookupMojo("cdbimport",
- getTestFile("src/test/resources/org/apache/cayenne/tools/" + pomFileName));
- }
-
- private void assertPathEquals(String expectedPath, String actualPath) {
- assertEquals(new File(expectedPath), new File(actualPath));
- }
-
- @Test
- public void testImportNewDataMap() throws Exception {
- test("testImportNewDataMap");
- }
-
- @Test
- public void testImportWithoutChanges() throws Exception {
- test("testImportWithoutChanges");
- }
-
- @Test
- public void testImportAddTableAndColumn() throws Exception {
- test("testImportAddTableAndColumn");
- }
-
- @Test
- public void testFilteringWithSchema() throws Exception {
- test("testFilteringWithSchema");
- }
-
- @Test
- public void testSchemasAndTableExclude() throws Exception {
- test("testSchemasAndTableExclude");
- }
-
- @Test
- public void testViewsExclude() throws Exception {
- test("testViewsExclude");
- }
-
- @Test
- public void testTableTypes() throws Exception {
- test("testTableTypes");
- }
-
- @Test
- public void testDefaultPackage() throws Exception {
- test("testDefaultPackage");
- }
-
- @Test
- public void testSkipRelationshipsLoading() throws Exception {
- test("testSkipRelationshipsLoading");
- }
-
- @Test
- public void testSkipPrimaryKeyLoading() throws Exception {
- test("testSkipPrimaryKeyLoading");
- }
-
- @Test
- public void testOneToOne() throws Exception {
- test("testOneToOne");
- }
-
- /**
- * Q: what happens if an attribute or relationship is unmapped in the object layer, but then the underlying table
- * changes.
- * A: it should not recreate unmapped attributes/relationships. Only add an attribute for the new column.
- *
- * @throws Exception
- */
- @Test
- public void testPreserveCustomObjMappings() throws Exception {
- test("testPreserveCustomObjMappings");
- }
-
- /**
- * Q: what happens if a relationship existed over a column that was later deleted? and \u2018skipRelLoading\u2019 is true
- * A: it should remove relationship and column
- *
- * @throws Exception
- */
- @Test
- public void testPreserveRelationships() throws Exception {
- test("testPreserveRelationships");
- }
-
- /**
- * By default many-to-many are flattened during reverse engineering.
- * But if a user un-flattens a given N:M manually, we\u2019d like this choice to be preserved on the next run
- */
- @Test
- public void testUnFlattensManyToMany() throws Exception {
- // TODO: this should be "xYs" : <db-relationship name="xIes"
- test("testUnFlattensManyToMany");
- }
-
- /**
- * Make sure any merges preserve custom object layer settings, like "usePrimitives", PK mapping as attribute, etc.
- */
- @Test
- public void testCustomObjectLayerSettings() throws Exception {
- test("testCustomObjectLayerSettings");
- }
-
- @Test
- public void testDbAttributeChange() throws Exception {
- test("testDbAttributeChange");
- }
-
- @Test
- public void testForceDataMapSchema() throws Exception {
- test("testForceDataMapSchema");
- }
-
- @Test
- public void testComplexChangeOrder() throws Exception {
- test("testComplexChangeOrder");
- }
-
- /**
- * CREATE TABLE APP.A (
- * id INTEGER NOT NULL,
- * <p>
- * PRIMARY KEY (id)
- * );
- * <p>
- * CREATE TABLE APP.A_A (
- * A1_ID INTEGER NOT NULL,
- * A2_ID INTEGER NOT NULL,
- * <p>
- * PRIMARY KEY (A1_ID, A2_ID),
- * CONSTRAINT A_A1 FOREIGN KEY (A1_ID) REFERENCES APP.A (ID),
- * CONSTRAINT A_A2 FOREIGN KEY (A2_ID) REFERENCES APP.A (ID)
- * );
- * <p>
- * If one table has many-to-many relationship with it self ObjEntity should have two
- * collection attributes in both directions
- *
- * @throws Exception
- */
- @Test
- @Ignore("Investigate why on different environment entity relationships order are different.")
- public void te_stFlattensManyToManyWithRecursiveLink() throws Exception {
- test("testFlattensManyToManyWithRecursiveLink");
- }
-
- @Test
- public void testFkAttributeRename() throws Exception {
- test("testFkAttributeRename");
- }
-
- @Test
- public void testFilteringConfig() throws Exception {
- DbImporterMojo cdbImport = getCdbImport("config/pom-01.xml");
-
- assertEquals(2, cdbImport.getReverseEngineering().getCatalogs().size());
- Iterator<Catalog> iterator = cdbImport.getReverseEngineering().getCatalogs().iterator();
- assertEquals("catalog-name-01", iterator.next().getName());
-
- Catalog catalog = iterator.next();
- assertEquals("catalog-name-02", catalog.getName());
- Iterator<Schema> schemaIterator = catalog.getSchemas().iterator();
-
- assertEquals("schema-name-01", schemaIterator.next().getName());
-
- Schema schema = schemaIterator.next();
- assertEquals("schema-name-02", schema.getName());
-
- Iterator<IncludeTable> includeTableIterator = schema.getIncludeTables().iterator();
- assertEquals("incTable-01", includeTableIterator.next().getPattern());
-
- IncludeTable includeTable = includeTableIterator.next();
- assertEquals("incTable-02", includeTable.getPattern());
- assertEquals("includeColumn-01", includeTable.getIncludeColumns().iterator().next().getPattern());
- assertEquals("excludeColumn-01", includeTable.getExcludeColumns().iterator().next().getPattern());
-
- assertEquals("includeColumn-02", schema.getIncludeColumns().iterator().next().getPattern());
- assertEquals("excludeColumn-02", schema.getExcludeColumns().iterator().next().getPattern());
-
- assertEquals("includeColumn-03", catalog.getIncludeColumns().iterator().next().getPattern());
- assertEquals("excludeColumn-03", catalog.getExcludeColumns().iterator().next().getPattern());
-
- schemaIterator = cdbImport.getReverseEngineering().getSchemas().iterator();
- schema = schemaIterator.next();
- assertEquals("schema-name-03", schema.getName());
-
- schema = schemaIterator.next();
- assertEquals("schema-name-04", schema.getName());
-
- includeTableIterator = schema.getIncludeTables().iterator();
- assertEquals("incTable-04", includeTableIterator.next().getPattern());
- assertEquals("excTable-04", schema.getExcludeTables().iterator().next().getPattern());
-
- includeTable = includeTableIterator.next();
- assertEquals("incTable-05", includeTable.getPattern());
- assertEquals("includeColumn-04", includeTable.getIncludeColumns().iterator().next().getPattern());
- assertEquals("excludeColumn-04", includeTable.getExcludeColumns().iterator().next().getPattern());
-
- assertEquals("includeColumn-04", schema.getIncludeColumns().iterator().next().getPattern());
- assertEquals("excludeColumn-04", schema.getExcludeColumns().iterator().next().getPattern());
-
- assertEquals("includeColumn-03", catalog.getIncludeColumns().iterator().next().getPattern());
- assertEquals("excludeColumn-03", catalog.getExcludeColumns().iterator().next().getPattern());
- }
-
- @Test
- public void testSupportsCatalogsOnReverseEngineering() throws Exception {
- DbImporterMojo cdbImport = getCdbImport("dbimport/testSupportsCatalogsOnReverseEngineering-pom.xml");
- cdbImport.getReverseEngineering().addCatalog(new Catalog("DbImporterMojoTest2"));
-
- Exception exceptedException = null;
- String exceptedMessage = "Your database does not support catalogs on reverse engineering. " +
- "It allows to connect to only one at the moment. Please don't note catalogs in <dbimport> configuration.";
-
- try {
- cdbImport.execute();
- } catch (MojoExecutionException ex) {
- exceptedException = ex;
- }
-
- assertNotNull(exceptedException);
- assertEquals(exceptedMessage, exceptedException.getCause().getMessage());
- }
-
- private void test(String name) throws Exception {
- DbImporterMojo cdbImport = getCdbImport("dbimport/" + name + "-pom.xml");
- File mapFile = cdbImport.getMap();
- File mapFileCopy = new File(mapFile.getParentFile(), "copy-" + mapFile.getName());
- if (mapFile.exists()) {
- FileUtils.copyFile(mapFile, mapFileCopy);
- cdbImport.setMap(mapFileCopy);
- } else {
- mapFileCopy = mapFile;
- }
-
- DbImportConfiguration parameters = cdbImport.createConfig(mock(Log.class));
- prepareDatabase(name, parameters);
-
- try {
- cdbImport.execute();
- verifyResult(mapFile, mapFileCopy);
- } finally {
- cleanDb(parameters);
- }
- }
-
- private void cleanDb(DbImportConfiguration dbImportConfiguration) throws Exception {
-
- // TODO: refactor to common DB management code... E.g. bootique-jdbc-test?
- // TODO: with in-memory Derby, it is easier to just stop and delete the database.. again see bootique-jdbc-test
-
- Class.forName(dbImportConfiguration.getDriver()).newInstance();
-
- try (Connection connection = DriverManager.getConnection(dbImportConfiguration.getUrl())) {
-
- try (Statement stmt = connection.createStatement()) {
-
- try (ResultSet views = connection.getMetaData().getTables(null, null, null, new String[]{"VIEW"})) {
- while (views.next()) {
- String schema = views.getString("TABLE_SCHEM");
- execute(stmt, "DROP VIEW " + (isBlank(schema) ? "" : schema + ".") + views.getString("TABLE_NAME"));
- }
- }
-
- try (ResultSet tables = connection.getMetaData().getTables(null, null, null, new String[]{"TABLE"})) {
- while (tables.next()) {
- String schema = tables.getString("TABLE_SCHEM");
- String tableName = tables.getString("TABLE_NAME");
- String tableNameFull = (isBlank(schema) ? "" : schema + ".") + tableName;
-
- ResultSet keys = connection.getMetaData().getExportedKeys(null, schema, tableName);
- while (keys.next()) {
- String fkTableSchem = keys.getString("FKTABLE_SCHEM");
- String fkTableName = keys.getString("FKTABLE_NAME");
- String fkTableNameFull = (isBlank(fkTableSchem) ? "" : fkTableSchem + ".") + fkTableName;
- execute(stmt, "ALTER TABLE " + fkTableNameFull + " DROP CONSTRAINT " + keys.getString("FK_NAME"));
- }
-
- String sql = "DROP TABLE " + tableNameFull;
- execute(stmt, sql);
- }
- }
-
- try (ResultSet schemas = connection.getMetaData().getSchemas()) {
- while (schemas.next()) {
- String schem = schemas.getString("TABLE_SCHEM");
- if (schem.startsWith("SCHEMA")) {
- execute(stmt, "DROP SCHEMA " + schem + " RESTRICT");
- }
- }
- }
- }
- }
- }
-
- private void execute(Statement stmt, String sql) throws SQLException {
- stmt.execute(sql);
- }
-
- private void verifyResult(File map, File mapFileCopy) {
- try {
- FileReader control = new FileReader(map.getAbsolutePath() + "-result");
- FileReader test = new FileReader(mapFileCopy);
-
- Diff prototype = new Diff(control, test);
- prototype.overrideElementQualifier(new ElementNameAndAttributeQualifier());
- DetailedDiff diff = new DetailedDiff(prototype);
-
- if (!diff.similar()) {
- fail(diff.toString());
- }
- } catch (Exception e) {
- e.printStackTrace();
- fail();
- }
- }
-
- private void prepareDatabase(String sqlFile, DbImportConfiguration dbImportConfiguration) throws Exception {
-
- URL sqlUrl = Objects.requireNonNull(ResourceUtil.getResource(getClass(), "dbimport/" + sqlFile + ".sql"));
-
- // TODO: refactor to common DB management code... E.g. bootique-jdbc-test?
-
- Class.forName(dbImportConfiguration.getDriver()).newInstance();
-
- try (Connection connection = DriverManager.getConnection(dbImportConfiguration.getUrl())) {
- try (Statement stmt = connection.createStatement();) {
- for (String sql : SQLReader.statements(sqlUrl, ";")) {
- stmt.execute(sql);
- }
- }
- }
- }
-}
http://git-wip-us.apache.org/repos/asf/cayenne/blob/2cddff91/plugins/maven-cayenne-plugin/src/test/java/org/apache/cayenne/tools/DerbyManager.java
----------------------------------------------------------------------
diff --git a/plugins/maven-cayenne-plugin/src/test/java/org/apache/cayenne/tools/DerbyManager.java b/plugins/maven-cayenne-plugin/src/test/java/org/apache/cayenne/tools/DerbyManager.java
deleted file mode 100644
index 82faace..0000000
--- a/plugins/maven-cayenne-plugin/src/test/java/org/apache/cayenne/tools/DerbyManager.java
+++ /dev/null
@@ -1,63 +0,0 @@
-/*
- * 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.
- */
-package org.apache.cayenne.tools;
-
-/**
- * @since 4.0
- */
-
-import org.apache.commons.io.FileUtils;
-
-import java.io.File;
-import java.io.IOException;
-import java.io.OutputStream;
-import java.sql.DriverManager;
-import java.sql.SQLException;
-
-public class DerbyManager {
-
- public static final OutputStream DEV_NULL = new OutputStream() {
-
- @Override
- public void write(int b) {
- }
- };
-
- DerbyManager(String location) {
-
- System.setProperty("derby.stream.error.field", DerbyManager.class.getName() + ".DEV_NULL");
-
- File derbyDir = new File(location);
- if (derbyDir.isDirectory()) {
- try {
- FileUtils.deleteDirectory(derbyDir);
- } catch (IOException e) {
- throw new RuntimeException(e);
- }
- }
- }
-
- void shutdown() {
- try {
- DriverManager.getConnection("jdbc:derby:;shutdown=true");
- } catch (SQLException e) {
- // the exception is actually expected on shutdown... go figure...
- }
- }
-}
http://git-wip-us.apache.org/repos/asf/cayenne/blob/2cddff91/plugins/maven-cayenne-plugin/src/test/resources/cgen/cayenne-testDomain.xml
----------------------------------------------------------------------
diff --git a/plugins/maven-cayenne-plugin/src/test/resources/cgen/cayenne-testDomain.xml b/plugins/maven-cayenne-plugin/src/test/resources/cgen/cayenne-testDomain.xml
deleted file mode 100644
index 3f63c14..0000000
--- a/plugins/maven-cayenne-plugin/src/test/resources/cgen/cayenne-testDomain.xml
+++ /dev/null
@@ -1,5 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<domain project-version="6">
- <map name="testDomainMap"/>
- <map name="testAdditionalMap"/>
-</domain>
http://git-wip-us.apache.org/repos/asf/cayenne/blob/2cddff91/plugins/maven-cayenne-plugin/src/test/resources/cgen/project-to-test/pom.xml
----------------------------------------------------------------------
diff --git a/plugins/maven-cayenne-plugin/src/test/resources/cgen/project-to-test/pom.xml b/plugins/maven-cayenne-plugin/src/test/resources/cgen/project-to-test/pom.xml
deleted file mode 100644
index 41d545c..0000000
--- a/plugins/maven-cayenne-plugin/src/test/resources/cgen/project-to-test/pom.xml
+++ /dev/null
@@ -1,56 +0,0 @@
-<?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>Test CayenneGeneratorMojo</name>
-
- <dependencies>
- <dependency>
- <groupId>junit</groupId>
- <artifactId>junit</artifactId>
- <scope>test</scope>
- </dependency>
- </dependencies>
-
- <build>
- <plugins>
- <plugin>
- <artifactId>maven-cayenne-plugin</artifactId>
- <configuration>
- <map>src/test/resources/cgen/testDomainMap.map.xml</map>
- <destDir>target/cayenneGeneratedClasses</destDir>
- <additionalMaps>src/test/resources/cgen/</additionalMaps>
- <outputPattern>*.txt</outputPattern>
- <makePairs>true</makePairs>
- <usePkgPath>true</usePkgPath>
- <superPkg>superPkg</superPkg>
- <encoding>UTF-8</encoding>
- <includeEntities>Test*</includeEntities>
- <excludeEntities>TestExcludedEntity</excludeEntities>
- <mode>all</mode>
- </configuration>
- </plugin>
- </plugins>
- </build>
-
-</project>
http://git-wip-us.apache.org/repos/asf/cayenne/blob/2cddff91/plugins/maven-cayenne-plugin/src/test/resources/cgen/testAdditionalMap.map.xml
----------------------------------------------------------------------
diff --git a/plugins/maven-cayenne-plugin/src/test/resources/cgen/testAdditionalMap.map.xml b/plugins/maven-cayenne-plugin/src/test/resources/cgen/testAdditionalMap.map.xml
deleted file mode 100644
index f9a80fb..0000000
--- a/plugins/maven-cayenne-plugin/src/test/resources/cgen/testAdditionalMap.map.xml
+++ /dev/null
@@ -1,18 +0,0 @@
-<?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/2cddff91/plugins/maven-cayenne-plugin/src/test/resources/cgen/testDomainMap.map.xml
----------------------------------------------------------------------
diff --git a/plugins/maven-cayenne-plugin/src/test/resources/cgen/testDomainMap.map.xml b/plugins/maven-cayenne-plugin/src/test/resources/cgen/testDomainMap.map.xml
deleted file mode 100644
index d0ff3f5..0000000
--- a/plugins/maven-cayenne-plugin/src/test/resources/cgen/testDomainMap.map.xml
+++ /dev/null
@@ -1,45 +0,0 @@
-<?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/2cddff91/plugins/maven-cayenne-plugin/src/test/resources/org/apache/cayenne/tools/config/pom-01.xml
----------------------------------------------------------------------
diff --git a/plugins/maven-cayenne-plugin/src/test/resources/org/apache/cayenne/tools/config/pom-01.xml b/plugins/maven-cayenne-plugin/src/test/resources/org/apache/cayenne/tools/config/pom-01.xml
deleted file mode 100644
index a4a6955..0000000
--- a/plugins/maven-cayenne-plugin/src/test/resources/org/apache/cayenne/tools/config/pom-01.xml
+++ /dev/null
@@ -1,99 +0,0 @@
-<?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>maven-cayenne-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/2cddff91/plugins/maven-cayenne-plugin/src/test/resources/org/apache/cayenne/tools/config/pom-catalog-and-schema.xml
----------------------------------------------------------------------
diff --git a/plugins/maven-cayenne-plugin/src/test/resources/org/apache/cayenne/tools/config/pom-catalog-and-schema.xml b/plugins/maven-cayenne-plugin/src/test/resources/org/apache/cayenne/tools/config/pom-catalog-and-schema.xml
deleted file mode 100644
index d3828ce..0000000
--- a/plugins/maven-cayenne-plugin/src/test/resources/org/apache/cayenne/tools/config/pom-catalog-and-schema.xml
+++ /dev/null
@@ -1,84 +0,0 @@
-<?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>maven-cayenne-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/2cddff91/plugins/maven-cayenne-plugin/src/test/resources/org/apache/cayenne/tools/config/pom-catalog.xml
----------------------------------------------------------------------
diff --git a/plugins/maven-cayenne-plugin/src/test/resources/org/apache/cayenne/tools/config/pom-catalog.xml b/plugins/maven-cayenne-plugin/src/test/resources/org/apache/cayenne/tools/config/pom-catalog.xml
deleted file mode 100644
index 9c919e8..0000000
--- a/plugins/maven-cayenne-plugin/src/test/resources/org/apache/cayenne/tools/config/pom-catalog.xml
+++ /dev/null
@@ -1,87 +0,0 @@
-<?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>maven-cayenne-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/2cddff91/plugins/maven-cayenne-plugin/src/test/resources/org/apache/cayenne/tools/config/pom-default-package.xml
----------------------------------------------------------------------
diff --git a/plugins/maven-cayenne-plugin/src/test/resources/org/apache/cayenne/tools/config/pom-default-package.xml b/plugins/maven-cayenne-plugin/src/test/resources/org/apache/cayenne/tools/config/pom-default-package.xml
deleted file mode 100644
index 7f09b88..0000000
--- a/plugins/maven-cayenne-plugin/src/test/resources/org/apache/cayenne/tools/config/pom-default-package.xml
+++ /dev/null
@@ -1,38 +0,0 @@
-<?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>maven-cayenne-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/2cddff91/plugins/maven-cayenne-plugin/src/test/resources/org/apache/cayenne/tools/config/pom-flat.xml
----------------------------------------------------------------------
diff --git a/plugins/maven-cayenne-plugin/src/test/resources/org/apache/cayenne/tools/config/pom-flat.xml b/plugins/maven-cayenne-plugin/src/test/resources/org/apache/cayenne/tools/config/pom-flat.xml
deleted file mode 100644
index 6987454..0000000
--- a/plugins/maven-cayenne-plugin/src/test/resources/org/apache/cayenne/tools/config/pom-flat.xml
+++ /dev/null
@@ -1,78 +0,0 @@
-<?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>maven-cayenne-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/2cddff91/plugins/maven-cayenne-plugin/src/test/resources/org/apache/cayenne/tools/config/pom-mapping.xml
----------------------------------------------------------------------
diff --git a/plugins/maven-cayenne-plugin/src/test/resources/org/apache/cayenne/tools/config/pom-mapping.xml b/plugins/maven-cayenne-plugin/src/test/resources/org/apache/cayenne/tools/config/pom-mapping.xml
deleted file mode 100644
index 10c99da..0000000
--- a/plugins/maven-cayenne-plugin/src/test/resources/org/apache/cayenne/tools/config/pom-mapping.xml
+++ /dev/null
@@ -1,67 +0,0 @@
-<?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>maven-cayenne-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/2cddff91/plugins/maven-cayenne-plugin/src/test/resources/org/apache/cayenne/tools/config/pom-schema-2.xml
----------------------------------------------------------------------
diff --git a/plugins/maven-cayenne-plugin/src/test/resources/org/apache/cayenne/tools/config/pom-schema-2.xml b/plugins/maven-cayenne-plugin/src/test/resources/org/apache/cayenne/tools/config/pom-schema-2.xml
deleted file mode 100644
index 05342fd..0000000
--- a/plugins/maven-cayenne-plugin/src/test/resources/org/apache/cayenne/tools/config/pom-schema-2.xml
+++ /dev/null
@@ -1,41 +0,0 @@
-<?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>maven-cayenne-plugin</artifactId>
- <configuration>
- <dbimport>
- <schema>
- <name>NHL_STATS</name>
- <excludeTable>^ETL_.*</excludeTable>
- <excludeColumn>^ETL_.*</excludeColumn>
- </schema>
- </dbimport>
- </configuration>
- </plugin>
- </plugins>
- </build>
-
-</project>
[3/8] cayenne git commit: CAY-2214 cdbimport: rename
maven-cayenne-plugin - change module and folder name to
"cayenne-maven-plugin" - artifactId still is "maven-cayenne-plugin"
Posted by nt...@apache.org.
http://git-wip-us.apache.org/repos/asf/cayenne/blob/2cddff91/plugins/maven-cayenne-plugin/src/test/resources/org/apache/cayenne/tools/config/pom-schema.xml
----------------------------------------------------------------------
diff --git a/plugins/maven-cayenne-plugin/src/test/resources/org/apache/cayenne/tools/config/pom-schema.xml b/plugins/maven-cayenne-plugin/src/test/resources/org/apache/cayenne/tools/config/pom-schema.xml
deleted file mode 100644
index 11804fc..0000000
--- a/plugins/maven-cayenne-plugin/src/test/resources/org/apache/cayenne/tools/config/pom-schema.xml
+++ /dev/null
@@ -1,87 +0,0 @@
-<?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>maven-cayenne-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/2cddff91/plugins/maven-cayenne-plugin/src/test/resources/org/apache/cayenne/tools/config/pom-skip-primary-key-loading.xml
----------------------------------------------------------------------
diff --git a/plugins/maven-cayenne-plugin/src/test/resources/org/apache/cayenne/tools/config/pom-skip-primary-key-loading.xml b/plugins/maven-cayenne-plugin/src/test/resources/org/apache/cayenne/tools/config/pom-skip-primary-key-loading.xml
deleted file mode 100644
index 2c3e6c5..0000000
--- a/plugins/maven-cayenne-plugin/src/test/resources/org/apache/cayenne/tools/config/pom-skip-primary-key-loading.xml
+++ /dev/null
@@ -1,39 +0,0 @@
-<?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>maven-cayenne-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/2cddff91/plugins/maven-cayenne-plugin/src/test/resources/org/apache/cayenne/tools/config/pom-skip-relationships-loading.xml
----------------------------------------------------------------------
diff --git a/plugins/maven-cayenne-plugin/src/test/resources/org/apache/cayenne/tools/config/pom-skip-relationships-loading.xml b/plugins/maven-cayenne-plugin/src/test/resources/org/apache/cayenne/tools/config/pom-skip-relationships-loading.xml
deleted file mode 100644
index 9291871..0000000
--- a/plugins/maven-cayenne-plugin/src/test/resources/org/apache/cayenne/tools/config/pom-skip-relationships-loading.xml
+++ /dev/null
@@ -1,39 +0,0 @@
-<?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>maven-cayenne-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/2cddff91/plugins/maven-cayenne-plugin/src/test/resources/org/apache/cayenne/tools/config/pom-table-types.xml
----------------------------------------------------------------------
diff --git a/plugins/maven-cayenne-plugin/src/test/resources/org/apache/cayenne/tools/config/pom-table-types.xml b/plugins/maven-cayenne-plugin/src/test/resources/org/apache/cayenne/tools/config/pom-table-types.xml
deleted file mode 100644
index b8d3ad3..0000000
--- a/plugins/maven-cayenne-plugin/src/test/resources/org/apache/cayenne/tools/config/pom-table-types.xml
+++ /dev/null
@@ -1,41 +0,0 @@
-<?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>maven-cayenne-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/2cddff91/plugins/maven-cayenne-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testComplexChangeOrder-pom.xml
----------------------------------------------------------------------
diff --git a/plugins/maven-cayenne-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testComplexChangeOrder-pom.xml b/plugins/maven-cayenne-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testComplexChangeOrder-pom.xml
deleted file mode 100644
index 6e09d8a..0000000
--- a/plugins/maven-cayenne-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testComplexChangeOrder-pom.xml
+++ /dev/null
@@ -1,44 +0,0 @@
-<?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>maven-cayenne-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/2cddff91/plugins/maven-cayenne-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testComplexChangeOrder.map.xml
----------------------------------------------------------------------
diff --git a/plugins/maven-cayenne-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testComplexChangeOrder.map.xml b/plugins/maven-cayenne-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testComplexChangeOrder.map.xml
deleted file mode 100644
index 20ccc69..0000000
--- a/plugins/maven-cayenne-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testComplexChangeOrder.map.xml
+++ /dev/null
@@ -1,64 +0,0 @@
-<?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/2cddff91/plugins/maven-cayenne-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testComplexChangeOrder.map.xml-result
----------------------------------------------------------------------
diff --git a/plugins/maven-cayenne-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testComplexChangeOrder.map.xml-result b/plugins/maven-cayenne-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testComplexChangeOrder.map.xml-result
deleted file mode 100644
index d68faf1..0000000
--- a/plugins/maven-cayenne-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testComplexChangeOrder.map.xml-result
+++ /dev/null
@@ -1,53 +0,0 @@
-<?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/2cddff91/plugins/maven-cayenne-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testComplexChangeOrder.sql
----------------------------------------------------------------------
diff --git a/plugins/maven-cayenne-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testComplexChangeOrder.sql b/plugins/maven-cayenne-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testComplexChangeOrder.sql
deleted file mode 100644
index 9885bc7..0000000
--- a/plugins/maven-cayenne-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testComplexChangeOrder.sql
+++ /dev/null
@@ -1,34 +0,0 @@
--- 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/2cddff91/plugins/maven-cayenne-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testCustomObjectLayerSettings-pom.xml
----------------------------------------------------------------------
diff --git a/plugins/maven-cayenne-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testCustomObjectLayerSettings-pom.xml b/plugins/maven-cayenne-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testCustomObjectLayerSettings-pom.xml
deleted file mode 100644
index 8d31eaf..0000000
--- a/plugins/maven-cayenne-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testCustomObjectLayerSettings-pom.xml
+++ /dev/null
@@ -1,51 +0,0 @@
-<?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>maven-cayenne-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/2cddff91/plugins/maven-cayenne-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testCustomObjectLayerSettings.map.xml
----------------------------------------------------------------------
diff --git a/plugins/maven-cayenne-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testCustomObjectLayerSettings.map.xml b/plugins/maven-cayenne-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testCustomObjectLayerSettings.map.xml
deleted file mode 100644
index acbc62c..0000000
--- a/plugins/maven-cayenne-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testCustomObjectLayerSettings.map.xml
+++ /dev/null
@@ -1,30 +0,0 @@
-<?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/2cddff91/plugins/maven-cayenne-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testCustomObjectLayerSettings.map.xml-result
----------------------------------------------------------------------
diff --git a/plugins/maven-cayenne-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testCustomObjectLayerSettings.map.xml-result b/plugins/maven-cayenne-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testCustomObjectLayerSettings.map.xml-result
deleted file mode 100644
index 9f36c0f..0000000
--- a/plugins/maven-cayenne-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testCustomObjectLayerSettings.map.xml-result
+++ /dev/null
@@ -1,46 +0,0 @@
-<?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/2cddff91/plugins/maven-cayenne-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testCustomObjectLayerSettings.sql
----------------------------------------------------------------------
diff --git a/plugins/maven-cayenne-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testCustomObjectLayerSettings.sql b/plugins/maven-cayenne-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testCustomObjectLayerSettings.sql
deleted file mode 100644
index fe9ccd5..0000000
--- a/plugins/maven-cayenne-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testCustomObjectLayerSettings.sql
+++ /dev/null
@@ -1,36 +0,0 @@
--- 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/2cddff91/plugins/maven-cayenne-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testDbAttributeChange-pom.xml
----------------------------------------------------------------------
diff --git a/plugins/maven-cayenne-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testDbAttributeChange-pom.xml b/plugins/maven-cayenne-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testDbAttributeChange-pom.xml
deleted file mode 100644
index ad0f98f..0000000
--- a/plugins/maven-cayenne-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testDbAttributeChange-pom.xml
+++ /dev/null
@@ -1,47 +0,0 @@
-<?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>maven-cayenne-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/2cddff91/plugins/maven-cayenne-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testDbAttributeChange.map.xml
----------------------------------------------------------------------
diff --git a/plugins/maven-cayenne-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testDbAttributeChange.map.xml b/plugins/maven-cayenne-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testDbAttributeChange.map.xml
deleted file mode 100644
index 759090a..0000000
--- a/plugins/maven-cayenne-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testDbAttributeChange.map.xml
+++ /dev/null
@@ -1,62 +0,0 @@
-<?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/2cddff91/plugins/maven-cayenne-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testDbAttributeChange.map.xml-result
----------------------------------------------------------------------
diff --git a/plugins/maven-cayenne-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testDbAttributeChange.map.xml-result b/plugins/maven-cayenne-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testDbAttributeChange.map.xml-result
deleted file mode 100644
index c53bde2..0000000
--- a/plugins/maven-cayenne-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testDbAttributeChange.map.xml-result
+++ /dev/null
@@ -1,62 +0,0 @@
-<?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/2cddff91/plugins/maven-cayenne-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testDbAttributeChange.sql
----------------------------------------------------------------------
diff --git a/plugins/maven-cayenne-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testDbAttributeChange.sql b/plugins/maven-cayenne-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testDbAttributeChange.sql
deleted file mode 100644
index c93c802..0000000
--- a/plugins/maven-cayenne-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testDbAttributeChange.sql
+++ /dev/null
@@ -1,46 +0,0 @@
--- 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/2cddff91/plugins/maven-cayenne-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testDefaultPackage-pom.xml
----------------------------------------------------------------------
diff --git a/plugins/maven-cayenne-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testDefaultPackage-pom.xml b/plugins/maven-cayenne-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testDefaultPackage-pom.xml
deleted file mode 100644
index 2a6828f..0000000
--- a/plugins/maven-cayenne-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testDefaultPackage-pom.xml
+++ /dev/null
@@ -1,47 +0,0 @@
-<?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>maven-cayenne-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/2cddff91/plugins/maven-cayenne-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testDefaultPackage.map.xml-result
----------------------------------------------------------------------
diff --git a/plugins/maven-cayenne-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testDefaultPackage.map.xml-result b/plugins/maven-cayenne-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testDefaultPackage.map.xml-result
deleted file mode 100644
index 5373617..0000000
--- a/plugins/maven-cayenne-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testDefaultPackage.map.xml-result
+++ /dev/null
@@ -1,52 +0,0 @@
-<?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/2cddff91/plugins/maven-cayenne-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testDefaultPackage.sql
----------------------------------------------------------------------
diff --git a/plugins/maven-cayenne-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testDefaultPackage.sql b/plugins/maven-cayenne-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testDefaultPackage.sql
deleted file mode 100644
index 279065c..0000000
--- a/plugins/maven-cayenne-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testDefaultPackage.sql
+++ /dev/null
@@ -1,40 +0,0 @@
--- 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)
-);
http://git-wip-us.apache.org/repos/asf/cayenne/blob/2cddff91/plugins/maven-cayenne-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testFilteringWithSchema-pom.xml
----------------------------------------------------------------------
diff --git a/plugins/maven-cayenne-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testFilteringWithSchema-pom.xml b/plugins/maven-cayenne-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testFilteringWithSchema-pom.xml
deleted file mode 100644
index de84543..0000000
--- a/plugins/maven-cayenne-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testFilteringWithSchema-pom.xml
+++ /dev/null
@@ -1,45 +0,0 @@
-<?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>maven-cayenne-plugin</artifactId>
- <configuration>
- <map>target/test-classes/org/apache/cayenne/tools/dbimport/testFilteringWithSchema.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/2cddff91/plugins/maven-cayenne-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testFilteringWithSchema.map.xml-result
----------------------------------------------------------------------
diff --git a/plugins/maven-cayenne-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testFilteringWithSchema.map.xml-result b/plugins/maven-cayenne-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testFilteringWithSchema.map.xml-result
deleted file mode 100644
index a65e271..0000000
--- a/plugins/maven-cayenne-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testFilteringWithSchema.map.xml-result
+++ /dev/null
@@ -1,51 +0,0 @@
-<?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="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="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>
-</data-map>
http://git-wip-us.apache.org/repos/asf/cayenne/blob/2cddff91/plugins/maven-cayenne-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testFilteringWithSchema.sql
----------------------------------------------------------------------
diff --git a/plugins/maven-cayenne-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testFilteringWithSchema.sql b/plugins/maven-cayenne-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testFilteringWithSchema.sql
deleted file mode 100644
index dba8da6..0000000
--- a/plugins/maven-cayenne-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testFilteringWithSchema.sql
+++ /dev/null
@@ -1,64 +0,0 @@
--- 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)
-);
-
-CREATE SCHEMA schema_02;
-SET SCHEMA schema_02;
-
-CREATE TABLE schema_02.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_02.Child (
- id INTEGER NOT NULL,
- Parent_id CHAR(25),
- COL3 DECIMAL(10,2),
- COL4 VARCHAR(25),
- COL5 DATE,
-
- PRIMARY KEY (id)
-);
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/cayenne/blob/2cddff91/plugins/maven-cayenne-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testFkAttributeRename-pom.xml
----------------------------------------------------------------------
diff --git a/plugins/maven-cayenne-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testFkAttributeRename-pom.xml b/plugins/maven-cayenne-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testFkAttributeRename-pom.xml
deleted file mode 100644
index dd50897..0000000
--- a/plugins/maven-cayenne-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testFkAttributeRename-pom.xml
+++ /dev/null
@@ -1,49 +0,0 @@
-<?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>maven-cayenne-plugin</artifactId>
- <configuration>
- <map>target/test-classes/org/apache/cayenne/tools/dbimport/testFkAttributeRename.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/2cddff91/plugins/maven-cayenne-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testFkAttributeRename.map.xml
----------------------------------------------------------------------
diff --git a/plugins/maven-cayenne-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testFkAttributeRename.map.xml b/plugins/maven-cayenne-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testFkAttributeRename.map.xml
deleted file mode 100644
index 948e121..0000000
--- a/plugins/maven-cayenne-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testFkAttributeRename.map.xml
+++ /dev/null
@@ -1,44 +0,0 @@
-<?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="id" type="INTEGER" length="10"/>
- <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="Child" className="Child" dbEntityName="CHILD">
- </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>
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/cayenne/blob/2cddff91/plugins/maven-cayenne-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testFkAttributeRename.map.xml-result
----------------------------------------------------------------------
diff --git a/plugins/maven-cayenne-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testFkAttributeRename.map.xml-result b/plugins/maven-cayenne-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testFkAttributeRename.map.xml-result
deleted file mode 100644
index d10b90d..0000000
--- a/plugins/maven-cayenne-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testFkAttributeRename.map.xml-result
+++ /dev/null
@@ -1,45 +0,0 @@
-<?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="PAR" type="INTEGER" length="10"/>
- <db-attribute name="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="Child" className="Child" dbEntityName="CHILD">
- </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="PAR" target="id"/>
- </db-relationship>
- <db-relationship name="children" source="PARENT" target="CHILD" toMany="true">
- <db-attribute-pair source="id" target="PAR"/>
- </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/2cddff91/plugins/maven-cayenne-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testFkAttributeRename.sql
----------------------------------------------------------------------
diff --git a/plugins/maven-cayenne-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testFkAttributeRename.sql b/plugins/maven-cayenne-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testFkAttributeRename.sql
deleted file mode 100644
index 07a65a9..0000000
--- a/plugins/maven-cayenne-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testFkAttributeRename.sql
+++ /dev/null
@@ -1,33 +0,0 @@
--- 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,
- PRIMARY KEY (id)
-);
-
-CREATE TABLE schema_01.child (
- id INTEGER,
- par INTEGER
-);
-
-ALTER TABLE schema_01.child
- ADD FOREIGN KEY (par)
- REFERENCES schema_01.parent (id);
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/cayenne/blob/2cddff91/plugins/maven-cayenne-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testFlattensManyToManyWithRecursiveLink-pom.xml
----------------------------------------------------------------------
diff --git a/plugins/maven-cayenne-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testFlattensManyToManyWithRecursiveLink-pom.xml b/plugins/maven-cayenne-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testFlattensManyToManyWithRecursiveLink-pom.xml
deleted file mode 100644
index 1bcefa6..0000000
--- a/plugins/maven-cayenne-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testFlattensManyToManyWithRecursiveLink-pom.xml
+++ /dev/null
@@ -1,44 +0,0 @@
-<?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>maven-cayenne-plugin</artifactId>
- <configuration>
- <map>target/test-classes/org/apache/cayenne/tools/dbimport/testFlattensManyToManyWithRecursiveLink.map.xml</map>
- <dataSource>
- <driver>org.apache.derby.jdbc.EmbeddedDriver</driver>
- <url>jdbc:derby:memory:DbImporterMojoTest;create=true</url>
- </dataSource>
- <dbimport>
- <defaultPackage>org.not.my.home</defaultPackage>
- </dbimport>
- </configuration>
- </plugin>
- </plugins>
- </build>
-
-</project>
http://git-wip-us.apache.org/repos/asf/cayenne/blob/2cddff91/plugins/maven-cayenne-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testFlattensManyToManyWithRecursiveLink.map.xml-result
----------------------------------------------------------------------
diff --git a/plugins/maven-cayenne-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testFlattensManyToManyWithRecursiveLink.map.xml-result b/plugins/maven-cayenne-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testFlattensManyToManyWithRecursiveLink.map.xml-result
deleted file mode 100644
index 8263273..0000000
--- a/plugins/maven-cayenne-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testFlattensManyToManyWithRecursiveLink.map.xml-result
+++ /dev/null
@@ -1,48 +0,0 @@
-<?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="org.not.my.home"/>
- <db-entity name="A" schema="APP">
- <db-attribute name="ID" type="INTEGER" isPrimaryKey="true" isMandatory="true" length="10"/>
- </db-entity>
- <db-entity name="A_A" schema="APP">
- <db-attribute name="A1_ID" type="INTEGER" isPrimaryKey="true" isMandatory="true" length="10"/>
- <db-attribute name="A2_ID" type="INTEGER" isPrimaryKey="true" isMandatory="true" length="10"/>
- </db-entity>
- <obj-entity name="A" className="org.not.my.home.A" dbEntityName="A">
- </obj-entity>
- <db-relationship name="aAArray" source="A" target="A_A" toDependentPK="true" toMany="true">
- <db-attribute-pair source="ID" target="A1_ID"/>
- </db-relationship>
- <db-relationship name="aAArray1" source="A" target="A_A" toDependentPK="true" toMany="true">
- <db-attribute-pair source="ID" target="A2_ID"/>
- </db-relationship>
- <db-relationship name="toA" source="A_A" target="A" toMany="false">
- <db-attribute-pair source="A1_ID" target="ID"/>
- </db-relationship>
- <db-relationship name="toA1" source="A_A" target="A" toMany="false">
- <db-attribute-pair source="A2_ID" target="ID"/>
- </db-relationship>
- <obj-relationship name="aArray" source="A" target="A" db-relationship-path="aAArray.toA1"/>
- <obj-relationship name="aArray1" source="A" target="A" db-relationship-path="aAArray1.toA"/>
-</data-map>
http://git-wip-us.apache.org/repos/asf/cayenne/blob/2cddff91/plugins/maven-cayenne-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testFlattensManyToManyWithRecursiveLink.sql
----------------------------------------------------------------------
diff --git a/plugins/maven-cayenne-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testFlattensManyToManyWithRecursiveLink.sql b/plugins/maven-cayenne-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testFlattensManyToManyWithRecursiveLink.sql
deleted file mode 100644
index 9df54ab..0000000
--- a/plugins/maven-cayenne-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testFlattensManyToManyWithRecursiveLink.sql
+++ /dev/null
@@ -1,31 +0,0 @@
--- 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 TABLE APP.A (
- id INTEGER NOT NULL,
-
- PRIMARY KEY (id)
-);
-
-CREATE TABLE APP.A_A (
- A1_ID INTEGER NOT NULL,
- A2_ID INTEGER NOT NULL,
-
- PRIMARY KEY (A1_ID, A2_ID),
- CONSTRAINT A_A1 FOREIGN KEY (A1_ID) REFERENCES APP.A (ID),
- CONSTRAINT A_A2 FOREIGN KEY (A2_ID) REFERENCES APP.A (ID)
-);
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/cayenne/blob/2cddff91/plugins/maven-cayenne-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testForceDataMapSchema-pom.xml
----------------------------------------------------------------------
diff --git a/plugins/maven-cayenne-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testForceDataMapSchema-pom.xml b/plugins/maven-cayenne-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testForceDataMapSchema-pom.xml
deleted file mode 100644
index e1bbd50..0000000
--- a/plugins/maven-cayenne-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testForceDataMapSchema-pom.xml
+++ /dev/null
@@ -1,50 +0,0 @@
-<?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>maven-cayenne-plugin</artifactId>
- <configuration>
- <map>target/test-classes/org/apache/cayenne/tools/dbimport/testForceDataMapSchema.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>
- <forceDataMapCatalog>true</forceDataMapCatalog>
- <forceDataMapSchema>true</forceDataMapSchema>
-
- <schema>SCHEMA_01</schema>
- </dbimport>
- </configuration>
- </plugin>
- </plugins>
- </build>
-
-</project>
http://git-wip-us.apache.org/repos/asf/cayenne/blob/2cddff91/plugins/maven-cayenne-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testForceDataMapSchema.map.xml
----------------------------------------------------------------------
diff --git a/plugins/maven-cayenne-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testForceDataMapSchema.map.xml b/plugins/maven-cayenne-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testForceDataMapSchema.map.xml
deleted file mode 100644
index 1d9dea0..0000000
--- a/plugins/maven-cayenne-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testForceDataMapSchema.map.xml
+++ /dev/null
@@ -1,26 +0,0 @@
-<?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="defaultCatalog" value="XCATALOG"/>
-</data-map>
[8/8] cayenne git commit: CAY-2214 cdbimport: rename
maven-cayenne-plugin - change module and folder name to
"cayenne-maven-plugin" - artifactId still is "maven-cayenne-plugin"
Posted by nt...@apache.org.
CAY-2214 cdbimport: rename maven-cayenne-plugin
- change module and folder name to "cayenne-maven-plugin"
- artifactId still is "maven-cayenne-plugin"
Project: http://git-wip-us.apache.org/repos/asf/cayenne/repo
Commit: http://git-wip-us.apache.org/repos/asf/cayenne/commit/2cddff91
Tree: http://git-wip-us.apache.org/repos/asf/cayenne/tree/2cddff91
Diff: http://git-wip-us.apache.org/repos/asf/cayenne/diff/2cddff91
Branch: refs/heads/master
Commit: 2cddff91a9ec6d86a9de510a46118780e2131846
Parents: a148a28
Author: Nikita Timofeev <st...@gmail.com>
Authored: Tue Jan 31 10:35:33 2017 +0300
Committer: Nikita Timofeev <st...@gmail.com>
Committed: Tue Jan 31 10:35:33 2017 +0300
----------------------------------------------------------------------
plugins/cayenne-maven-plugin/pom.xml | 186 ++++++++
.../cayenne/tools/CayenneGeneratorMojo.java | 293 +++++++++++++
.../apache/cayenne/tools/DbGeneratorMojo.java | 192 +++++++++
.../cayenne/tools/DbImportDataSourceConfig.java | 62 +++
.../apache/cayenne/tools/DbImporterMojo.java | 211 +++++++++
.../org/apache/cayenne/tools/MavenLogger.java | 105 +++++
.../META-INF/m2e/lifecycle-mapping-metadata.xml | 32 ++
.../cayenne/tools/CayenneGeneratorMojoTest.java | 78 ++++
.../tools/DbImporterMojoConfigurationTest.java | 125 ++++++
.../cayenne/tools/DbImporterMojoTest.java | 431 +++++++++++++++++++
.../org/apache/cayenne/tools/DerbyManager.java | 63 +++
.../test/resources/cgen/cayenne-testDomain.xml | 5 +
.../test/resources/cgen/project-to-test/pom.xml | 56 +++
.../resources/cgen/testAdditionalMap.map.xml | 18 +
.../test/resources/cgen/testDomainMap.map.xml | 45 ++
.../org/apache/cayenne/tools/config/pom-01.xml | 99 +++++
.../tools/config/pom-catalog-and-schema.xml | 84 ++++
.../apache/cayenne/tools/config/pom-catalog.xml | 87 ++++
.../tools/config/pom-default-package.xml | 38 ++
.../apache/cayenne/tools/config/pom-flat.xml | 78 ++++
.../apache/cayenne/tools/config/pom-mapping.xml | 67 +++
.../cayenne/tools/config/pom-schema-2.xml | 41 ++
.../apache/cayenne/tools/config/pom-schema.xml | 87 ++++
.../config/pom-skip-primary-key-loading.xml | 39 ++
.../config/pom-skip-relationships-loading.xml | 39 ++
.../cayenne/tools/config/pom-table-types.xml | 41 ++
.../dbimport/testComplexChangeOrder-pom.xml | 44 ++
.../dbimport/testComplexChangeOrder.map.xml | 64 +++
.../testComplexChangeOrder.map.xml-result | 53 +++
.../tools/dbimport/testComplexChangeOrder.sql | 34 ++
.../testCustomObjectLayerSettings-pom.xml | 51 +++
.../testCustomObjectLayerSettings.map.xml | 30 ++
...testCustomObjectLayerSettings.map.xml-result | 46 ++
.../dbimport/testCustomObjectLayerSettings.sql | 36 ++
.../dbimport/testDbAttributeChange-pom.xml | 47 ++
.../dbimport/testDbAttributeChange.map.xml | 62 +++
.../testDbAttributeChange.map.xml-result | 62 +++
.../tools/dbimport/testDbAttributeChange.sql | 46 ++
.../tools/dbimport/testDefaultPackage-pom.xml | 47 ++
.../dbimport/testDefaultPackage.map.xml-result | 52 +++
.../tools/dbimport/testDefaultPackage.sql | 40 ++
.../dbimport/testFilteringWithSchema-pom.xml | 45 ++
.../testFilteringWithSchema.map.xml-result | 51 +++
.../tools/dbimport/testFilteringWithSchema.sql | 64 +++
.../dbimport/testFkAttributeRename-pom.xml | 49 +++
.../dbimport/testFkAttributeRename.map.xml | 44 ++
.../testFkAttributeRename.map.xml-result | 45 ++
.../tools/dbimport/testFkAttributeRename.sql | 33 ++
...tFlattensManyToManyWithRecursiveLink-pom.xml | 44 ++
...nsManyToManyWithRecursiveLink.map.xml-result | 48 +++
.../testFlattensManyToManyWithRecursiveLink.sql | 31 ++
.../dbimport/testForceDataMapSchema-pom.xml | 50 +++
.../dbimport/testForceDataMapSchema.map.xml | 26 ++
.../testForceDataMapSchema.map.xml-result | 52 +++
.../tools/dbimport/testForceDataMapSchema.sql | 40 ++
.../testImportAddTableAndColumn-pom.xml | 41 ++
.../testImportAddTableAndColumn.map.xml | 37 ++
.../testImportAddTableAndColumn.map.xml-result | 50 +++
.../dbimport/testImportAddTableAndColumn.sql | 37 ++
.../tools/dbimport/testImportNewDataMap-pom.xml | 41 ++
.../testImportNewDataMap.map.xml-result | 37 ++
.../tools/dbimport/testImportNewDataMap.sql | 27 ++
.../dbimport/testImportWithoutChanges-pom.xml | 41 ++
.../dbimport/testImportWithoutChanges.map.xml | 37 ++
.../testImportWithoutChanges.map.xml-result | 37 ++
.../tools/dbimport/testImportWithoutChanges.sql | 27 ++
.../cayenne/tools/dbimport/testOneToOne-pom.xml | 41 ++
.../tools/dbimport/testOneToOne.map.xml-result | 58 +++
.../cayenne/tools/dbimport/testOneToOne.sql | 41 ++
.../testPreserveCustomObjMappings-pom.xml | 47 ++
.../testPreserveCustomObjMappings.map.xml | 33 ++
...testPreserveCustomObjMappings.map.xml-result | 35 ++
.../dbimport/testPreserveCustomObjMappings.sql | 28 ++
.../dbimport/testPreserveRelationships-pom.xml | 45 ++
.../dbimport/testPreserveRelationships.map.xml | 44 ++
.../testPreserveRelationships.map.xml-result | 34 ++
.../dbimport/testPreserveRelationships.sql | 28 ++
.../dbimport/testSchemasAndTableExclude-pom.xml | 48 +++
.../testSchemasAndTableExclude.map.xml-result | 38 ++
.../dbimport/testSchemasAndTableExclude.sql | 64 +++
.../dbimport/testSkipPrimaryKeyLoading-pom.xml | 45 ++
.../dbimport/testSkipPrimaryKeyLoading.map.xml | 35 ++
.../testSkipPrimaryKeyLoading.map.xml-result | 41 ++
.../dbimport/testSkipPrimaryKeyLoading.sql | 30 ++
.../testSkipRelationshipsLoading-pom.xml | 45 ++
.../testSkipRelationshipsLoading.map.xml | 55 +++
.../testSkipRelationshipsLoading.map.xml-result | 55 +++
.../dbimport/testSkipRelationshipsLoading.sql | 36 ++
...SupportsCatalogsOnReverseEngineering-pom.xml | 50 +++
...SupportsCatalogsOnReverseEngineering.map.xml | 25 ++
.../tools/dbimport/testTableTypes-pom.xml | 45 ++
.../dbimport/testTableTypes.map.xml-result | 29 ++
.../cayenne/tools/dbimport/testTableTypes.sql | 25 ++
.../dbimport/testUnFlattensManyToMany-pom.xml | 44 ++
.../dbimport/testUnFlattensManyToMany.map.xml | 55 +++
.../testUnFlattensManyToMany.map.xml-result | 88 ++++
.../tools/dbimport/testUnFlattensManyToMany.sql | 64 +++
.../tools/dbimport/testViewsExclude-pom.xml | 45 ++
.../dbimport/testViewsExclude.map.xml-result | 43 ++
.../cayenne/tools/dbimport/testViewsExclude.sql | 30 ++
.../apache/cayenne/tools/dbimporter-pom1.xml | 37 ++
.../apache/cayenne/tools/dbimporter-pom2.xml | 39 ++
.../apache/cayenne/tools/dbimporter-pom3.xml | 39 ++
plugins/maven-cayenne-plugin/pom.xml | 186 --------
.../cayenne/tools/CayenneGeneratorMojo.java | 293 -------------
.../apache/cayenne/tools/DbGeneratorMojo.java | 192 ---------
.../cayenne/tools/DbImportDataSourceConfig.java | 62 ---
.../apache/cayenne/tools/DbImporterMojo.java | 211 ---------
.../org/apache/cayenne/tools/MavenLogger.java | 105 -----
.../META-INF/m2e/lifecycle-mapping-metadata.xml | 32 --
.../cayenne/tools/CayenneGeneratorMojoTest.java | 78 ----
.../tools/DbImporterMojoConfigurationTest.java | 125 ------
.../cayenne/tools/DbImporterMojoTest.java | 431 -------------------
.../org/apache/cayenne/tools/DerbyManager.java | 63 ---
.../test/resources/cgen/cayenne-testDomain.xml | 5 -
.../test/resources/cgen/project-to-test/pom.xml | 56 ---
.../resources/cgen/testAdditionalMap.map.xml | 18 -
.../test/resources/cgen/testDomainMap.map.xml | 45 --
.../org/apache/cayenne/tools/config/pom-01.xml | 99 -----
.../tools/config/pom-catalog-and-schema.xml | 84 ----
.../apache/cayenne/tools/config/pom-catalog.xml | 87 ----
.../tools/config/pom-default-package.xml | 38 --
.../apache/cayenne/tools/config/pom-flat.xml | 78 ----
.../apache/cayenne/tools/config/pom-mapping.xml | 67 ---
.../cayenne/tools/config/pom-schema-2.xml | 41 --
.../apache/cayenne/tools/config/pom-schema.xml | 87 ----
.../config/pom-skip-primary-key-loading.xml | 39 --
.../config/pom-skip-relationships-loading.xml | 39 --
.../cayenne/tools/config/pom-table-types.xml | 41 --
.../dbimport/testComplexChangeOrder-pom.xml | 44 --
.../dbimport/testComplexChangeOrder.map.xml | 64 ---
.../testComplexChangeOrder.map.xml-result | 53 ---
.../tools/dbimport/testComplexChangeOrder.sql | 34 --
.../testCustomObjectLayerSettings-pom.xml | 51 ---
.../testCustomObjectLayerSettings.map.xml | 30 --
...testCustomObjectLayerSettings.map.xml-result | 46 --
.../dbimport/testCustomObjectLayerSettings.sql | 36 --
.../dbimport/testDbAttributeChange-pom.xml | 47 --
.../dbimport/testDbAttributeChange.map.xml | 62 ---
.../testDbAttributeChange.map.xml-result | 62 ---
.../tools/dbimport/testDbAttributeChange.sql | 46 --
.../tools/dbimport/testDefaultPackage-pom.xml | 47 --
.../dbimport/testDefaultPackage.map.xml-result | 52 ---
.../tools/dbimport/testDefaultPackage.sql | 40 --
.../dbimport/testFilteringWithSchema-pom.xml | 45 --
.../testFilteringWithSchema.map.xml-result | 51 ---
.../tools/dbimport/testFilteringWithSchema.sql | 64 ---
.../dbimport/testFkAttributeRename-pom.xml | 49 ---
.../dbimport/testFkAttributeRename.map.xml | 44 --
.../testFkAttributeRename.map.xml-result | 45 --
.../tools/dbimport/testFkAttributeRename.sql | 33 --
...tFlattensManyToManyWithRecursiveLink-pom.xml | 44 --
...nsManyToManyWithRecursiveLink.map.xml-result | 48 ---
.../testFlattensManyToManyWithRecursiveLink.sql | 31 --
.../dbimport/testForceDataMapSchema-pom.xml | 50 ---
.../dbimport/testForceDataMapSchema.map.xml | 26 --
.../testForceDataMapSchema.map.xml-result | 52 ---
.../tools/dbimport/testForceDataMapSchema.sql | 40 --
.../testImportAddTableAndColumn-pom.xml | 41 --
.../testImportAddTableAndColumn.map.xml | 37 --
.../testImportAddTableAndColumn.map.xml-result | 50 ---
.../dbimport/testImportAddTableAndColumn.sql | 37 --
.../tools/dbimport/testImportNewDataMap-pom.xml | 41 --
.../testImportNewDataMap.map.xml-result | 37 --
.../tools/dbimport/testImportNewDataMap.sql | 27 --
.../dbimport/testImportWithoutChanges-pom.xml | 41 --
.../dbimport/testImportWithoutChanges.map.xml | 37 --
.../testImportWithoutChanges.map.xml-result | 37 --
.../tools/dbimport/testImportWithoutChanges.sql | 27 --
.../cayenne/tools/dbimport/testOneToOne-pom.xml | 41 --
.../tools/dbimport/testOneToOne.map.xml-result | 58 ---
.../cayenne/tools/dbimport/testOneToOne.sql | 41 --
.../testPreserveCustomObjMappings-pom.xml | 47 --
.../testPreserveCustomObjMappings.map.xml | 33 --
...testPreserveCustomObjMappings.map.xml-result | 35 --
.../dbimport/testPreserveCustomObjMappings.sql | 28 --
.../dbimport/testPreserveRelationships-pom.xml | 45 --
.../dbimport/testPreserveRelationships.map.xml | 44 --
.../testPreserveRelationships.map.xml-result | 34 --
.../dbimport/testPreserveRelationships.sql | 28 --
.../dbimport/testSchemasAndTableExclude-pom.xml | 48 ---
.../testSchemasAndTableExclude.map.xml-result | 38 --
.../dbimport/testSchemasAndTableExclude.sql | 64 ---
.../dbimport/testSkipPrimaryKeyLoading-pom.xml | 45 --
.../dbimport/testSkipPrimaryKeyLoading.map.xml | 35 --
.../testSkipPrimaryKeyLoading.map.xml-result | 41 --
.../dbimport/testSkipPrimaryKeyLoading.sql | 30 --
.../testSkipRelationshipsLoading-pom.xml | 45 --
.../testSkipRelationshipsLoading.map.xml | 55 ---
.../testSkipRelationshipsLoading.map.xml-result | 55 ---
.../dbimport/testSkipRelationshipsLoading.sql | 36 --
...SupportsCatalogsOnReverseEngineering-pom.xml | 50 ---
...SupportsCatalogsOnReverseEngineering.map.xml | 25 --
.../tools/dbimport/testTableTypes-pom.xml | 45 --
.../dbimport/testTableTypes.map.xml-result | 29 --
.../cayenne/tools/dbimport/testTableTypes.sql | 25 --
.../dbimport/testUnFlattensManyToMany-pom.xml | 44 --
.../dbimport/testUnFlattensManyToMany.map.xml | 55 ---
.../testUnFlattensManyToMany.map.xml-result | 88 ----
.../tools/dbimport/testUnFlattensManyToMany.sql | 64 ---
.../tools/dbimport/testViewsExclude-pom.xml | 45 --
.../dbimport/testViewsExclude.map.xml-result | 43 --
.../cayenne/tools/dbimport/testViewsExclude.sql | 30 --
.../apache/cayenne/tools/dbimporter-pom1.xml | 37 --
.../apache/cayenne/tools/dbimporter-pom2.xml | 39 --
.../apache/cayenne/tools/dbimporter-pom3.xml | 39 --
plugins/pom.xml | 2 +-
207 files changed, 5935 insertions(+), 5935 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/cayenne/blob/2cddff91/plugins/cayenne-maven-plugin/pom.xml
----------------------------------------------------------------------
diff --git a/plugins/cayenne-maven-plugin/pom.xml b/plugins/cayenne-maven-plugin/pom.xml
new file mode 100644
index 0000000..bebdcf4
--- /dev/null
+++ b/plugins/cayenne-maven-plugin/pom.xml
@@ -0,0 +1,186 @@
+<?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/maven-v4_0_0.xsd">
+
+ <parent>
+ <artifactId>cayenne-plugins-parent</artifactId>
+ <groupId>org.apache.cayenne.plugins</groupId>
+ <version>4.0.M5-SNAPSHOT</version>
+ </parent>
+
+ <modelVersion>4.0.0</modelVersion>
+ <artifactId>maven-cayenne-plugin</artifactId>
+ <packaging>maven-plugin</packaging>
+ <name>maven-cayenne-plugin: Cayenne Maven Plugin</name>
+
+ <dependencies>
+
+ <dependency>
+ <groupId>org.apache.maven</groupId>
+ <artifactId>maven-plugin-api</artifactId>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.maven</groupId>
+ <artifactId>maven-artifact</artifactId>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.maven</groupId>
+ <artifactId>maven-project</artifactId>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.maven.plugin-tools</groupId>
+ <artifactId>maven-plugin-tools-api</artifactId>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.maven.plugin-tools</groupId>
+ <artifactId>maven-plugin-annotations</artifactId>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.maven</groupId>
+ <artifactId>maven-compat</artifactId>
+ </dependency>
+
+ <dependency>
+ <groupId>org.codehaus.plexus</groupId>
+ <artifactId>plexus-interpolation</artifactId>
+ </dependency>
+
+ <dependency>
+ <groupId>org.codehaus.plexus</groupId>
+ <artifactId>plexus-container-default</artifactId>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.cayenne</groupId>
+ <artifactId>cayenne-project</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.cayenne</groupId>
+ <artifactId>cayenne-server</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.cayenne</groupId>
+ <artifactId>cayenne-tools</artifactId>
+ <version>${project.version}</version>
+ <exclusions>
+ <exclusion>
+ <groupId>foundrylogic.vpp</groupId>
+ <artifactId>vpp</artifactId>
+ </exclusion>
+ </exclusions>
+ </dependency>
+
+ <!-- Test deps -->
+ <dependency>
+ <groupId>org.mockito</groupId>
+ <artifactId>mockito-all</artifactId>
+ <scope>test</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ <scope>test</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.maven.plugin-testing</groupId>
+ <artifactId>maven-plugin-testing-harness</artifactId>
+ <scope>test</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.derby</groupId>
+ <artifactId>derby</artifactId>
+ <scope>test</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>xmlunit</groupId>
+ <artifactId>xmlunit</artifactId>
+ <scope>test</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.maven</groupId>
+ <artifactId>maven-core</artifactId>
+ <scope>test</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.cayenne</groupId>
+ <artifactId>cayenne-server</artifactId>
+ <version>${project.version}</version>
+ <scope>test</scope>
+ <type>test-jar</type>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.cayenne</groupId>
+ <artifactId>cayenne-tools</artifactId>
+ <version>${project.version}</version>
+ <scope>test</scope>
+ <type>test-jar</type>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.cayenne.build-tools</groupId>
+ <artifactId>cayenne-test-utilities</artifactId>
+ <version>${project.version}</version>
+ <scope>test</scope>
+ </dependency>
+ </dependencies>
+
+ <reporting>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-plugin-plugin</artifactId>
+ </plugin>
+ </plugins>
+ </reporting>
+
+ <profiles>
+ <profile>
+ <id>code-quality</id>
+
+ <activation>
+ <property>
+ <name>!fast-and-dirty</name>
+ </property>
+ </activation>
+ <build>
+ <plugins>
+ <plugin>
+ <artifactId>maven-checkstyle-plugin</artifactId>
+ <!--<configuration>
+ <suppressionsLocation>${project.basedir}/cayenne-checkstyle-suppression.xml</suppressionsLocation>
+ </configuration>-->
+ </plugin>
+ <plugin>
+ <artifactId>maven-pmd-plugin</artifactId>
+ </plugin>
+ </plugins>
+ </build>
+ </profile>
+ </profiles>
+</project>
+
http://git-wip-us.apache.org/repos/asf/cayenne/blob/2cddff91/plugins/cayenne-maven-plugin/src/main/java/org/apache/cayenne/tools/CayenneGeneratorMojo.java
----------------------------------------------------------------------
diff --git a/plugins/cayenne-maven-plugin/src/main/java/org/apache/cayenne/tools/CayenneGeneratorMojo.java b/plugins/cayenne-maven-plugin/src/main/java/org/apache/cayenne/tools/CayenneGeneratorMojo.java
new file mode 100644
index 0000000..46a7cb5
--- /dev/null
+++ b/plugins/cayenne-maven-plugin/src/main/java/org/apache/cayenne/tools/CayenneGeneratorMojo.java
@@ -0,0 +1,293 @@
+/*****************************************************************
+ * 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.
+ ****************************************************************/
+
+package org.apache.cayenne.tools;
+
+import org.apache.cayenne.dbsync.filter.NamePatternMatcher;
+import org.apache.cayenne.gen.ClassGenerationAction;
+import org.apache.cayenne.gen.ClientClassGenerationAction;
+import org.apache.cayenne.map.DataMap;
+import org.apache.commons.logging.Log;
+import org.apache.maven.plugin.AbstractMojo;
+import org.apache.maven.plugin.MojoExecutionException;
+import org.apache.maven.plugin.MojoFailureException;
+
+import java.io.File;
+import java.io.FilenameFilter;
+
+/**
+ * Maven mojo to perform class generation from data map. This class is an Maven
+ * adapter to DefaultClassGenerator class.
+ *
+ * @since 3.0
+ *
+ * @phase generate-sources
+ * @goal cgen
+ */
+public class CayenneGeneratorMojo extends AbstractMojo {
+
+ public static final File[] NO_FILES = new File[0];
+ /**
+ * Path to additional DataMap XML files to use for class generation.
+ *
+ * @parameter additionalMaps="additionalMaps"
+ */
+ private File additionalMaps;
+
+ /**
+ * Whether we are generating classes for the client tier in a Remote Object
+ * Persistence application. Default is <code>false</code>.
+ *
+ * @parameter client="client" default-value="false"
+ */
+ private boolean client;
+
+ /**
+ * Destination directory for Java classes (ignoring their package names).
+ *
+ * @parameter destDir="destDir" default-value="${project.build.sourceDirectory}"
+ */
+ private File destDir;
+
+ /**
+ * Specify generated file encoding if different from the default on current
+ * platform. Target encoding must be supported by the JVM running Maven
+ * build. Standard encodings supported by Java on all platforms are
+ * US-ASCII, ISO-8859-1, UTF-8, UTF-16BE, UTF-16LE, UTF-16. See Sun Java
+ * Docs for java.nio.charset.Charset for more information.
+ *
+ * @parameter encoding="encoding"
+ */
+ private String encoding;
+
+ /**
+ * Entities (expressed as a perl5 regex) to exclude from template
+ * generation. (Default is to include all entities in the DataMap).
+ *
+ * @parameter excludeEntities="excludeEntities"
+ */
+ private String excludeEntities;
+
+ /**
+ * Entities (expressed as a perl5 regex) to include in template generation.
+ * (Default is to include all entities in the DataMap).
+ *
+ * @parameter includeEntities="includeEntities"
+ */
+ private String includeEntities;
+
+ /**
+ * If set to <code>true</code>, will generate subclass/superclass pairs,
+ * with all generated code included in superclass (default is
+ * <code>true</code>).
+ *
+ * @parameter makePairs="makePairs" default-value="true"
+ */
+ private boolean makePairs;
+
+ /**
+ * DataMap XML file to use as a base for class generation.
+ *
+ * @parameter map="map"
+ * @required
+ */
+ private File map;
+
+ /**
+ * Specifies generator iteration target. "entity" performs one
+ * iteration for each selected entity. "datamap" performs one
+ * iteration per datamap (This is always one iteration since cgen currently
+ * supports specifying one-and-only-one datamap). (Default is
+ * "entity")
+ *
+ * @parameter mode="mode" default-value="entity"
+ */
+ private String mode;
+
+ /**
+ * Name of file for generated output. (Default is "*.java")
+ *
+ * @parameter outputPattern="outputPattern" default-value="*.java"
+ */
+ private String outputPattern;
+
+ /**
+ * If set to <code>true</code>, will overwrite older versions of generated
+ * classes. Ignored unless makepairs is set to <code>false</code>.
+ *
+ * @parameter overwrite="overwrite" default-value="false"
+ */
+ private boolean overwrite;
+
+ /**
+ * Java package name of generated superclasses. Ignored unless
+ * <code>makepairs</code> set to <code>true</code>. If omitted, each
+ * superclass will be assigned the same package as subclass. Note that
+ * having superclass in a different package would only make sense when
+ * <code>usepkgpath</code> is set to <code>true</code>. Otherwise classes
+ * from different packages will end up in the same directory.
+ *
+ * @parameter superPkg="superPkg"
+ */
+ private String superPkg;
+
+ /**
+ * Location of Velocity template file for Entity superclass generation.
+ * Ignored unless <code>makepairs</code> set to <code>true</code>. If
+ * omitted, default template is used.
+ *
+ * @parameter superTemplate="superTemplate"
+ */
+ private String superTemplate;
+
+ /**
+ * Location of Velocity template file for Entity class generation. If
+ * omitted, default template is used.
+ *
+ * @parameter template="template"
+ */
+ private String template;
+
+ /**
+ * Location of Velocity template file for Embeddable superclass generation.
+ * Ignored unless <code>makepairs</code> set to <code>true</code>. If
+ * omitted, default template is used.
+ *
+ * @parameter embeddableSuperTemplate="embeddableSuperTemplate"
+ */
+ private String embeddableSuperTemplate;
+
+ /**
+ * Location of Velocity template file for Embeddable class generation. If
+ * omitted, default template is used.
+ *
+ * @parameter embeddableTemplate="embeddableTemplate"
+ */
+ private String embeddableTemplate;
+
+ /**
+ * If set to <code>true</code> (default), a directory tree will be generated
+ * in "destDir" corresponding to the class package structure, if set to
+ * <code>false</code>, classes will be generated in "destDir"
+ * ignoring their package.
+ *
+ * @parameter usePkgPath="usePkgPath" default-value="true"
+ */
+ private boolean usePkgPath;
+
+ /**
+ * If set to <code>true</code>, will generate String Property names.
+ * Default is <code>false</code>.
+ *
+ * @parameter createPropertyNames="createPropertyNames" default-value="false"
+ */
+ private boolean createPropertyNames;
+
+ public void execute() throws MojoExecutionException, MojoFailureException {
+ // Create the destination directory if necessary.
+ // TODO: (KJM 11/2/06) The destDir really should be added as a
+ // compilation resource for maven.
+ if (!destDir.exists()) {
+ destDir.mkdirs();
+ }
+
+ Log logger = new MavenLogger(this);
+ CayenneGeneratorMapLoaderAction loaderAction = new CayenneGeneratorMapLoaderAction();
+ loaderAction.setMainDataMapFile(map);
+
+ CayenneGeneratorEntityFilterAction filterAction = new CayenneGeneratorEntityFilterAction();
+ filterAction.setClient(client);
+ filterAction.setNameFilter(NamePatternMatcher.build(logger, includeEntities, excludeEntities));
+
+ try {
+ loaderAction.setAdditionalDataMapFiles(convertAdditionalDataMaps());
+
+ DataMap dataMap = loaderAction.getMainDataMap();
+
+ ClassGenerationAction generator = createGenerator();
+ generator.setLogger(logger);
+ generator.setTimestamp(map.lastModified());
+ generator.setDataMap(dataMap);
+ generator.addEntities(filterAction.getFilteredEntities(dataMap));
+ // ksenia khailenko 15.10.2010
+ // TODO add the "includeEmbeddables" and "excludeEmbeddables"
+ // attributes
+ generator.addEmbeddables(dataMap.getEmbeddables());
+ // TODO add the "includeQueries" and "excludeQueries" attributes
+ generator.addQueries(dataMap.getQueryDescriptors());
+ generator.execute();
+ } catch (Exception e) {
+ throw new MojoExecutionException("Error generating classes: ", e);
+ }
+ }
+
+ /**
+ * Loads and returns DataMap based on <code>map</code> attribute.
+ */
+ protected File[] convertAdditionalDataMaps() throws Exception {
+
+ if (additionalMaps == null) {
+ return NO_FILES;
+ }
+
+ if (!additionalMaps.isDirectory()) {
+ throw new MojoFailureException(
+ "'additionalMaps' must be a directory.");
+ }
+
+ FilenameFilter mapFilter = new FilenameFilter() {
+ @Override
+ public boolean accept(File dir, String name) {
+ return name != null &&
+ name.toLowerCase().endsWith(".map.xml");
+ }
+ };
+ return additionalMaps.listFiles(mapFilter);
+ }
+
+ /**
+ * Factory method to create internal class generator. Called from
+ * constructor.
+ */
+ protected ClassGenerationAction createGenerator() {
+
+ ClassGenerationAction action;
+ if (client) {
+ action = new ClientClassGenerationAction();
+ } else {
+ action = new ClassGenerationAction();
+ }
+
+ action.setDestDir(destDir);
+ action.setEncoding(encoding);
+ action.setMakePairs(makePairs);
+ action.setArtifactsGenerationMode(mode);
+ action.setOutputPattern(outputPattern);
+ action.setOverwrite(overwrite);
+ action.setSuperPkg(superPkg);
+ action.setSuperTemplate(superTemplate);
+ action.setTemplate(template);
+ action.setEmbeddableSuperTemplate(embeddableSuperTemplate);
+ action.setEmbeddableTemplate(embeddableTemplate);
+ action.setUsePkgPath(usePkgPath);
+ action.setCreatePropertyNames(createPropertyNames);
+
+ return action;
+ }
+}
http://git-wip-us.apache.org/repos/asf/cayenne/blob/2cddff91/plugins/cayenne-maven-plugin/src/main/java/org/apache/cayenne/tools/DbGeneratorMojo.java
----------------------------------------------------------------------
diff --git a/plugins/cayenne-maven-plugin/src/main/java/org/apache/cayenne/tools/DbGeneratorMojo.java b/plugins/cayenne-maven-plugin/src/main/java/org/apache/cayenne/tools/DbGeneratorMojo.java
new file mode 100644
index 0000000..72c524f
--- /dev/null
+++ b/plugins/cayenne-maven-plugin/src/main/java/org/apache/cayenne/tools/DbGeneratorMojo.java
@@ -0,0 +1,192 @@
+/*****************************************************************
+ * 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.
+ ****************************************************************/
+
+package org.apache.cayenne.tools;
+
+import org.apache.cayenne.access.DbGenerator;
+import org.apache.cayenne.datasource.DriverDataSource;
+import org.apache.cayenne.dba.DbAdapter;
+import org.apache.cayenne.dba.JdbcAdapter;
+import org.apache.cayenne.dbsync.DbSyncModule;
+import org.apache.cayenne.di.AdhocObjectFactory;
+import org.apache.cayenne.di.DIBootstrap;
+import org.apache.cayenne.di.Injector;
+import org.apache.cayenne.log.NoopJdbcEventLogger;
+import org.apache.cayenne.map.DataMap;
+import org.apache.cayenne.map.MapLoader;
+import org.apache.cayenne.tools.configuration.ToolsModule;
+import org.apache.cayenne.util.Util;
+import org.apache.commons.logging.Log;
+import org.apache.maven.plugin.AbstractMojo;
+import org.apache.maven.plugin.MojoExecutionException;
+import org.apache.maven.plugin.MojoFailureException;
+import org.xml.sax.InputSource;
+
+import java.io.File;
+import java.sql.Driver;
+
+/**
+ * Maven mojo to perform class generation from data map. This class is a Maven
+ * adapter to DefaultClassGenerator class.
+ *
+ * @since 3.0
+ *
+ * @phase pre-integration-test
+ * @goal cdbgen
+ */
+public class DbGeneratorMojo extends AbstractMojo {
+
+ /**
+ * DataMap XML file to use as a schema descriptor.
+ *
+ * @parameter map="map"
+ * @required
+ */
+ private File map;
+
+ /**
+ * Java class implementing org.apache.cayenne.dba.DbAdapter. While this
+ * attribute is optional (a generic JdbcAdapter is used if not set), it is
+ * highly recommended to specify correct target adapter.
+ *
+ * @parameter adapter="adapter"
+ */
+ private String adapter;
+
+ /**
+ * A class of JDBC driver to use for the target database.
+ *
+ * @parameter driver="driver"
+ * @required
+ */
+ private String driver;
+
+ /**
+ * JDBC connection URL of a target database.
+ *
+ * @parameter url="url"
+ * @required
+ */
+ private String url;
+
+ /**
+ * Database user name.
+ *
+ * @parameter username="username"
+ */
+ private String username;
+
+ /**
+ * Database user password.
+ *
+ * @parameter password="password"
+ */
+ private String password;
+
+ /**
+ * Defines whether cdbgen should drop the tables before attempting to create
+ * new ones. Default is <code>false</code>.
+ *
+ * @parameter dropTables="dropTables" default-value="false"
+ */
+ private boolean dropTables;
+
+ /**
+ * Defines whether cdbgen should drop Cayenne primary key support objects.
+ * Default is <code>false</code>.
+ *
+ * @parameter dropPK="dropPK" default-value="false"
+ */
+ private boolean dropPK;
+
+ /**
+ * Defines whether cdbgen should create new tables. Default is
+ * <code>true</code>.
+ *
+ * @parameter createTables="createTables" default-value="true"
+ */
+ private boolean createTables;
+
+ /**
+ * Defines whether cdbgen should create Cayenne-specific auto PK objects.
+ * Default is <code>true</code>.
+ *
+ * @parameter createPK="createPK" default-value="true"
+ */
+ private boolean createPK;
+
+ /**
+ * Defines whether cdbgen should create foreign key copnstraints. Default is
+ * <code>true</code>.
+ *
+ * @parameter createFK="createFK" default-value="true"
+ */
+ private boolean createFK;
+
+ public void execute() throws MojoExecutionException, MojoFailureException {
+
+ Log logger = new MavenLogger(this);
+ Injector injector = DIBootstrap.createInjector(new DbSyncModule(), new ToolsModule(logger));
+ AdhocObjectFactory objectFactory = injector.getInstance(AdhocObjectFactory.class);
+
+ logger.info(String.format("connection settings - [driver: %s, url: %s, username: %s]", driver, url, username));
+
+ logger.info(String.format(
+ "generator options - [dropTables: %s, dropPK: %s, createTables: %s, createPK: %s, createFK: %s]",
+ dropTables, dropPK, createTables, createPK, createFK));
+
+ try {
+ final DbAdapter adapterInst = (adapter == null) ? (DbAdapter) objectFactory.newInstance(DbAdapter.class,
+ JdbcAdapter.class.getName()) : (DbAdapter) objectFactory.newInstance(DbAdapter.class, adapter);
+
+ // Load the data map and run the db generator.
+ DataMap dataMap = loadDataMap();
+ DbGenerator generator = new DbGenerator(adapterInst, dataMap, NoopJdbcEventLogger.getInstance());
+ generator.setShouldCreateFKConstraints(createFK);
+ generator.setShouldCreatePKSupport(createPK);
+ generator.setShouldCreateTables(createTables);
+ generator.setShouldDropPKSupport(dropPK);
+ generator.setShouldDropTables(dropTables);
+
+ // load driver taking custom CLASSPATH into account...
+ DriverDataSource dataSource = new DriverDataSource((Driver) Class.forName(driver).newInstance(), url,
+ username, password);
+
+ generator.runGenerator(dataSource);
+ } catch (Exception ex) {
+ Throwable th = Util.unwindException(ex);
+
+ String message = "Error generating database";
+
+ if (th.getLocalizedMessage() != null) {
+ message += ": " + th.getLocalizedMessage();
+ }
+
+ logger.error(message);
+ throw new MojoExecutionException(message, th);
+ }
+ }
+
+ /** Loads and returns DataMap based on <code>map</code> attribute. */
+ protected DataMap loadDataMap() throws Exception {
+ InputSource in = new InputSource(map.getCanonicalPath());
+ return new MapLoader().loadDataMap(in);
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/cayenne/blob/2cddff91/plugins/cayenne-maven-plugin/src/main/java/org/apache/cayenne/tools/DbImportDataSourceConfig.java
----------------------------------------------------------------------
diff --git a/plugins/cayenne-maven-plugin/src/main/java/org/apache/cayenne/tools/DbImportDataSourceConfig.java b/plugins/cayenne-maven-plugin/src/main/java/org/apache/cayenne/tools/DbImportDataSourceConfig.java
new file mode 100644
index 0000000..8fa4b56
--- /dev/null
+++ b/plugins/cayenne-maven-plugin/src/main/java/org/apache/cayenne/tools/DbImportDataSourceConfig.java
@@ -0,0 +1,62 @@
+/*****************************************************************
+ * 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.
+ ****************************************************************/
+
+package org.apache.cayenne.tools;
+
+/**
+ * @since 4.0
+ */
+public class DbImportDataSourceConfig {
+
+ /**
+ * A class of JDBC driver to use for the target database.
+ */
+ private String driver;
+
+ /**
+ * JDBC connection URL of a target database.
+ */
+ private String url;
+
+ /**
+ * Database user name.
+ */
+ private String username;
+
+ /**
+ * Database user password.
+ */
+ private String password;
+
+ public String getDriver() {
+ return driver;
+ }
+
+ public String getUrl() {
+ return url;
+ }
+
+ public String getUsername() {
+ return username;
+ }
+
+ public String getPassword() {
+ return password;
+ }
+}
http://git-wip-us.apache.org/repos/asf/cayenne/blob/2cddff91/plugins/cayenne-maven-plugin/src/main/java/org/apache/cayenne/tools/DbImporterMojo.java
----------------------------------------------------------------------
diff --git a/plugins/cayenne-maven-plugin/src/main/java/org/apache/cayenne/tools/DbImporterMojo.java b/plugins/cayenne-maven-plugin/src/main/java/org/apache/cayenne/tools/DbImporterMojo.java
new file mode 100644
index 0000000..9c9cddf
--- /dev/null
+++ b/plugins/cayenne-maven-plugin/src/main/java/org/apache/cayenne/tools/DbImporterMojo.java
@@ -0,0 +1,211 @@
+/*****************************************************************
+ * 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.
+ ****************************************************************/
+package org.apache.cayenne.tools;
+
+import org.apache.cayenne.dbimport.ReverseEngineering;
+import org.apache.cayenne.dbsync.DbSyncModule;
+import org.apache.cayenne.dbsync.reverse.filters.FiltersConfigBuilder;
+import org.apache.cayenne.di.DIBootstrap;
+import org.apache.cayenne.di.Injector;
+import org.apache.cayenne.tools.configuration.ToolsModule;
+import org.apache.cayenne.tools.dbimport.DbImportAction;
+import org.apache.cayenne.tools.dbimport.DbImportConfiguration;
+import org.apache.cayenne.tools.dbimport.DbImportModule;
+import org.apache.cayenne.util.Util;
+import org.apache.commons.logging.Log;
+import org.apache.maven.plugin.AbstractMojo;
+import org.apache.maven.plugin.MojoExecutionException;
+import org.apache.maven.plugin.MojoFailureException;
+import org.apache.maven.plugins.annotations.LifecyclePhase;
+import org.apache.maven.plugins.annotations.Mojo;
+import org.apache.maven.plugins.annotations.Parameter;
+
+import java.io.File;
+
+/**
+ * Maven mojo to reverse engineer datamap from DB.
+ *
+ * @since 3.0
+ */
+@Mojo(name = "cdbimport", defaultPhase = LifecyclePhase.GENERATE_SOURCES)
+public class DbImporterMojo extends AbstractMojo {
+
+ /**
+ * Java class implementing org.apache.cayenne.dba.DbAdapter. This attribute
+ * is optional, the default is AutoAdapter, i.e. Cayenne would try to guess
+ * the DB type.
+ */
+ @Parameter(defaultValue = "org.apache.cayenne.dba.AutoAdapter")
+ private String adapter;
+
+ /**
+ * Connection properties.
+ *
+ * @see DbImportDataSourceConfig
+ * @since 4.0
+ */
+ @Parameter(required = true)
+ private DbImportDataSourceConfig dataSource = new DbImportDataSourceConfig();
+
+ /**
+ * DataMap XML file to use as a base for DB importing.
+ */
+ @Parameter(required = true)
+ private File map;
+
+ /**
+ * An object that contains reverse engineering rules.
+ */
+ @Parameter(name = "dbimport", property = "dbimport", alias = "dbImport")
+ private ReverseEngineering dbImportConfig = new ReverseEngineering();
+
+ /**
+ * @deprecated use {@code <dataSource>} tag to set connection properties
+ */
+ @Deprecated @Parameter(name = "url", property = "url")
+ private final String oldUrl = ""; // TODO remove in 4.0.BETA
+
+ /**
+ * @deprecated moved to {@code <dbimport>} section
+ */
+ @Deprecated @Parameter(name = "meaningfulPkTables", property = "meaningfulPkTables")
+ private final String oldMeaningfulPkTables = ""; // TODO remove in 4.0.BETA
+
+ /**
+ * @deprecated use {@code <dataSource>} tag to set connection properties
+ */
+ @Deprecated @Parameter(name = "driver", property = "driver")
+ private final String oldDriver = ""; // TODO remove in 4.0.BETA
+
+ /**
+ * @deprecated moved to {@code <dbimport>} section
+ */
+ @Deprecated @Parameter(name = "defaultPackage", property = "defaultPackage")
+ private final String oldDefaultPackage = ""; // TODO remove in 4.0.BETA
+
+
+ public void execute() throws MojoExecutionException, MojoFailureException {
+
+ Log logger = new MavenLogger(this);
+
+ DbImportConfiguration config = createConfig(logger);
+ Injector injector = DIBootstrap.createInjector(
+ new DbSyncModule(), new ToolsModule(logger), new DbImportModule());
+
+ DbImportConfigurationValidator validator = new DbImportConfigurationValidator(
+ dbImportConfig, config, injector);
+ try {
+ validator.validate();
+ } catch (Exception ex) {
+ throw new MojoExecutionException(ex.getMessage(), ex);
+ }
+
+ try {
+ injector.getInstance(DbImportAction.class).execute(config);
+ } catch (Exception ex) {
+ Throwable th = Util.unwindException(ex);
+
+ String message = "Error importing database schema";
+
+ if (th.getLocalizedMessage() != null) {
+ message += ": " + th.getLocalizedMessage();
+ }
+
+ getLog().error(message);
+ throw new MojoExecutionException(message, th);
+ }
+ }
+
+ DbImportConfiguration createConfig(Log logger) {
+
+ DbImportConfiguration config = new DbImportConfiguration();
+ config.setAdapter(adapter);
+ config.setDefaultPackage(dbImportConfig.getDefaultPackage());
+ config.setDriver(dataSource.getDriver());
+ config.setFiltersConfig(new FiltersConfigBuilder(dbImportConfig).build());
+ config.setForceDataMapCatalog(dbImportConfig.isForceDataMapCatalog());
+ config.setForceDataMapSchema(dbImportConfig.isForceDataMapSchema());
+ config.setLogger(logger);
+ config.setMeaningfulPkTables(dbImportConfig.getMeaningfulPkTables());
+ config.setNamingStrategy(dbImportConfig.getNamingStrategy());
+ config.setPassword(dataSource.getPassword());
+ config.setSkipRelationshipsLoading(dbImportConfig.getSkipRelationshipsLoading());
+ config.setSkipPrimaryKeyLoading(dbImportConfig.getSkipPrimaryKeyLoading());
+ config.setStripFromTableNames(dbImportConfig.getStripFromTableNames());
+ config.setTableTypes(dbImportConfig.getTableTypes());
+ config.setTargetDataMap(map);
+ config.setUrl(dataSource.getUrl());
+ config.setUsername(dataSource.getUsername());
+ config.setUsePrimitives(dbImportConfig.isUsePrimitives());
+
+ return config;
+ }
+
+ public File getMap() {
+ return map;
+ }
+
+ /**
+ * Used only in tests, Maven will inject value directly into the "map" field
+ */
+ public void setMap(File map) {
+ this.map = map;
+ }
+
+ /**
+ * This setter is used by Maven when defined {@code <dbimport>} tag
+ */
+ public void setDbimport(ReverseEngineering dbImportConfig) {
+ this.dbImportConfig = dbImportConfig;
+ }
+
+ /**
+ * This setter is used by Maven {@code <dbImport>} tag
+ */
+ public void setDbImport(ReverseEngineering dbImportConfig) {
+ this.dbImportConfig = dbImportConfig;
+ }
+
+ public ReverseEngineering getReverseEngineering() {
+ return dbImportConfig;
+ }
+
+ // TODO \u2b07\u2b07\u2b07 All following setters should be removed in 4.0.BETA \u2b07\u2b07\u2b07
+ @Deprecated
+ public void setUrl(String url) {
+ throw new UnsupportedOperationException("Connection properties were replaced with <dataSource> tag since 4.0.M5.\n\tFor additional information see http://cayenne.apache.org/docs/4.0/cayenne-guide/including-cayenne-in-project.html#maven-projects");
+ }
+
+ @Deprecated
+ public void setDriver(String driver) {
+ throw new UnsupportedOperationException("Connection properties were replaced with <dataSource> tag since 4.0.M5.\n\tFor additional information see http://cayenne.apache.org/docs/4.0/cayenne-guide/including-cayenne-in-project.html#maven-projects");
+ }
+
+ @Deprecated
+ public void setMeaningfulPkTables(String meaningfulPkTables) {
+ throw new UnsupportedOperationException("meaningfulPkTables property has been moved to <dbimport> tag since 4.0.M5.\n\tFor additional information see http://cayenne.apache.org/docs/4.0/cayenne-guide/including-cayenne-in-project.html#maven-projects");
+ }
+
+ @Deprecated
+ public void setDefaultPackage(String defaultPackage) {
+ throw new UnsupportedOperationException("defaultPackage property has been deprecated since 4.0.M5.\n\tFor additional information see http://cayenne.apache.org/docs/4.0/cayenne-guide/including-cayenne-in-project.html#maven-projects");
+ }
+}
+
+
http://git-wip-us.apache.org/repos/asf/cayenne/blob/2cddff91/plugins/cayenne-maven-plugin/src/main/java/org/apache/cayenne/tools/MavenLogger.java
----------------------------------------------------------------------
diff --git a/plugins/cayenne-maven-plugin/src/main/java/org/apache/cayenne/tools/MavenLogger.java b/plugins/cayenne-maven-plugin/src/main/java/org/apache/cayenne/tools/MavenLogger.java
new file mode 100644
index 0000000..c439f98
--- /dev/null
+++ b/plugins/cayenne-maven-plugin/src/main/java/org/apache/cayenne/tools/MavenLogger.java
@@ -0,0 +1,105 @@
+/*****************************************************************
+ * 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.
+ ****************************************************************/
+package org.apache.cayenne.tools;
+
+import org.apache.maven.plugin.AbstractMojo;
+
+/**
+ * @since 3.0
+ */
+class MavenLogger implements org.apache.commons.logging.Log {
+
+ private org.apache.maven.plugin.logging.Log logger;
+
+ public MavenLogger(AbstractMojo parent) {
+ this.logger = parent.getLog();
+ }
+
+ public void debug(Object message, Throwable th) {
+ logger.debug(String.valueOf(message), th);
+ }
+
+ public void debug(Object message) {
+ logger.debug(String.valueOf(message));
+ }
+
+ public void error(Object message, Throwable th) {
+ logger.error(String.valueOf(message), th);
+ }
+
+ public void error(Object message) {
+ logger.error(String.valueOf(message));
+ }
+
+ public void fatal(Object message, Throwable th) {
+ logger.error(String.valueOf(message), th);
+ }
+
+ public void fatal(Object message) {
+ logger.error(String.valueOf(message));
+ }
+
+ public void info(Object message, Throwable th) {
+ logger.info(String.valueOf(message), th);
+ }
+
+ public void info(Object message) {
+ logger.info(String.valueOf(message));
+ }
+
+ public boolean isDebugEnabled() {
+ return logger.isDebugEnabled();
+ }
+
+ public boolean isErrorEnabled() {
+ return logger.isErrorEnabled();
+ }
+
+ public boolean isFatalEnabled() {
+ return logger.isErrorEnabled();
+ }
+
+ public boolean isInfoEnabled() {
+ return logger.isInfoEnabled();
+ }
+
+ public boolean isTraceEnabled() {
+ return logger.isDebugEnabled();
+ }
+
+ public boolean isWarnEnabled() {
+ return logger.isWarnEnabled();
+ }
+
+ public void trace(Object message, Throwable th) {
+ logger.debug(String.valueOf(message), th);
+ }
+
+ public void trace(Object message) {
+ logger.debug(String.valueOf(message));
+ }
+
+ public void warn(Object message, Throwable th) {
+ logger.warn(String.valueOf(message), th);
+ }
+
+ public void warn(Object message) {
+ logger.warn(String.valueOf(message));
+ }
+}
http://git-wip-us.apache.org/repos/asf/cayenne/blob/2cddff91/plugins/cayenne-maven-plugin/src/main/resources/META-INF/m2e/lifecycle-mapping-metadata.xml
----------------------------------------------------------------------
diff --git a/plugins/cayenne-maven-plugin/src/main/resources/META-INF/m2e/lifecycle-mapping-metadata.xml b/plugins/cayenne-maven-plugin/src/main/resources/META-INF/m2e/lifecycle-mapping-metadata.xml
new file mode 100644
index 0000000..e5de2d0
--- /dev/null
+++ b/plugins/cayenne-maven-plugin/src/main/resources/META-INF/m2e/lifecycle-mapping-metadata.xml
@@ -0,0 +1,32 @@
+<!--
+ 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.
+-->
+<lifecycleMappingMetadata>
+ <pluginExecutions>
+ <pluginExecution>
+ <pluginExecutionFilter>
+ <goals>
+ <goal>cgen</goal>
+ </goals>
+ </pluginExecutionFilter>
+ <action>
+ <execute>
+ <runOnIncremental>true</runOnIncremental>
+ <runOnConfiguration>true</runOnConfiguration>
+ </execute>
+ </action>
+ </pluginExecution>
+ </pluginExecutions>
+</lifecycleMappingMetadata>
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/cayenne/blob/2cddff91/plugins/cayenne-maven-plugin/src/test/java/org/apache/cayenne/tools/CayenneGeneratorMojoTest.java
----------------------------------------------------------------------
diff --git a/plugins/cayenne-maven-plugin/src/test/java/org/apache/cayenne/tools/CayenneGeneratorMojoTest.java b/plugins/cayenne-maven-plugin/src/test/java/org/apache/cayenne/tools/CayenneGeneratorMojoTest.java
new file mode 100644
index 0000000..734e93c
--- /dev/null
+++ b/plugins/cayenne-maven-plugin/src/test/java/org/apache/cayenne/tools/CayenneGeneratorMojoTest.java
@@ -0,0 +1,78 @@
+/*****************************************************************
+ * 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.
+ ****************************************************************/
+package org.apache.cayenne.tools;
+
+import org.apache.commons.io.FileUtils;
+import org.apache.maven.plugin.testing.AbstractMojoTestCase;
+
+import java.io.File;
+
+public class CayenneGeneratorMojoTest extends AbstractMojoTestCase {
+
+ public void testCgenExecution() throws Exception {
+
+ File pom = getTestFile("src/test/resources/cgen/project-to-test/pom.xml");
+ assertNotNull(pom);
+ assertTrue(pom.exists());
+
+ CayenneGeneratorMojo myMojo = (CayenneGeneratorMojo) lookupMojo("cgen",
+ pom);
+ assertNotNull(myMojo);
+ myMojo.execute();
+
+ File superTestEntity = new File(
+ "target/cayenneGeneratedClasses/superPkg/_TestEntity.txt");
+ File testEntity = new File(
+ "target/cayenneGeneratedClasses/pack/TestEntity.txt");
+
+ File superEmbeddable = new File(
+ "target/cayenneGeneratedClasses/superPkg/_Embeddable.txt");
+ File embeddable = new File(
+ "target/cayenneGeneratedClasses/pack/Embeddable.txt");
+
+ File superNotIncludedEntity = new File(
+ "target/cayenneGeneratedClasses/pack/_NotIncludedEntity.txt");
+
+ File notIncludedEntity = new File(
+ "target/cayenneGeneratedClasses/pack/NotIncludedEntity.txt");
+
+ File superExcludedEntity = new File(
+ "target/cayenneGeneratedClasses/pack/_TestExcludedEntity.txt");
+ File excludedEntity = new File(
+ "target/cayenneGeneratedClasses/pack/TestExcludedEntity.txt");
+
+ assertTrue(superTestEntity.exists());
+ assertTrue(testEntity.exists());
+
+ assertTrue(superEmbeddable.exists());
+ assertTrue(embeddable.exists());
+
+ assertFalse(superNotIncludedEntity.exists());
+ assertFalse(notIncludedEntity.exists());
+
+ assertFalse(superExcludedEntity.exists());
+ assertFalse(excludedEntity.exists());
+
+ String content = FileUtils.readFileToString(superTestEntity);
+ assertTrue(content.contains("public static final Property<List<TestRelEntity>> ADDITIONAL_REL = Property.create(\"additionalRel\", List.class);"));
+ assertTrue(content.contains("public void addToAdditionalRel(TestRelEntity obj)"));
+ assertTrue(content.contains("public void removeFromAdditionalRel(TestRelEntity obj)"));
+
+ }
+}
http://git-wip-us.apache.org/repos/asf/cayenne/blob/2cddff91/plugins/cayenne-maven-plugin/src/test/java/org/apache/cayenne/tools/DbImporterMojoConfigurationTest.java
----------------------------------------------------------------------
diff --git a/plugins/cayenne-maven-plugin/src/test/java/org/apache/cayenne/tools/DbImporterMojoConfigurationTest.java b/plugins/cayenne-maven-plugin/src/test/java/org/apache/cayenne/tools/DbImporterMojoConfigurationTest.java
new file mode 100644
index 0000000..5b871f6
--- /dev/null
+++ b/plugins/cayenne-maven-plugin/src/test/java/org/apache/cayenne/tools/DbImporterMojoConfigurationTest.java
@@ -0,0 +1,125 @@
+/*****************************************************************
+ * 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.
+ ****************************************************************/
+package org.apache.cayenne.tools;
+
+import org.apache.cayenne.dbimport.Catalog;
+import org.apache.cayenne.dbimport.Schema;
+import org.apache.cayenne.dbsync.reverse.filters.FiltersConfig;
+import org.apache.cayenne.dbsync.reverse.filters.IncludeTableFilter;
+import org.apache.cayenne.dbsync.reverse.filters.PatternFilter;
+import org.apache.cayenne.dbsync.reverse.filters.TableFilter;
+import org.apache.cayenne.tools.dbimport.DbImportConfiguration;
+import org.apache.commons.logging.Log;
+import org.apache.maven.plugin.testing.AbstractMojoTestCase;
+import org.junit.Test;
+
+import java.util.HashMap;
+import java.util.Map;
+import java.util.TreeSet;
+import java.util.regex.Pattern;
+
+import static org.apache.cayenne.dbimport.DefaultReverseEngineeringLoaderTest.assertCatalog;
+import static org.apache.cayenne.dbimport.DefaultReverseEngineeringLoaderTest.assertCatalogAndSchema;
+import static org.apache.cayenne.dbimport.DefaultReverseEngineeringLoaderTest.assertFlat;
+import static org.apache.cayenne.dbimport.DefaultReverseEngineeringLoaderTest.assertSchemaContent;
+import static org.apache.cayenne.dbimport.DefaultReverseEngineeringLoaderTest.assertSkipPrimaryKeyLoading;
+import static org.apache.cayenne.dbimport.DefaultReverseEngineeringLoaderTest.assertSkipRelationshipsLoading;
+import static org.apache.cayenne.dbimport.DefaultReverseEngineeringLoaderTest.assertTableTypes;
+import static org.mockito.Mockito.mock;
+
+public class DbImporterMojoConfigurationTest extends AbstractMojoTestCase {
+
+ @Test
+ public void testLoadCatalog() throws Exception {
+ Map<String, Catalog> catalogs = new HashMap<>();
+ for (Catalog c : getCdbImport("pom-catalog.xml").getReverseEngineering().getCatalogs()) {
+ catalogs.put(c.getName(), c);
+ }
+
+ assertEquals(3, catalogs.size());
+ Catalog c3 = catalogs.get("catalog-name-03");
+ assertNotNull(c3);
+ assertCatalog(c3);
+ }
+
+ @Test
+ public void testLoadSchema() throws Exception {
+ Map<String, Schema> schemas = new HashMap<>();
+ for (Schema s : getCdbImport("pom-schema.xml").getReverseEngineering().getSchemas()) {
+ schemas.put(s.getName(), s);
+ }
+
+ assertEquals(3, schemas.size());
+ Schema s3 = schemas.get("schema-name-03");
+ assertNotNull(s3);
+ assertSchemaContent(s3);
+ }
+
+ @Test
+ public void testLoadSchema2() throws Exception {
+ FiltersConfig filters = getCdbImport("pom-schema-2.xml").createConfig(mock(Log.class))
+ .getDbLoaderConfig().getFiltersConfig();
+
+ TreeSet<IncludeTableFilter> includes = new TreeSet<>();
+ includes.add(new IncludeTableFilter(null, new PatternFilter().exclude("^ETL_.*")));
+
+ TreeSet<Pattern> excludes = new TreeSet<>(PatternFilter.PATTERN_COMPARATOR);
+ excludes.add(PatternFilter.pattern("^ETL_.*"));
+
+ assertEquals(filters.tableFilter(null, "NHL_STATS"),
+ new TableFilter(includes, excludes));
+ }
+
+ @Test
+ public void testLoadCatalogAndSchema() throws Exception {
+ assertCatalogAndSchema(getCdbImport("pom-catalog-and-schema.xml").getReverseEngineering());
+ }
+
+ @Test
+ public void testDefaultPackage() throws Exception {
+ DbImportConfiguration config = getCdbImport("pom-default-package.xml").createConfig(mock(Log.class));
+ assertEquals("com.example.test", config.getDefaultPackage());
+ }
+
+ @Test
+ public void testLoadFlat() throws Exception {
+ assertFlat(getCdbImport("pom-flat.xml").getReverseEngineering());
+ }
+
+ @Test
+ public void testSkipRelationshipsLoading() throws Exception {
+ assertSkipRelationshipsLoading(getCdbImport("pom-skip-relationships-loading.xml").getReverseEngineering());
+ }
+
+ @Test
+ public void testSkipPrimaryKeyLoading() throws Exception {
+ assertSkipPrimaryKeyLoading(getCdbImport("pom-skip-primary-key-loading.xml").getReverseEngineering());
+ }
+
+ @Test
+ public void testTableTypes() throws Exception {
+ assertTableTypes(getCdbImport("pom-table-types.xml").getReverseEngineering());
+ }
+
+ private DbImporterMojo getCdbImport(String pomFileName) throws Exception {
+ return (DbImporterMojo) lookupMojo("cdbimport",
+ getTestFile("src/test/resources/org/apache/cayenne/tools/config/" + pomFileName));
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/cayenne/blob/2cddff91/plugins/cayenne-maven-plugin/src/test/java/org/apache/cayenne/tools/DbImporterMojoTest.java
----------------------------------------------------------------------
diff --git a/plugins/cayenne-maven-plugin/src/test/java/org/apache/cayenne/tools/DbImporterMojoTest.java b/plugins/cayenne-maven-plugin/src/test/java/org/apache/cayenne/tools/DbImporterMojoTest.java
new file mode 100644
index 0000000..7d8cbfe
--- /dev/null
+++ b/plugins/cayenne-maven-plugin/src/test/java/org/apache/cayenne/tools/DbImporterMojoTest.java
@@ -0,0 +1,431 @@
+/*****************************************************************
+ * 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.
+ ****************************************************************/
+package org.apache.cayenne.tools;
+
+import org.apache.cayenne.dbimport.Catalog;
+import org.apache.cayenne.dbimport.IncludeTable;
+import org.apache.cayenne.dbimport.Schema;
+import org.apache.cayenne.test.jdbc.SQLReader;
+import org.apache.cayenne.test.resource.ResourceUtil;
+import org.apache.cayenne.tools.dbimport.DbImportConfiguration;
+import org.apache.commons.logging.Log;
+import org.apache.maven.plugin.MojoExecutionException;
+import org.apache.maven.plugin.testing.AbstractMojoTestCase;
+import org.codehaus.plexus.util.FileUtils;
+import org.custommonkey.xmlunit.DetailedDiff;
+import org.custommonkey.xmlunit.Diff;
+import org.custommonkey.xmlunit.ElementNameAndAttributeQualifier;
+import org.custommonkey.xmlunit.XMLUnit;
+import org.junit.AfterClass;
+import org.junit.BeforeClass;
+import org.junit.Ignore;
+import org.junit.Test;
+
+import java.io.File;
+import java.io.FileReader;
+import java.io.IOException;
+import java.net.URL;
+import java.sql.Connection;
+import java.sql.DriverManager;
+import java.sql.ResultSet;
+import java.sql.SQLException;
+import java.sql.Statement;
+import java.util.Iterator;
+import java.util.Objects;
+
+import static org.apache.commons.lang.StringUtils.isBlank;
+import static org.mockito.Mockito.mock;
+
+
+public class DbImporterMojoTest extends AbstractMojoTestCase {
+
+ private static DerbyManager derbyAssembly;
+
+ static {
+ XMLUnit.setIgnoreWhitespace(true);
+ }
+
+ @BeforeClass
+ public static void beforeClass() throws IOException, SQLException {
+ derbyAssembly = new DerbyManager("target/derby");
+ }
+
+ @AfterClass
+ public static void afterClass() throws IOException, SQLException {
+ derbyAssembly.shutdown();
+ derbyAssembly = null;
+ }
+
+ @Test
+ public void testToParameters_MeaningfulPkTables() throws Exception {
+
+ DbImportConfiguration parameters1 = getCdbImport("dbimporter-pom1.xml").createConfig(mock(Log.class));
+ assertNull(parameters1.getMeaningfulPkTables());
+ assertPathEquals("target/test/org/apache/cayenne/tools/dbimporter-map1.map.xml", parameters1.getTargetDataMap()
+ .getPath());
+
+ assertEquals("x,b*", getCdbImport("dbimporter-pom2.xml").createConfig(mock(Log.class)).getMeaningfulPkTables());
+ assertEquals("*", getCdbImport("dbimporter-pom3.xml").createConfig(mock(Log.class)).getMeaningfulPkTables());
+ }
+
+ public void testToParameters_Map() throws Exception {
+
+ DbImportConfiguration parameters1 = getCdbImport("dbimporter-pom1.xml").createConfig(mock(Log.class));
+ assertNotNull(parameters1.getTargetDataMap());
+ assertPathEquals("target/test/org/apache/cayenne/tools/dbimporter-map1.map.xml", parameters1.getTargetDataMap()
+ .getPath());
+
+ assertNull(getCdbImport("dbimporter-pom2.xml").createConfig(mock(Log.class)).getTargetDataMap());
+ }
+
+ private DbImporterMojo getCdbImport(String pomFileName) throws Exception {
+ return (DbImporterMojo) lookupMojo("cdbimport",
+ getTestFile("src/test/resources/org/apache/cayenne/tools/" + pomFileName));
+ }
+
+ private void assertPathEquals(String expectedPath, String actualPath) {
+ assertEquals(new File(expectedPath), new File(actualPath));
+ }
+
+ @Test
+ public void testImportNewDataMap() throws Exception {
+ test("testImportNewDataMap");
+ }
+
+ @Test
+ public void testImportWithoutChanges() throws Exception {
+ test("testImportWithoutChanges");
+ }
+
+ @Test
+ public void testImportAddTableAndColumn() throws Exception {
+ test("testImportAddTableAndColumn");
+ }
+
+ @Test
+ public void testFilteringWithSchema() throws Exception {
+ test("testFilteringWithSchema");
+ }
+
+ @Test
+ public void testSchemasAndTableExclude() throws Exception {
+ test("testSchemasAndTableExclude");
+ }
+
+ @Test
+ public void testViewsExclude() throws Exception {
+ test("testViewsExclude");
+ }
+
+ @Test
+ public void testTableTypes() throws Exception {
+ test("testTableTypes");
+ }
+
+ @Test
+ public void testDefaultPackage() throws Exception {
+ test("testDefaultPackage");
+ }
+
+ @Test
+ public void testSkipRelationshipsLoading() throws Exception {
+ test("testSkipRelationshipsLoading");
+ }
+
+ @Test
+ public void testSkipPrimaryKeyLoading() throws Exception {
+ test("testSkipPrimaryKeyLoading");
+ }
+
+ @Test
+ public void testOneToOne() throws Exception {
+ test("testOneToOne");
+ }
+
+ /**
+ * Q: what happens if an attribute or relationship is unmapped in the object layer, but then the underlying table
+ * changes.
+ * A: it should not recreate unmapped attributes/relationships. Only add an attribute for the new column.
+ *
+ * @throws Exception
+ */
+ @Test
+ public void testPreserveCustomObjMappings() throws Exception {
+ test("testPreserveCustomObjMappings");
+ }
+
+ /**
+ * Q: what happens if a relationship existed over a column that was later deleted? and \u2018skipRelLoading\u2019 is true
+ * A: it should remove relationship and column
+ *
+ * @throws Exception
+ */
+ @Test
+ public void testPreserveRelationships() throws Exception {
+ test("testPreserveRelationships");
+ }
+
+ /**
+ * By default many-to-many are flattened during reverse engineering.
+ * But if a user un-flattens a given N:M manually, we\u2019d like this choice to be preserved on the next run
+ */
+ @Test
+ public void testUnFlattensManyToMany() throws Exception {
+ // TODO: this should be "xYs" : <db-relationship name="xIes"
+ test("testUnFlattensManyToMany");
+ }
+
+ /**
+ * Make sure any merges preserve custom object layer settings, like "usePrimitives", PK mapping as attribute, etc.
+ */
+ @Test
+ public void testCustomObjectLayerSettings() throws Exception {
+ test("testCustomObjectLayerSettings");
+ }
+
+ @Test
+ public void testDbAttributeChange() throws Exception {
+ test("testDbAttributeChange");
+ }
+
+ @Test
+ public void testForceDataMapSchema() throws Exception {
+ test("testForceDataMapSchema");
+ }
+
+ @Test
+ public void testComplexChangeOrder() throws Exception {
+ test("testComplexChangeOrder");
+ }
+
+ /**
+ * CREATE TABLE APP.A (
+ * id INTEGER NOT NULL,
+ * <p>
+ * PRIMARY KEY (id)
+ * );
+ * <p>
+ * CREATE TABLE APP.A_A (
+ * A1_ID INTEGER NOT NULL,
+ * A2_ID INTEGER NOT NULL,
+ * <p>
+ * PRIMARY KEY (A1_ID, A2_ID),
+ * CONSTRAINT A_A1 FOREIGN KEY (A1_ID) REFERENCES APP.A (ID),
+ * CONSTRAINT A_A2 FOREIGN KEY (A2_ID) REFERENCES APP.A (ID)
+ * );
+ * <p>
+ * If one table has many-to-many relationship with it self ObjEntity should have two
+ * collection attributes in both directions
+ *
+ * @throws Exception
+ */
+ @Test
+ @Ignore("Investigate why on different environment entity relationships order are different.")
+ public void te_stFlattensManyToManyWithRecursiveLink() throws Exception {
+ test("testFlattensManyToManyWithRecursiveLink");
+ }
+
+ @Test
+ public void testFkAttributeRename() throws Exception {
+ test("testFkAttributeRename");
+ }
+
+ @Test
+ public void testFilteringConfig() throws Exception {
+ DbImporterMojo cdbImport = getCdbImport("config/pom-01.xml");
+
+ assertEquals(2, cdbImport.getReverseEngineering().getCatalogs().size());
+ Iterator<Catalog> iterator = cdbImport.getReverseEngineering().getCatalogs().iterator();
+ assertEquals("catalog-name-01", iterator.next().getName());
+
+ Catalog catalog = iterator.next();
+ assertEquals("catalog-name-02", catalog.getName());
+ Iterator<Schema> schemaIterator = catalog.getSchemas().iterator();
+
+ assertEquals("schema-name-01", schemaIterator.next().getName());
+
+ Schema schema = schemaIterator.next();
+ assertEquals("schema-name-02", schema.getName());
+
+ Iterator<IncludeTable> includeTableIterator = schema.getIncludeTables().iterator();
+ assertEquals("incTable-01", includeTableIterator.next().getPattern());
+
+ IncludeTable includeTable = includeTableIterator.next();
+ assertEquals("incTable-02", includeTable.getPattern());
+ assertEquals("includeColumn-01", includeTable.getIncludeColumns().iterator().next().getPattern());
+ assertEquals("excludeColumn-01", includeTable.getExcludeColumns().iterator().next().getPattern());
+
+ assertEquals("includeColumn-02", schema.getIncludeColumns().iterator().next().getPattern());
+ assertEquals("excludeColumn-02", schema.getExcludeColumns().iterator().next().getPattern());
+
+ assertEquals("includeColumn-03", catalog.getIncludeColumns().iterator().next().getPattern());
+ assertEquals("excludeColumn-03", catalog.getExcludeColumns().iterator().next().getPattern());
+
+ schemaIterator = cdbImport.getReverseEngineering().getSchemas().iterator();
+ schema = schemaIterator.next();
+ assertEquals("schema-name-03", schema.getName());
+
+ schema = schemaIterator.next();
+ assertEquals("schema-name-04", schema.getName());
+
+ includeTableIterator = schema.getIncludeTables().iterator();
+ assertEquals("incTable-04", includeTableIterator.next().getPattern());
+ assertEquals("excTable-04", schema.getExcludeTables().iterator().next().getPattern());
+
+ includeTable = includeTableIterator.next();
+ assertEquals("incTable-05", includeTable.getPattern());
+ assertEquals("includeColumn-04", includeTable.getIncludeColumns().iterator().next().getPattern());
+ assertEquals("excludeColumn-04", includeTable.getExcludeColumns().iterator().next().getPattern());
+
+ assertEquals("includeColumn-04", schema.getIncludeColumns().iterator().next().getPattern());
+ assertEquals("excludeColumn-04", schema.getExcludeColumns().iterator().next().getPattern());
+
+ assertEquals("includeColumn-03", catalog.getIncludeColumns().iterator().next().getPattern());
+ assertEquals("excludeColumn-03", catalog.getExcludeColumns().iterator().next().getPattern());
+ }
+
+ @Test
+ public void testSupportsCatalogsOnReverseEngineering() throws Exception {
+ DbImporterMojo cdbImport = getCdbImport("dbimport/testSupportsCatalogsOnReverseEngineering-pom.xml");
+ cdbImport.getReverseEngineering().addCatalog(new Catalog("DbImporterMojoTest2"));
+
+ Exception exceptedException = null;
+ String exceptedMessage = "Your database does not support catalogs on reverse engineering. " +
+ "It allows to connect to only one at the moment. Please don't note catalogs in <dbimport> configuration.";
+
+ try {
+ cdbImport.execute();
+ } catch (MojoExecutionException ex) {
+ exceptedException = ex;
+ }
+
+ assertNotNull(exceptedException);
+ assertEquals(exceptedMessage, exceptedException.getCause().getMessage());
+ }
+
+ private void test(String name) throws Exception {
+ DbImporterMojo cdbImport = getCdbImport("dbimport/" + name + "-pom.xml");
+ File mapFile = cdbImport.getMap();
+ File mapFileCopy = new File(mapFile.getParentFile(), "copy-" + mapFile.getName());
+ if (mapFile.exists()) {
+ FileUtils.copyFile(mapFile, mapFileCopy);
+ cdbImport.setMap(mapFileCopy);
+ } else {
+ mapFileCopy = mapFile;
+ }
+
+ DbImportConfiguration parameters = cdbImport.createConfig(mock(Log.class));
+ prepareDatabase(name, parameters);
+
+ try {
+ cdbImport.execute();
+ verifyResult(mapFile, mapFileCopy);
+ } finally {
+ cleanDb(parameters);
+ }
+ }
+
+ private void cleanDb(DbImportConfiguration dbImportConfiguration) throws Exception {
+
+ // TODO: refactor to common DB management code... E.g. bootique-jdbc-test?
+ // TODO: with in-memory Derby, it is easier to just stop and delete the database.. again see bootique-jdbc-test
+
+ Class.forName(dbImportConfiguration.getDriver()).newInstance();
+
+ try (Connection connection = DriverManager.getConnection(dbImportConfiguration.getUrl())) {
+
+ try (Statement stmt = connection.createStatement()) {
+
+ try (ResultSet views = connection.getMetaData().getTables(null, null, null, new String[]{"VIEW"})) {
+ while (views.next()) {
+ String schema = views.getString("TABLE_SCHEM");
+ execute(stmt, "DROP VIEW " + (isBlank(schema) ? "" : schema + ".") + views.getString("TABLE_NAME"));
+ }
+ }
+
+ try (ResultSet tables = connection.getMetaData().getTables(null, null, null, new String[]{"TABLE"})) {
+ while (tables.next()) {
+ String schema = tables.getString("TABLE_SCHEM");
+ String tableName = tables.getString("TABLE_NAME");
+ String tableNameFull = (isBlank(schema) ? "" : schema + ".") + tableName;
+
+ ResultSet keys = connection.getMetaData().getExportedKeys(null, schema, tableName);
+ while (keys.next()) {
+ String fkTableSchem = keys.getString("FKTABLE_SCHEM");
+ String fkTableName = keys.getString("FKTABLE_NAME");
+ String fkTableNameFull = (isBlank(fkTableSchem) ? "" : fkTableSchem + ".") + fkTableName;
+ execute(stmt, "ALTER TABLE " + fkTableNameFull + " DROP CONSTRAINT " + keys.getString("FK_NAME"));
+ }
+
+ String sql = "DROP TABLE " + tableNameFull;
+ execute(stmt, sql);
+ }
+ }
+
+ try (ResultSet schemas = connection.getMetaData().getSchemas()) {
+ while (schemas.next()) {
+ String schem = schemas.getString("TABLE_SCHEM");
+ if (schem.startsWith("SCHEMA")) {
+ execute(stmt, "DROP SCHEMA " + schem + " RESTRICT");
+ }
+ }
+ }
+ }
+ }
+ }
+
+ private void execute(Statement stmt, String sql) throws SQLException {
+ stmt.execute(sql);
+ }
+
+ private void verifyResult(File map, File mapFileCopy) {
+ try {
+ FileReader control = new FileReader(map.getAbsolutePath() + "-result");
+ FileReader test = new FileReader(mapFileCopy);
+
+ Diff prototype = new Diff(control, test);
+ prototype.overrideElementQualifier(new ElementNameAndAttributeQualifier());
+ DetailedDiff diff = new DetailedDiff(prototype);
+
+ if (!diff.similar()) {
+ fail(diff.toString());
+ }
+ } catch (Exception e) {
+ e.printStackTrace();
+ fail();
+ }
+ }
+
+ private void prepareDatabase(String sqlFile, DbImportConfiguration dbImportConfiguration) throws Exception {
+
+ URL sqlUrl = Objects.requireNonNull(ResourceUtil.getResource(getClass(), "dbimport/" + sqlFile + ".sql"));
+
+ // TODO: refactor to common DB management code... E.g. bootique-jdbc-test?
+
+ Class.forName(dbImportConfiguration.getDriver()).newInstance();
+
+ try (Connection connection = DriverManager.getConnection(dbImportConfiguration.getUrl())) {
+ try (Statement stmt = connection.createStatement();) {
+ for (String sql : SQLReader.statements(sqlUrl, ";")) {
+ stmt.execute(sql);
+ }
+ }
+ }
+ }
+}
http://git-wip-us.apache.org/repos/asf/cayenne/blob/2cddff91/plugins/cayenne-maven-plugin/src/test/java/org/apache/cayenne/tools/DerbyManager.java
----------------------------------------------------------------------
diff --git a/plugins/cayenne-maven-plugin/src/test/java/org/apache/cayenne/tools/DerbyManager.java b/plugins/cayenne-maven-plugin/src/test/java/org/apache/cayenne/tools/DerbyManager.java
new file mode 100644
index 0000000..82faace
--- /dev/null
+++ b/plugins/cayenne-maven-plugin/src/test/java/org/apache/cayenne/tools/DerbyManager.java
@@ -0,0 +1,63 @@
+/*
+ * 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.
+ */
+package org.apache.cayenne.tools;
+
+/**
+ * @since 4.0
+ */
+
+import org.apache.commons.io.FileUtils;
+
+import java.io.File;
+import java.io.IOException;
+import java.io.OutputStream;
+import java.sql.DriverManager;
+import java.sql.SQLException;
+
+public class DerbyManager {
+
+ public static final OutputStream DEV_NULL = new OutputStream() {
+
+ @Override
+ public void write(int b) {
+ }
+ };
+
+ DerbyManager(String location) {
+
+ System.setProperty("derby.stream.error.field", DerbyManager.class.getName() + ".DEV_NULL");
+
+ File derbyDir = new File(location);
+ if (derbyDir.isDirectory()) {
+ try {
+ FileUtils.deleteDirectory(derbyDir);
+ } catch (IOException e) {
+ throw new RuntimeException(e);
+ }
+ }
+ }
+
+ void shutdown() {
+ try {
+ DriverManager.getConnection("jdbc:derby:;shutdown=true");
+ } catch (SQLException e) {
+ // the exception is actually expected on shutdown... go figure...
+ }
+ }
+}
http://git-wip-us.apache.org/repos/asf/cayenne/blob/2cddff91/plugins/cayenne-maven-plugin/src/test/resources/cgen/cayenne-testDomain.xml
----------------------------------------------------------------------
diff --git a/plugins/cayenne-maven-plugin/src/test/resources/cgen/cayenne-testDomain.xml b/plugins/cayenne-maven-plugin/src/test/resources/cgen/cayenne-testDomain.xml
new file mode 100644
index 0000000..3f63c14
--- /dev/null
+++ b/plugins/cayenne-maven-plugin/src/test/resources/cgen/cayenne-testDomain.xml
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="utf-8"?>
+<domain project-version="6">
+ <map name="testDomainMap"/>
+ <map name="testAdditionalMap"/>
+</domain>
http://git-wip-us.apache.org/repos/asf/cayenne/blob/2cddff91/plugins/cayenne-maven-plugin/src/test/resources/cgen/project-to-test/pom.xml
----------------------------------------------------------------------
diff --git a/plugins/cayenne-maven-plugin/src/test/resources/cgen/project-to-test/pom.xml b/plugins/cayenne-maven-plugin/src/test/resources/cgen/project-to-test/pom.xml
new file mode 100644
index 0000000..41d545c
--- /dev/null
+++ b/plugins/cayenne-maven-plugin/src/test/resources/cgen/project-to-test/pom.xml
@@ -0,0 +1,56 @@
+<?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>Test CayenneGeneratorMojo</name>
+
+ <dependencies>
+ <dependency>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ <scope>test</scope>
+ </dependency>
+ </dependencies>
+
+ <build>
+ <plugins>
+ <plugin>
+ <artifactId>maven-cayenne-plugin</artifactId>
+ <configuration>
+ <map>src/test/resources/cgen/testDomainMap.map.xml</map>
+ <destDir>target/cayenneGeneratedClasses</destDir>
+ <additionalMaps>src/test/resources/cgen/</additionalMaps>
+ <outputPattern>*.txt</outputPattern>
+ <makePairs>true</makePairs>
+ <usePkgPath>true</usePkgPath>
+ <superPkg>superPkg</superPkg>
+ <encoding>UTF-8</encoding>
+ <includeEntities>Test*</includeEntities>
+ <excludeEntities>TestExcludedEntity</excludeEntities>
+ <mode>all</mode>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+
+</project>
http://git-wip-us.apache.org/repos/asf/cayenne/blob/2cddff91/plugins/cayenne-maven-plugin/src/test/resources/cgen/testAdditionalMap.map.xml
----------------------------------------------------------------------
diff --git a/plugins/cayenne-maven-plugin/src/test/resources/cgen/testAdditionalMap.map.xml b/plugins/cayenne-maven-plugin/src/test/resources/cgen/testAdditionalMap.map.xml
new file mode 100644
index 0000000..f9a80fb
--- /dev/null
+++ b/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
[7/8] cayenne git commit: CAY-2214 cdbimport: rename
maven-cayenne-plugin - change module and folder name to
"cayenne-maven-plugin" - artifactId still is "maven-cayenne-plugin"
Posted by nt...@apache.org.
http://git-wip-us.apache.org/repos/asf/cayenne/blob/2cddff91/plugins/cayenne-maven-plugin/src/test/resources/cgen/testDomainMap.map.xml
----------------------------------------------------------------------
diff --git a/plugins/cayenne-maven-plugin/src/test/resources/cgen/testDomainMap.map.xml b/plugins/cayenne-maven-plugin/src/test/resources/cgen/testDomainMap.map.xml
new file mode 100644
index 0000000..d0ff3f5
--- /dev/null
+++ b/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/2cddff91/plugins/cayenne-maven-plugin/src/test/resources/org/apache/cayenne/tools/config/pom-01.xml
----------------------------------------------------------------------
diff --git a/plugins/cayenne-maven-plugin/src/test/resources/org/apache/cayenne/tools/config/pom-01.xml b/plugins/cayenne-maven-plugin/src/test/resources/org/apache/cayenne/tools/config/pom-01.xml
new file mode 100644
index 0000000..a4a6955
--- /dev/null
+++ b/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>maven-cayenne-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/2cddff91/plugins/cayenne-maven-plugin/src/test/resources/org/apache/cayenne/tools/config/pom-catalog-and-schema.xml
----------------------------------------------------------------------
diff --git a/plugins/cayenne-maven-plugin/src/test/resources/org/apache/cayenne/tools/config/pom-catalog-and-schema.xml b/plugins/cayenne-maven-plugin/src/test/resources/org/apache/cayenne/tools/config/pom-catalog-and-schema.xml
new file mode 100644
index 0000000..d3828ce
--- /dev/null
+++ b/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>maven-cayenne-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/2cddff91/plugins/cayenne-maven-plugin/src/test/resources/org/apache/cayenne/tools/config/pom-catalog.xml
----------------------------------------------------------------------
diff --git a/plugins/cayenne-maven-plugin/src/test/resources/org/apache/cayenne/tools/config/pom-catalog.xml b/plugins/cayenne-maven-plugin/src/test/resources/org/apache/cayenne/tools/config/pom-catalog.xml
new file mode 100644
index 0000000..9c919e8
--- /dev/null
+++ b/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>maven-cayenne-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/2cddff91/plugins/cayenne-maven-plugin/src/test/resources/org/apache/cayenne/tools/config/pom-default-package.xml
----------------------------------------------------------------------
diff --git a/plugins/cayenne-maven-plugin/src/test/resources/org/apache/cayenne/tools/config/pom-default-package.xml b/plugins/cayenne-maven-plugin/src/test/resources/org/apache/cayenne/tools/config/pom-default-package.xml
new file mode 100644
index 0000000..7f09b88
--- /dev/null
+++ b/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>maven-cayenne-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/2cddff91/plugins/cayenne-maven-plugin/src/test/resources/org/apache/cayenne/tools/config/pom-flat.xml
----------------------------------------------------------------------
diff --git a/plugins/cayenne-maven-plugin/src/test/resources/org/apache/cayenne/tools/config/pom-flat.xml b/plugins/cayenne-maven-plugin/src/test/resources/org/apache/cayenne/tools/config/pom-flat.xml
new file mode 100644
index 0000000..6987454
--- /dev/null
+++ b/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>maven-cayenne-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/2cddff91/plugins/cayenne-maven-plugin/src/test/resources/org/apache/cayenne/tools/config/pom-mapping.xml
----------------------------------------------------------------------
diff --git a/plugins/cayenne-maven-plugin/src/test/resources/org/apache/cayenne/tools/config/pom-mapping.xml b/plugins/cayenne-maven-plugin/src/test/resources/org/apache/cayenne/tools/config/pom-mapping.xml
new file mode 100644
index 0000000..10c99da
--- /dev/null
+++ b/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>maven-cayenne-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/2cddff91/plugins/cayenne-maven-plugin/src/test/resources/org/apache/cayenne/tools/config/pom-schema-2.xml
----------------------------------------------------------------------
diff --git a/plugins/cayenne-maven-plugin/src/test/resources/org/apache/cayenne/tools/config/pom-schema-2.xml b/plugins/cayenne-maven-plugin/src/test/resources/org/apache/cayenne/tools/config/pom-schema-2.xml
new file mode 100644
index 0000000..05342fd
--- /dev/null
+++ b/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>maven-cayenne-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/2cddff91/plugins/cayenne-maven-plugin/src/test/resources/org/apache/cayenne/tools/config/pom-schema.xml
----------------------------------------------------------------------
diff --git a/plugins/cayenne-maven-plugin/src/test/resources/org/apache/cayenne/tools/config/pom-schema.xml b/plugins/cayenne-maven-plugin/src/test/resources/org/apache/cayenne/tools/config/pom-schema.xml
new file mode 100644
index 0000000..11804fc
--- /dev/null
+++ b/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>maven-cayenne-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/2cddff91/plugins/cayenne-maven-plugin/src/test/resources/org/apache/cayenne/tools/config/pom-skip-primary-key-loading.xml
----------------------------------------------------------------------
diff --git a/plugins/cayenne-maven-plugin/src/test/resources/org/apache/cayenne/tools/config/pom-skip-primary-key-loading.xml b/plugins/cayenne-maven-plugin/src/test/resources/org/apache/cayenne/tools/config/pom-skip-primary-key-loading.xml
new file mode 100644
index 0000000..2c3e6c5
--- /dev/null
+++ b/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>maven-cayenne-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/2cddff91/plugins/cayenne-maven-plugin/src/test/resources/org/apache/cayenne/tools/config/pom-skip-relationships-loading.xml
----------------------------------------------------------------------
diff --git a/plugins/cayenne-maven-plugin/src/test/resources/org/apache/cayenne/tools/config/pom-skip-relationships-loading.xml b/plugins/cayenne-maven-plugin/src/test/resources/org/apache/cayenne/tools/config/pom-skip-relationships-loading.xml
new file mode 100644
index 0000000..9291871
--- /dev/null
+++ b/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>maven-cayenne-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/2cddff91/plugins/cayenne-maven-plugin/src/test/resources/org/apache/cayenne/tools/config/pom-table-types.xml
----------------------------------------------------------------------
diff --git a/plugins/cayenne-maven-plugin/src/test/resources/org/apache/cayenne/tools/config/pom-table-types.xml b/plugins/cayenne-maven-plugin/src/test/resources/org/apache/cayenne/tools/config/pom-table-types.xml
new file mode 100644
index 0000000..b8d3ad3
--- /dev/null
+++ b/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>maven-cayenne-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/2cddff91/plugins/cayenne-maven-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testComplexChangeOrder-pom.xml
----------------------------------------------------------------------
diff --git a/plugins/cayenne-maven-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testComplexChangeOrder-pom.xml b/plugins/cayenne-maven-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testComplexChangeOrder-pom.xml
new file mode 100644
index 0000000..6e09d8a
--- /dev/null
+++ b/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>maven-cayenne-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/2cddff91/plugins/cayenne-maven-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testComplexChangeOrder.map.xml
----------------------------------------------------------------------
diff --git a/plugins/cayenne-maven-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testComplexChangeOrder.map.xml b/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/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/2cddff91/plugins/cayenne-maven-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testComplexChangeOrder.map.xml-result
----------------------------------------------------------------------
diff --git a/plugins/cayenne-maven-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testComplexChangeOrder.map.xml-result b/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/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/2cddff91/plugins/cayenne-maven-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testComplexChangeOrder.sql
----------------------------------------------------------------------
diff --git a/plugins/cayenne-maven-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testComplexChangeOrder.sql b/plugins/cayenne-maven-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testComplexChangeOrder.sql
new file mode 100644
index 0000000..9885bc7
--- /dev/null
+++ b/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/2cddff91/plugins/cayenne-maven-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testCustomObjectLayerSettings-pom.xml
----------------------------------------------------------------------
diff --git a/plugins/cayenne-maven-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testCustomObjectLayerSettings-pom.xml b/plugins/cayenne-maven-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testCustomObjectLayerSettings-pom.xml
new file mode 100644
index 0000000..8d31eaf
--- /dev/null
+++ b/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>maven-cayenne-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/2cddff91/plugins/cayenne-maven-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testCustomObjectLayerSettings.map.xml
----------------------------------------------------------------------
diff --git a/plugins/cayenne-maven-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testCustomObjectLayerSettings.map.xml b/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/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/2cddff91/plugins/cayenne-maven-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testCustomObjectLayerSettings.map.xml-result
----------------------------------------------------------------------
diff --git a/plugins/cayenne-maven-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testCustomObjectLayerSettings.map.xml-result b/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/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/2cddff91/plugins/cayenne-maven-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testCustomObjectLayerSettings.sql
----------------------------------------------------------------------
diff --git a/plugins/cayenne-maven-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testCustomObjectLayerSettings.sql b/plugins/cayenne-maven-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testCustomObjectLayerSettings.sql
new file mode 100644
index 0000000..fe9ccd5
--- /dev/null
+++ b/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/2cddff91/plugins/cayenne-maven-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testDbAttributeChange-pom.xml
----------------------------------------------------------------------
diff --git a/plugins/cayenne-maven-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testDbAttributeChange-pom.xml b/plugins/cayenne-maven-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testDbAttributeChange-pom.xml
new file mode 100644
index 0000000..ad0f98f
--- /dev/null
+++ b/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>maven-cayenne-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/2cddff91/plugins/cayenne-maven-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testDbAttributeChange.map.xml
----------------------------------------------------------------------
diff --git a/plugins/cayenne-maven-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testDbAttributeChange.map.xml b/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/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/2cddff91/plugins/cayenne-maven-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testDbAttributeChange.map.xml-result
----------------------------------------------------------------------
diff --git a/plugins/cayenne-maven-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testDbAttributeChange.map.xml-result b/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/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/2cddff91/plugins/cayenne-maven-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testDbAttributeChange.sql
----------------------------------------------------------------------
diff --git a/plugins/cayenne-maven-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testDbAttributeChange.sql b/plugins/cayenne-maven-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testDbAttributeChange.sql
new file mode 100644
index 0000000..c93c802
--- /dev/null
+++ b/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/2cddff91/plugins/cayenne-maven-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testDefaultPackage-pom.xml
----------------------------------------------------------------------
diff --git a/plugins/cayenne-maven-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testDefaultPackage-pom.xml b/plugins/cayenne-maven-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testDefaultPackage-pom.xml
new file mode 100644
index 0000000..2a6828f
--- /dev/null
+++ b/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>maven-cayenne-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/2cddff91/plugins/cayenne-maven-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testDefaultPackage.map.xml-result
----------------------------------------------------------------------
diff --git a/plugins/cayenne-maven-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testDefaultPackage.map.xml-result b/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/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/2cddff91/plugins/cayenne-maven-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testDefaultPackage.sql
----------------------------------------------------------------------
diff --git a/plugins/cayenne-maven-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testDefaultPackage.sql b/plugins/cayenne-maven-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testDefaultPackage.sql
new file mode 100644
index 0000000..279065c
--- /dev/null
+++ b/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)
+);
http://git-wip-us.apache.org/repos/asf/cayenne/blob/2cddff91/plugins/cayenne-maven-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testFilteringWithSchema-pom.xml
----------------------------------------------------------------------
diff --git a/plugins/cayenne-maven-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testFilteringWithSchema-pom.xml b/plugins/cayenne-maven-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testFilteringWithSchema-pom.xml
new file mode 100644
index 0000000..de84543
--- /dev/null
+++ b/plugins/cayenne-maven-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testFilteringWithSchema-pom.xml
@@ -0,0 +1,45 @@
+<?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>maven-cayenne-plugin</artifactId>
+ <configuration>
+ <map>target/test-classes/org/apache/cayenne/tools/dbimport/testFilteringWithSchema.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>
[6/8] cayenne git commit: CAY-2214 cdbimport: rename
maven-cayenne-plugin - change module and folder name to
"cayenne-maven-plugin" - artifactId still is "maven-cayenne-plugin"
Posted by nt...@apache.org.
http://git-wip-us.apache.org/repos/asf/cayenne/blob/2cddff91/plugins/cayenne-maven-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testFilteringWithSchema.map.xml-result
----------------------------------------------------------------------
diff --git a/plugins/cayenne-maven-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testFilteringWithSchema.map.xml-result b/plugins/cayenne-maven-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testFilteringWithSchema.map.xml-result
new file mode 100644
index 0000000..a65e271
--- /dev/null
+++ b/plugins/cayenne-maven-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testFilteringWithSchema.map.xml-result
@@ -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.
+-->
+<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="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="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>
+</data-map>
http://git-wip-us.apache.org/repos/asf/cayenne/blob/2cddff91/plugins/cayenne-maven-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testFilteringWithSchema.sql
----------------------------------------------------------------------
diff --git a/plugins/cayenne-maven-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testFilteringWithSchema.sql b/plugins/cayenne-maven-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testFilteringWithSchema.sql
new file mode 100644
index 0000000..dba8da6
--- /dev/null
+++ b/plugins/cayenne-maven-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testFilteringWithSchema.sql
@@ -0,0 +1,64 @@
+-- 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)
+);
+
+CREATE SCHEMA schema_02;
+SET SCHEMA schema_02;
+
+CREATE TABLE schema_02.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_02.Child (
+ id INTEGER NOT NULL,
+ Parent_id CHAR(25),
+ COL3 DECIMAL(10,2),
+ COL4 VARCHAR(25),
+ COL5 DATE,
+
+ PRIMARY KEY (id)
+);
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/cayenne/blob/2cddff91/plugins/cayenne-maven-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testFkAttributeRename-pom.xml
----------------------------------------------------------------------
diff --git a/plugins/cayenne-maven-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testFkAttributeRename-pom.xml b/plugins/cayenne-maven-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testFkAttributeRename-pom.xml
new file mode 100644
index 0000000..dd50897
--- /dev/null
+++ b/plugins/cayenne-maven-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testFkAttributeRename-pom.xml
@@ -0,0 +1,49 @@
+<?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>maven-cayenne-plugin</artifactId>
+ <configuration>
+ <map>target/test-classes/org/apache/cayenne/tools/dbimport/testFkAttributeRename.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/2cddff91/plugins/cayenne-maven-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testFkAttributeRename.map.xml
----------------------------------------------------------------------
diff --git a/plugins/cayenne-maven-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testFkAttributeRename.map.xml b/plugins/cayenne-maven-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testFkAttributeRename.map.xml
new file mode 100644
index 0000000..948e121
--- /dev/null
+++ b/plugins/cayenne-maven-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testFkAttributeRename.map.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.
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~-->
+<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="id" type="INTEGER" length="10"/>
+ <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="Child" className="Child" dbEntityName="CHILD">
+ </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>
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/cayenne/blob/2cddff91/plugins/cayenne-maven-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testFkAttributeRename.map.xml-result
----------------------------------------------------------------------
diff --git a/plugins/cayenne-maven-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testFkAttributeRename.map.xml-result b/plugins/cayenne-maven-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testFkAttributeRename.map.xml-result
new file mode 100644
index 0000000..d10b90d
--- /dev/null
+++ b/plugins/cayenne-maven-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testFkAttributeRename.map.xml-result
@@ -0,0 +1,45 @@
+<?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="PAR" type="INTEGER" length="10"/>
+ <db-attribute name="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="Child" className="Child" dbEntityName="CHILD">
+ </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="PAR" target="id"/>
+ </db-relationship>
+ <db-relationship name="children" source="PARENT" target="CHILD" toMany="true">
+ <db-attribute-pair source="id" target="PAR"/>
+ </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/2cddff91/plugins/cayenne-maven-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testFkAttributeRename.sql
----------------------------------------------------------------------
diff --git a/plugins/cayenne-maven-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testFkAttributeRename.sql b/plugins/cayenne-maven-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testFkAttributeRename.sql
new file mode 100644
index 0000000..07a65a9
--- /dev/null
+++ b/plugins/cayenne-maven-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testFkAttributeRename.sql
@@ -0,0 +1,33 @@
+-- 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,
+ PRIMARY KEY (id)
+);
+
+CREATE TABLE schema_01.child (
+ id INTEGER,
+ par INTEGER
+);
+
+ALTER TABLE schema_01.child
+ ADD FOREIGN KEY (par)
+ REFERENCES schema_01.parent (id);
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/cayenne/blob/2cddff91/plugins/cayenne-maven-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testFlattensManyToManyWithRecursiveLink-pom.xml
----------------------------------------------------------------------
diff --git a/plugins/cayenne-maven-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testFlattensManyToManyWithRecursiveLink-pom.xml b/plugins/cayenne-maven-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testFlattensManyToManyWithRecursiveLink-pom.xml
new file mode 100644
index 0000000..1bcefa6
--- /dev/null
+++ b/plugins/cayenne-maven-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testFlattensManyToManyWithRecursiveLink-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>maven-cayenne-plugin</artifactId>
+ <configuration>
+ <map>target/test-classes/org/apache/cayenne/tools/dbimport/testFlattensManyToManyWithRecursiveLink.map.xml</map>
+ <dataSource>
+ <driver>org.apache.derby.jdbc.EmbeddedDriver</driver>
+ <url>jdbc:derby:memory:DbImporterMojoTest;create=true</url>
+ </dataSource>
+ <dbimport>
+ <defaultPackage>org.not.my.home</defaultPackage>
+ </dbimport>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+
+</project>
http://git-wip-us.apache.org/repos/asf/cayenne/blob/2cddff91/plugins/cayenne-maven-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testFlattensManyToManyWithRecursiveLink.map.xml-result
----------------------------------------------------------------------
diff --git a/plugins/cayenne-maven-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testFlattensManyToManyWithRecursiveLink.map.xml-result b/plugins/cayenne-maven-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testFlattensManyToManyWithRecursiveLink.map.xml-result
new file mode 100644
index 0000000..8263273
--- /dev/null
+++ b/plugins/cayenne-maven-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testFlattensManyToManyWithRecursiveLink.map.xml-result
@@ -0,0 +1,48 @@
+<?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="org.not.my.home"/>
+ <db-entity name="A" schema="APP">
+ <db-attribute name="ID" type="INTEGER" isPrimaryKey="true" isMandatory="true" length="10"/>
+ </db-entity>
+ <db-entity name="A_A" schema="APP">
+ <db-attribute name="A1_ID" type="INTEGER" isPrimaryKey="true" isMandatory="true" length="10"/>
+ <db-attribute name="A2_ID" type="INTEGER" isPrimaryKey="true" isMandatory="true" length="10"/>
+ </db-entity>
+ <obj-entity name="A" className="org.not.my.home.A" dbEntityName="A">
+ </obj-entity>
+ <db-relationship name="aAArray" source="A" target="A_A" toDependentPK="true" toMany="true">
+ <db-attribute-pair source="ID" target="A1_ID"/>
+ </db-relationship>
+ <db-relationship name="aAArray1" source="A" target="A_A" toDependentPK="true" toMany="true">
+ <db-attribute-pair source="ID" target="A2_ID"/>
+ </db-relationship>
+ <db-relationship name="toA" source="A_A" target="A" toMany="false">
+ <db-attribute-pair source="A1_ID" target="ID"/>
+ </db-relationship>
+ <db-relationship name="toA1" source="A_A" target="A" toMany="false">
+ <db-attribute-pair source="A2_ID" target="ID"/>
+ </db-relationship>
+ <obj-relationship name="aArray" source="A" target="A" db-relationship-path="aAArray.toA1"/>
+ <obj-relationship name="aArray1" source="A" target="A" db-relationship-path="aAArray1.toA"/>
+</data-map>
http://git-wip-us.apache.org/repos/asf/cayenne/blob/2cddff91/plugins/cayenne-maven-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testFlattensManyToManyWithRecursiveLink.sql
----------------------------------------------------------------------
diff --git a/plugins/cayenne-maven-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testFlattensManyToManyWithRecursiveLink.sql b/plugins/cayenne-maven-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testFlattensManyToManyWithRecursiveLink.sql
new file mode 100644
index 0000000..9df54ab
--- /dev/null
+++ b/plugins/cayenne-maven-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testFlattensManyToManyWithRecursiveLink.sql
@@ -0,0 +1,31 @@
+-- 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 TABLE APP.A (
+ id INTEGER NOT NULL,
+
+ PRIMARY KEY (id)
+);
+
+CREATE TABLE APP.A_A (
+ A1_ID INTEGER NOT NULL,
+ A2_ID INTEGER NOT NULL,
+
+ PRIMARY KEY (A1_ID, A2_ID),
+ CONSTRAINT A_A1 FOREIGN KEY (A1_ID) REFERENCES APP.A (ID),
+ CONSTRAINT A_A2 FOREIGN KEY (A2_ID) REFERENCES APP.A (ID)
+);
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/cayenne/blob/2cddff91/plugins/cayenne-maven-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testForceDataMapSchema-pom.xml
----------------------------------------------------------------------
diff --git a/plugins/cayenne-maven-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testForceDataMapSchema-pom.xml b/plugins/cayenne-maven-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testForceDataMapSchema-pom.xml
new file mode 100644
index 0000000..e1bbd50
--- /dev/null
+++ b/plugins/cayenne-maven-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testForceDataMapSchema-pom.xml
@@ -0,0 +1,50 @@
+<?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>maven-cayenne-plugin</artifactId>
+ <configuration>
+ <map>target/test-classes/org/apache/cayenne/tools/dbimport/testForceDataMapSchema.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>
+ <forceDataMapCatalog>true</forceDataMapCatalog>
+ <forceDataMapSchema>true</forceDataMapSchema>
+
+ <schema>SCHEMA_01</schema>
+ </dbimport>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+
+</project>
http://git-wip-us.apache.org/repos/asf/cayenne/blob/2cddff91/plugins/cayenne-maven-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testForceDataMapSchema.map.xml
----------------------------------------------------------------------
diff --git a/plugins/cayenne-maven-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testForceDataMapSchema.map.xml b/plugins/cayenne-maven-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testForceDataMapSchema.map.xml
new file mode 100644
index 0000000..1d9dea0
--- /dev/null
+++ b/plugins/cayenne-maven-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testForceDataMapSchema.map.xml
@@ -0,0 +1,26 @@
+<?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="defaultCatalog" value="XCATALOG"/>
+</data-map>
http://git-wip-us.apache.org/repos/asf/cayenne/blob/2cddff91/plugins/cayenne-maven-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testForceDataMapSchema.map.xml-result
----------------------------------------------------------------------
diff --git a/plugins/cayenne-maven-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testForceDataMapSchema.map.xml-result b/plugins/cayenne-maven-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testForceDataMapSchema.map.xml-result
new file mode 100644
index 0000000..0eaaffd
--- /dev/null
+++ b/plugins/cayenne-maven-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testForceDataMapSchema.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="defaultCatalog" value="XCATALOG"/>
+ <db-entity name="CHILD" catalog="XCATALOG">
+ <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" catalog="XCATALOG">
+ <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/2cddff91/plugins/cayenne-maven-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testForceDataMapSchema.sql
----------------------------------------------------------------------
diff --git a/plugins/cayenne-maven-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testForceDataMapSchema.sql b/plugins/cayenne-maven-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testForceDataMapSchema.sql
new file mode 100644
index 0000000..279065c
--- /dev/null
+++ b/plugins/cayenne-maven-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testForceDataMapSchema.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)
+);
http://git-wip-us.apache.org/repos/asf/cayenne/blob/2cddff91/plugins/cayenne-maven-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testImportAddTableAndColumn-pom.xml
----------------------------------------------------------------------
diff --git a/plugins/cayenne-maven-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testImportAddTableAndColumn-pom.xml b/plugins/cayenne-maven-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testImportAddTableAndColumn-pom.xml
new file mode 100644
index 0000000..598607d
--- /dev/null
+++ b/plugins/cayenne-maven-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testImportAddTableAndColumn-pom.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">
+
+ <name>DbImporterMojo Test1</name>
+
+ <build>
+ <plugins>
+ <plugin>
+ <artifactId>maven-cayenne-plugin</artifactId>
+ <configuration>
+ <map>target/test-classes/org/apache/cayenne/tools/dbimport/testImportAddTableAndColumn.map.xml</map>
+ <dataSource>
+ <driver>org.apache.derby.jdbc.EmbeddedDriver</driver>
+ <url>jdbc:derby:memory:DbImporterMojoTest;create=true</url>
+ </dataSource>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+
+</project>
http://git-wip-us.apache.org/repos/asf/cayenne/blob/2cddff91/plugins/cayenne-maven-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testImportAddTableAndColumn.map.xml
----------------------------------------------------------------------
diff --git a/plugins/cayenne-maven-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testImportAddTableAndColumn.map.xml b/plugins/cayenne-maven-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testImportAddTableAndColumn.map.xml
new file mode 100644
index 0000000..2317476
--- /dev/null
+++ b/plugins/cayenne-maven-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testImportAddTableAndColumn.map.xml
@@ -0,0 +1,37 @@
+<?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="testImportAddTableAndColumn" schema="APP">
+ <db-attribute name="COL1" type="INTEGER" isPrimaryKey="true" isMandatory="true" length="10"/>
+ <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-entity>
+ <obj-entity name="testImportAddTableAndColumn" className="TestTable" dbEntityName="testImportAddTableAndColumn">
+ <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/2cddff91/plugins/cayenne-maven-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testImportAddTableAndColumn.map.xml-result
----------------------------------------------------------------------
diff --git a/plugins/cayenne-maven-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testImportAddTableAndColumn.map.xml-result b/plugins/cayenne-maven-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testImportAddTableAndColumn.map.xml-result
new file mode 100644
index 0000000..a5dd466
--- /dev/null
+++ b/plugins/cayenne-maven-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testImportAddTableAndColumn.map.xml-result
@@ -0,0 +1,50 @@
+<?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="APP">
+ <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="APP">
+ <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="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>
+</data-map>
http://git-wip-us.apache.org/repos/asf/cayenne/blob/2cddff91/plugins/cayenne-maven-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testImportAddTableAndColumn.sql
----------------------------------------------------------------------
diff --git a/plugins/cayenne-maven-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testImportAddTableAndColumn.sql b/plugins/cayenne-maven-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testImportAddTableAndColumn.sql
new file mode 100644
index 0000000..0bdef9a
--- /dev/null
+++ b/plugins/cayenne-maven-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testImportAddTableAndColumn.sql
@@ -0,0 +1,37 @@
+-- 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 TABLE Parent (
+ id INTEGER NOT NULL,
+ COL2 CHAR(25),
+ COL3 DECIMAL(10,2),
+ COL4 VARCHAR(25),
+ COL5 DATE,
+
+ PRIMARY KEY (id),
+ UNIQUE (COL3)
+);
+
+CREATE TABLE Child (
+ id INTEGER NOT NULL,
+ Parent_id CHAR(25),
+ COL3 DECIMAL(10,2),
+ COL4 VARCHAR(25),
+ COL5 DATE,
+
+ PRIMARY KEY (id)
+);
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/cayenne/blob/2cddff91/plugins/cayenne-maven-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testImportNewDataMap-pom.xml
----------------------------------------------------------------------
diff --git a/plugins/cayenne-maven-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testImportNewDataMap-pom.xml b/plugins/cayenne-maven-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testImportNewDataMap-pom.xml
new file mode 100644
index 0000000..440d340
--- /dev/null
+++ b/plugins/cayenne-maven-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testImportNewDataMap-pom.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">
+
+ <name>DbImporterMojo Test1</name>
+
+ <build>
+ <plugins>
+ <plugin>
+ <artifactId>maven-cayenne-plugin</artifactId>
+ <configuration>
+ <map>target/test-classes/org/apache/cayenne/tools/dbimport/testImportNewDataMap.map.xml</map>
+ <dataSource>
+ <driver>org.apache.derby.jdbc.EmbeddedDriver</driver>
+ <url>jdbc:derby:memory:DbImporterMojoTest;create=true</url>
+ </dataSource>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+
+</project>
http://git-wip-us.apache.org/repos/asf/cayenne/blob/2cddff91/plugins/cayenne-maven-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testImportNewDataMap.map.xml-result
----------------------------------------------------------------------
diff --git a/plugins/cayenne-maven-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testImportNewDataMap.map.xml-result b/plugins/cayenne-maven-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testImportNewDataMap.map.xml-result
new file mode 100644
index 0000000..6133ac4
--- /dev/null
+++ b/plugins/cayenne-maven-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testImportNewDataMap.map.xml-result
@@ -0,0 +1,37 @@
+<?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="TEST_TABLE" schema="APP">
+ <db-attribute name="COL1" type="INTEGER" isPrimaryKey="true" isMandatory="true" length="10"/>
+ <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-entity>
+ <obj-entity name="TestTable" className="TestTable" dbEntityName="TEST_TABLE">
+ <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/2cddff91/plugins/cayenne-maven-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testImportNewDataMap.sql
----------------------------------------------------------------------
diff --git a/plugins/cayenne-maven-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testImportNewDataMap.sql b/plugins/cayenne-maven-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testImportNewDataMap.sql
new file mode 100644
index 0000000..cb5b3c6
--- /dev/null
+++ b/plugins/cayenne-maven-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testImportNewDataMap.sql
@@ -0,0 +1,27 @@
+-- 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 TABLE TEST_TABLE (
+ COL1 INTEGER NOT NULL,
+ COL2 CHAR(25),
+ COL3 DECIMAL(10,2),
+ COL4 VARCHAR(25),
+ COL5 DATE,
+
+ PRIMARY KEY (COL1),
+ UNIQUE (COL3)
+)
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/cayenne/blob/2cddff91/plugins/cayenne-maven-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testImportWithoutChanges-pom.xml
----------------------------------------------------------------------
diff --git a/plugins/cayenne-maven-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testImportWithoutChanges-pom.xml b/plugins/cayenne-maven-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testImportWithoutChanges-pom.xml
new file mode 100644
index 0000000..c1affd7
--- /dev/null
+++ b/plugins/cayenne-maven-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testImportWithoutChanges-pom.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">
+
+ <name>DbImporterMojo Test1</name>
+
+ <build>
+ <plugins>
+ <plugin>
+ <artifactId>maven-cayenne-plugin</artifactId>
+ <configuration>
+ <map>target/test-classes/org/apache/cayenne/tools/dbimport/testImportWithoutChanges.map.xml</map>
+ <dataSource>
+ <driver>org.apache.derby.jdbc.EmbeddedDriver</driver>
+ <url>jdbc:derby:memory:DbImporterMojoTest;create=true</url>
+ </dataSource>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+
+</project>
http://git-wip-us.apache.org/repos/asf/cayenne/blob/2cddff91/plugins/cayenne-maven-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testImportWithoutChanges.map.xml
----------------------------------------------------------------------
diff --git a/plugins/cayenne-maven-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testImportWithoutChanges.map.xml b/plugins/cayenne-maven-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testImportWithoutChanges.map.xml
new file mode 100644
index 0000000..a22e016
--- /dev/null
+++ b/plugins/cayenne-maven-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testImportWithoutChanges.map.xml
@@ -0,0 +1,37 @@
+<?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="testImportWithoutChanges" schema="APP">
+ <db-attribute name="COL1" type="INTEGER" isPrimaryKey="true" isMandatory="true" length="10"/>
+ <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-entity>
+ <obj-entity name="testImportWithoutChanges" className="TestTable" dbEntityName="testImportWithoutChanges">
+ <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/2cddff91/plugins/cayenne-maven-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testImportWithoutChanges.map.xml-result
----------------------------------------------------------------------
diff --git a/plugins/cayenne-maven-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testImportWithoutChanges.map.xml-result b/plugins/cayenne-maven-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testImportWithoutChanges.map.xml-result
new file mode 100644
index 0000000..25c85af
--- /dev/null
+++ b/plugins/cayenne-maven-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testImportWithoutChanges.map.xml-result
@@ -0,0 +1,37 @@
+<?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="testImportWithoutChanges" schema="APP">
+ <db-attribute name="COL1" type="INTEGER" isPrimaryKey="true" isMandatory="true" length="10"/>
+ <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-entity>
+ <obj-entity name="testImportWithoutChanges" className="TestTable" dbEntityName="testImportWithoutChanges">
+ <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/2cddff91/plugins/cayenne-maven-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testImportWithoutChanges.sql
----------------------------------------------------------------------
diff --git a/plugins/cayenne-maven-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testImportWithoutChanges.sql b/plugins/cayenne-maven-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testImportWithoutChanges.sql
new file mode 100644
index 0000000..beca35a
--- /dev/null
+++ b/plugins/cayenne-maven-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testImportWithoutChanges.sql
@@ -0,0 +1,27 @@
+-- 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 TABLE testImportWithoutChanges (
+ COL1 INTEGER NOT NULL,
+ COL2 CHAR(25),
+ COL3 DECIMAL(10,2),
+ COL4 VARCHAR(25),
+ COL5 DATE,
+
+ PRIMARY KEY (COL1),
+ UNIQUE (COL3)
+)
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/cayenne/blob/2cddff91/plugins/cayenne-maven-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testOneToOne-pom.xml
----------------------------------------------------------------------
diff --git a/plugins/cayenne-maven-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testOneToOne-pom.xml b/plugins/cayenne-maven-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testOneToOne-pom.xml
new file mode 100644
index 0000000..418fd59
--- /dev/null
+++ b/plugins/cayenne-maven-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testOneToOne-pom.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">
+
+ <name>DbImporterMojo Test1</name>
+
+ <build>
+ <plugins>
+ <plugin>
+ <artifactId>maven-cayenne-plugin</artifactId>
+ <configuration>
+ <map>target/test-classes/org/apache/cayenne/tools/dbimport/testOneToOne.map.xml</map>
+ <dataSource>
+ <driver>org.apache.derby.jdbc.EmbeddedDriver</driver>
+ <url>jdbc:derby:memory:DbImporterMojoTest;create=true</url>
+ </dataSource>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+
+</project>
http://git-wip-us.apache.org/repos/asf/cayenne/blob/2cddff91/plugins/cayenne-maven-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testOneToOne.map.xml-result
----------------------------------------------------------------------
diff --git a/plugins/cayenne-maven-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testOneToOne.map.xml-result b/plugins/cayenne-maven-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testOneToOne.map.xml-result
new file mode 100644
index 0000000..203c001
--- /dev/null
+++ b/plugins/cayenne-maven-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testOneToOne.map.xml-result
@@ -0,0 +1,58 @@
+<?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="PICK_SCHEDULE" schema="APP">
+ <db-attribute name="ID" type="INTEGER" isPrimaryKey="true" isMandatory="true" length="10"/>
+ <db-attribute name="OWNER_ID" type="INTEGER" length="10"/>
+ <db-attribute name="SELECTED_PLAYER_ID" type="INTEGER" length="10"/>
+ </db-entity>
+ <db-entity name="PLAYER" schema="APP">
+ <db-attribute name="ID" type="INTEGER" isPrimaryKey="true" isMandatory="true" length="10"/>
+ </db-entity>
+ <db-entity name="PLAYER_INFO" schema="APP">
+ <db-attribute name="PLAYER_ID" type="INTEGER" isPrimaryKey="true" isMandatory="true" length="10"/>
+ </db-entity>
+ <obj-entity name="PickSchedule" className="PickSchedule" dbEntityName="PICK_SCHEDULE">
+ <obj-attribute name="ownerId" type="int" db-attribute-path="OWNER_ID"/>
+ </obj-entity>
+ <obj-entity name="Player" className="Player" dbEntityName="PLAYER">
+ </obj-entity>
+ <obj-entity name="PlayerInfo" className="PlayerInfo" dbEntityName="PLAYER_INFO">
+ </obj-entity>
+ <db-relationship name="selectedPlayer" source="PICK_SCHEDULE" target="PLAYER" toMany="false">
+ <db-attribute-pair source="SELECTED_PLAYER_ID" target="ID"/>
+ </db-relationship>
+ <db-relationship name="pickSchedules" source="PLAYER" target="PICK_SCHEDULE" toMany="true">
+ <db-attribute-pair source="ID" target="SELECTED_PLAYER_ID"/>
+ </db-relationship>
+ <db-relationship name="playerInfo" source="PLAYER" target="PLAYER_INFO" toDependentPK="true" toMany="false">
+ <db-attribute-pair source="ID" target="PLAYER_ID"/>
+ </db-relationship>
+ <db-relationship name="player" source="PLAYER_INFO" target="PLAYER" toMany="false">
+ <db-attribute-pair source="PLAYER_ID" target="ID"/>
+ </db-relationship>
+ <obj-relationship name="selectedPlayer" source="PickSchedule" target="Player" deleteRule="Nullify" db-relationship-path="selectedPlayer"/>
+ <obj-relationship name="pickSchedules" source="Player" target="PickSchedule" deleteRule="Deny" db-relationship-path="pickSchedules"/>
+ <obj-relationship name="playerInfo" source="Player" target="PlayerInfo" deleteRule="Nullify" db-relationship-path="playerInfo"/>
+ <obj-relationship name="player" source="PlayerInfo" target="Player" deleteRule="Nullify" db-relationship-path="player"/>
+</data-map>
http://git-wip-us.apache.org/repos/asf/cayenne/blob/2cddff91/plugins/cayenne-maven-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testOneToOne.sql
----------------------------------------------------------------------
diff --git a/plugins/cayenne-maven-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testOneToOne.sql b/plugins/cayenne-maven-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testOneToOne.sql
new file mode 100644
index 0000000..b676ed9
--- /dev/null
+++ b/plugins/cayenne-maven-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testOneToOne.sql
@@ -0,0 +1,41 @@
+-- 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 TABLE player (
+ id INTEGER NOT NULL,
+
+ PRIMARY KEY (id)
+);
+
+
+-- one-to-one relationship
+CREATE TABLE player_info (
+ player_id INTEGER NOT NULL,
+
+ PRIMARY KEY (player_id),
+ CONSTRAINT fk_player_info FOREIGN KEY (player_id) REFERENCES player (id)
+);
+
+-- one-to-many relationship
+CREATE TABLE pick_schedule (
+ id INTEGER NOT NULL,
+ owner_id INTEGER,
+ selected_player_id INTEGER,
+ PRIMARY KEY (id),
+
+ CONSTRAINT fk_pick_schedule_player1 FOREIGN KEY (selected_player_id) REFERENCES player (id)
+)
http://git-wip-us.apache.org/repos/asf/cayenne/blob/2cddff91/plugins/cayenne-maven-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testPreserveCustomObjMappings-pom.xml
----------------------------------------------------------------------
diff --git a/plugins/cayenne-maven-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testPreserveCustomObjMappings-pom.xml b/plugins/cayenne-maven-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testPreserveCustomObjMappings-pom.xml
new file mode 100644
index 0000000..ea24dc8
--- /dev/null
+++ b/plugins/cayenne-maven-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testPreserveCustomObjMappings-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>maven-cayenne-plugin</artifactId>
+ <configuration>
+ <map>target/test-classes/org/apache/cayenne/tools/dbimport/testPreserveCustomObjMappings.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/2cddff91/plugins/cayenne-maven-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testPreserveCustomObjMappings.map.xml
----------------------------------------------------------------------
diff --git a/plugins/cayenne-maven-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testPreserveCustomObjMappings.map.xml b/plugins/cayenne-maven-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testPreserveCustomObjMappings.map.xml
new file mode 100644
index 0000000..909c5f9
--- /dev/null
+++ b/plugins/cayenne-maven-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testPreserveCustomObjMappings.map.xml
@@ -0,0 +1,33 @@
+<?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="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="ID" type="INTEGER" isPrimaryKey="true" isMandatory="true" length="10"/>
+ </db-entity>
+ <obj-entity name="Parent" className="Parent" dbEntityName="PARENT">
+ <obj-attribute name="col2" type="java.lang.String" db-attribute-path="COL2"/>
+ </obj-entity>
+</data-map>
http://git-wip-us.apache.org/repos/asf/cayenne/blob/2cddff91/plugins/cayenne-maven-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testPreserveCustomObjMappings.map.xml-result
----------------------------------------------------------------------
diff --git a/plugins/cayenne-maven-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testPreserveCustomObjMappings.map.xml-result b/plugins/cayenne-maven-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testPreserveCustomObjMappings.map.xml-result
new file mode 100644
index 0000000..d874808
--- /dev/null
+++ b/plugins/cayenne-maven-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testPreserveCustomObjMappings.map.xml-result
@@ -0,0 +1,35 @@
+<?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="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="ID" type="INTEGER" isPrimaryKey="true" isMandatory="true" length="10"/>
+ </db-entity>
+ <obj-entity name="Parent" className="Parent" dbEntityName="PARENT">
+ <obj-attribute name="col2" type="java.lang.String" db-attribute-path="COL2"/>
+ <obj-attribute name="col4" type="java.lang.String" db-attribute-path="COL4"/>
+ </obj-entity>
+</data-map>
http://git-wip-us.apache.org/repos/asf/cayenne/blob/2cddff91/plugins/cayenne-maven-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testPreserveCustomObjMappings.sql
----------------------------------------------------------------------
diff --git a/plugins/cayenne-maven-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testPreserveCustomObjMappings.sql b/plugins/cayenne-maven-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testPreserveCustomObjMappings.sql
new file mode 100644
index 0000000..32be3a5
--- /dev/null
+++ b/plugins/cayenne-maven-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testPreserveCustomObjMappings.sql
@@ -0,0 +1,28 @@
+-- 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),
+
+ PRIMARY KEY (id)
+ );
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/cayenne/blob/2cddff91/plugins/cayenne-maven-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testPreserveRelationships-pom.xml
----------------------------------------------------------------------
diff --git a/plugins/cayenne-maven-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testPreserveRelationships-pom.xml b/plugins/cayenne-maven-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testPreserveRelationships-pom.xml
new file mode 100644
index 0000000..8056381
--- /dev/null
+++ b/plugins/cayenne-maven-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testPreserveRelationships-pom.xml
@@ -0,0 +1,45 @@
+<?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>maven-cayenne-plugin</artifactId>
+ <configuration>
+ <map>target/test-classes/org/apache/cayenne/tools/dbimport/testPreserveRelationships.map.xml</map>
+ <dataSource>
+ <driver>org.apache.derby.jdbc.EmbeddedDriver</driver>
+ <url>jdbc:derby:memory:DbImporterMojoTest;create=true</url>
+ </dataSource>
+ <dbimport>
+ <!-- it doesn't matter true or false, but initial question was about this flag -->
+ <skipRelationshipsLoading>true</skipRelationshipsLoading>
+ </dbimport>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+
+</project>
http://git-wip-us.apache.org/repos/asf/cayenne/blob/2cddff91/plugins/cayenne-maven-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testPreserveRelationships.map.xml
----------------------------------------------------------------------
diff --git a/plugins/cayenne-maven-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testPreserveRelationships.map.xml b/plugins/cayenne-maven-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testPreserveRelationships.map.xml
new file mode 100644
index 0000000..5d3c059
--- /dev/null
+++ b/plugins/cayenne-maven-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testPreserveRelationships.map.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.
+ -->
+<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="APP">
+ <db-attribute name="ID" type="INTEGER" isPrimaryKey="true" isMandatory="true" length="10"/>
+ <db-attribute name="PARENT_ID" type="INTEGER" length="10"/>
+ </db-entity>
+ <db-entity name="PARENT" schema="APP">
+ <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="parentId" type="java.lang.Integer" db-attribute-path="PARENT_ID"/>
+ </obj-entity>
+ <obj-entity name="Parent" className="Parent" dbEntityName="PARENT">
+ </obj-entity>
+ <db-relationship name="toParent" source="CHILD" target="PARENT" toMany="false">
+ <db-attribute-pair source="PARENT_ID" target="ID"/>
+ </db-relationship>
+ <db-relationship name="toParent" source="PARENT" target="CHILD" toMany="false">
+ <db-attribute-pair source="ID" target="PARENT_ID"/>
+ </db-relationship>
+ <obj-relationship name="toParent" source="Child" target="Parent" deleteRule="Nullify" db-relationship-path="toParent"/>
+ <obj-relationship name="toParent" source="Parent" target="Child" deleteRule="Nullify" db-relationship-path="toParent"/>
+</data-map>
http://git-wip-us.apache.org/repos/asf/cayenne/blob/2cddff91/plugins/cayenne-maven-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testPreserveRelationships.map.xml-result
----------------------------------------------------------------------
diff --git a/plugins/cayenne-maven-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testPreserveRelationships.map.xml-result b/plugins/cayenne-maven-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testPreserveRelationships.map.xml-result
new file mode 100644
index 0000000..818c17f
--- /dev/null
+++ b/plugins/cayenne-maven-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testPreserveRelationships.map.xml-result
@@ -0,0 +1,34 @@
+<?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="APP">
+ <db-attribute name="ID" type="INTEGER" isPrimaryKey="true" isMandatory="true" length="10"/>
+ </db-entity>
+ <db-entity name="PARENT" schema="APP">
+ <db-attribute name="ID" type="INTEGER" isPrimaryKey="true" isMandatory="true" length="10"/>
+ </db-entity>
+ <obj-entity name="Child" className="Child" dbEntityName="CHILD">
+ </obj-entity>
+ <obj-entity name="Parent" className="Parent" dbEntityName="PARENT">
+ </obj-entity>
+</data-map>
http://git-wip-us.apache.org/repos/asf/cayenne/blob/2cddff91/plugins/cayenne-maven-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testPreserveRelationships.sql
----------------------------------------------------------------------
diff --git a/plugins/cayenne-maven-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testPreserveRelationships.sql b/plugins/cayenne-maven-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testPreserveRelationships.sql
new file mode 100644
index 0000000..86b26bc
--- /dev/null
+++ b/plugins/cayenne-maven-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testPreserveRelationships.sql
@@ -0,0 +1,28 @@
+-- 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 TABLE APP.Parent (
+ id INTEGER NOT NULL,
+
+ PRIMARY KEY (id)
+);
+
+CREATE TABLE APP.Child (
+ id INTEGER NOT NULL,
+
+ PRIMARY KEY (id)
+);
\ No newline at end of file
[5/8] cayenne git commit: CAY-2214 cdbimport: rename
maven-cayenne-plugin - change module and folder name to
"cayenne-maven-plugin" - artifactId still is "maven-cayenne-plugin"
Posted by nt...@apache.org.
http://git-wip-us.apache.org/repos/asf/cayenne/blob/2cddff91/plugins/cayenne-maven-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testSchemasAndTableExclude-pom.xml
----------------------------------------------------------------------
diff --git a/plugins/cayenne-maven-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testSchemasAndTableExclude-pom.xml b/plugins/cayenne-maven-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testSchemasAndTableExclude-pom.xml
new file mode 100644
index 0000000..488a560
--- /dev/null
+++ b/plugins/cayenne-maven-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testSchemasAndTableExclude-pom.xml
@@ -0,0 +1,48 @@
+<?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>maven-cayenne-plugin</artifactId>
+ <configuration>
+ <map>target/test-classes/org/apache/cayenne/tools/dbimport/testSchemasAndTableExclude.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>
+ <excludeTable>Child</excludeTable>
+ </dbimport>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+
+</project>
http://git-wip-us.apache.org/repos/asf/cayenne/blob/2cddff91/plugins/cayenne-maven-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testSchemasAndTableExclude.map.xml-result
----------------------------------------------------------------------
diff --git a/plugins/cayenne-maven-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testSchemasAndTableExclude.map.xml-result b/plugins/cayenne-maven-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testSchemasAndTableExclude.map.xml-result
new file mode 100644
index 0000000..1870f1b
--- /dev/null
+++ b/plugins/cayenne-maven-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testSchemasAndTableExclude.map.xml-result
@@ -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.
+-->
+<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="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="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>
+</data-map>
http://git-wip-us.apache.org/repos/asf/cayenne/blob/2cddff91/plugins/cayenne-maven-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testSchemasAndTableExclude.sql
----------------------------------------------------------------------
diff --git a/plugins/cayenne-maven-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testSchemasAndTableExclude.sql b/plugins/cayenne-maven-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testSchemasAndTableExclude.sql
new file mode 100644
index 0000000..dba8da6
--- /dev/null
+++ b/plugins/cayenne-maven-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testSchemasAndTableExclude.sql
@@ -0,0 +1,64 @@
+-- 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)
+);
+
+CREATE SCHEMA schema_02;
+SET SCHEMA schema_02;
+
+CREATE TABLE schema_02.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_02.Child (
+ id INTEGER NOT NULL,
+ Parent_id CHAR(25),
+ COL3 DECIMAL(10,2),
+ COL4 VARCHAR(25),
+ COL5 DATE,
+
+ PRIMARY KEY (id)
+);
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/cayenne/blob/2cddff91/plugins/cayenne-maven-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testSkipPrimaryKeyLoading-pom.xml
----------------------------------------------------------------------
diff --git a/plugins/cayenne-maven-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testSkipPrimaryKeyLoading-pom.xml b/plugins/cayenne-maven-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testSkipPrimaryKeyLoading-pom.xml
new file mode 100644
index 0000000..e8f41ea
--- /dev/null
+++ b/plugins/cayenne-maven-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testSkipPrimaryKeyLoading-pom.xml
@@ -0,0 +1,45 @@
+<?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>maven-cayenne-plugin</artifactId>
+ <configuration>
+ <map>target/test-classes/org/apache/cayenne/tools/dbimport/testSkipPrimaryKeyLoading.map.xml</map>
+ <dataSource>
+ <driver>org.apache.derby.jdbc.EmbeddedDriver</driver>
+ <url>jdbc:derby:memory:DbImporterMojoTest;create=true</url>
+ </dataSource>
+
+ <dbimport>
+ <skipPrimaryKeyLoading>true</skipPrimaryKeyLoading>
+ </dbimport>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+
+</project>
http://git-wip-us.apache.org/repos/asf/cayenne/blob/2cddff91/plugins/cayenne-maven-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testSkipPrimaryKeyLoading.map.xml
----------------------------------------------------------------------
diff --git a/plugins/cayenne-maven-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testSkipPrimaryKeyLoading.map.xml b/plugins/cayenne-maven-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testSkipPrimaryKeyLoading.map.xml
new file mode 100644
index 0000000..1f08680
--- /dev/null
+++ b/plugins/cayenne-maven-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testSkipPrimaryKeyLoading.map.xml
@@ -0,0 +1,35 @@
+<?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.my.home"/>
+ <db-entity name="A" schema="APP">
+ <db-attribute name="ID" type="INTEGER" isPrimaryKey="true" isMandatory="true" length="10"/>
+ </db-entity>
+ <db-entity name="B" schema="APP">
+ <db-attribute name="ID" type="INTEGER" isPrimaryKey="true" isMandatory="true" length="10"/>
+ </db-entity>
+ <obj-entity name="NewName" className="NewName" dbEntityName="A">
+ </obj-entity>
+ <obj-entity name="B" className="B" dbEntityName="B">
+ </obj-entity>
+</data-map>
http://git-wip-us.apache.org/repos/asf/cayenne/blob/2cddff91/plugins/cayenne-maven-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testSkipPrimaryKeyLoading.map.xml-result
----------------------------------------------------------------------
diff --git a/plugins/cayenne-maven-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testSkipPrimaryKeyLoading.map.xml-result b/plugins/cayenne-maven-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testSkipPrimaryKeyLoading.map.xml-result
new file mode 100644
index 0000000..4da960f
--- /dev/null
+++ b/plugins/cayenne-maven-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testSkipPrimaryKeyLoading.map.xml-result
@@ -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.
+ -->
+<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.my.home"/>
+ <db-entity name="A" schema="APP">
+ <db-attribute name="ID" type="INTEGER" isPrimaryKey="true" isMandatory="true" length="10"/>
+ </db-entity>
+ <db-entity name="B" schema="APP">
+ <db-attribute name="ID" type="INTEGER" isPrimaryKey="true" isMandatory="true" length="10"/>
+ </db-entity>
+ <db-entity name="C" schema="APP">
+ <db-attribute name="ID" type="INTEGER" isMandatory="true" length="10"/>
+ </db-entity>
+ <obj-entity name="NewName" className="NewName" dbEntityName="A">
+ </obj-entity>
+ <obj-entity name="B" className="B" dbEntityName="B">
+ </obj-entity>
+ <obj-entity name="C" className="com.my.home.C" dbEntityName="C">
+ <obj-attribute name="id" type="int" db-attribute-path="ID"/>
+ </obj-entity>
+</data-map>
http://git-wip-us.apache.org/repos/asf/cayenne/blob/2cddff91/plugins/cayenne-maven-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testSkipPrimaryKeyLoading.sql
----------------------------------------------------------------------
diff --git a/plugins/cayenne-maven-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testSkipPrimaryKeyLoading.sql b/plugins/cayenne-maven-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testSkipPrimaryKeyLoading.sql
new file mode 100644
index 0000000..4bf663c
--- /dev/null
+++ b/plugins/cayenne-maven-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testSkipPrimaryKeyLoading.sql
@@ -0,0 +1,30 @@
+-- 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 TABLE APP.A (
+ id INTEGER NOT NULL,
+
+ PRIMARY KEY (id)
+);
+
+CREATE TABLE APP.B (
+ id INTEGER NOT NULL
+);
+
+CREATE TABLE APP.C (
+ id INTEGER NOT NULL
+);
http://git-wip-us.apache.org/repos/asf/cayenne/blob/2cddff91/plugins/cayenne-maven-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testSkipRelationshipsLoading-pom.xml
----------------------------------------------------------------------
diff --git a/plugins/cayenne-maven-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testSkipRelationshipsLoading-pom.xml b/plugins/cayenne-maven-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testSkipRelationshipsLoading-pom.xml
new file mode 100644
index 0000000..df9d7d5
--- /dev/null
+++ b/plugins/cayenne-maven-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testSkipRelationshipsLoading-pom.xml
@@ -0,0 +1,45 @@
+<?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>maven-cayenne-plugin</artifactId>
+ <configuration>
+ <map>target/test-classes/org/apache/cayenne/tools/dbimport/testSkipRelationshipsLoading.map.xml</map>
+ <dataSource>
+ <driver>org.apache.derby.jdbc.EmbeddedDriver</driver>
+ <url>jdbc:derby:memory:DbImporterMojoTest;create=true</url>
+ </dataSource>
+
+ <dbimport>
+ <skipRelationshipsLoading>true</skipRelationshipsLoading>
+ </dbimport>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+
+</project>
http://git-wip-us.apache.org/repos/asf/cayenne/blob/2cddff91/plugins/cayenne-maven-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testSkipRelationshipsLoading.map.xml
----------------------------------------------------------------------
diff --git a/plugins/cayenne-maven-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testSkipRelationshipsLoading.map.xml b/plugins/cayenne-maven-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testSkipRelationshipsLoading.map.xml
new file mode 100644
index 0000000..a245765
--- /dev/null
+++ b/plugins/cayenne-maven-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testSkipRelationshipsLoading.map.xml
@@ -0,0 +1,55 @@
+<?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.my.home"/>
+ <db-entity name="A" schema="APP">
+ <db-attribute name="ID" type="INTEGER" isPrimaryKey="true" isMandatory="true" length="10"/>
+ </db-entity>
+ <db-entity name="A_B" schema="APP">
+ <db-attribute name="A_ID" type="INTEGER" isMandatory="true" length="10"/>
+ <db-attribute name="B_ID" type="INTEGER" isMandatory="true" length="10"/>
+ </db-entity>
+ <db-entity name="B" schema="APP">
+ <db-attribute name="ID" type="INTEGER" isPrimaryKey="true" isMandatory="true" length="10"/>
+ </db-entity>
+ <obj-entity name="A" className="A" dbEntityName="A">
+ </obj-entity>
+ <obj-entity name="AB" className="AB" dbEntityName="A_B">
+ </obj-entity>
+ <obj-entity name="B" className="B" dbEntityName="B">
+ </obj-entity>
+ <db-relationship name="aBArray" source="A" target="A_B" toMany="true">
+ <db-attribute-pair source="ID" target="A_ID"/>
+ </db-relationship>
+ <db-relationship name="toA" source="A_B" target="A" toMany="false">
+ <db-attribute-pair source="A_ID" target="ID"/>
+ </db-relationship>
+ <db-relationship name="toB" source="A_B" target="B" toMany="false">
+ <db-attribute-pair source="B_ID" target="ID"/>
+ </db-relationship>
+ <db-relationship name="aBArray" source="B" target="A_B" toMany="true">
+ <db-attribute-pair source="ID" target="B_ID"/>
+ </db-relationship>
+ <obj-relationship name="toA" source="AB" target="A" deleteRule="Nullify" db-relationship-path="toA"/>
+ <obj-relationship name="aBArray" source="B" target="AB" deleteRule="Deny" db-relationship-path="aBArray"/>
+</data-map>
http://git-wip-us.apache.org/repos/asf/cayenne/blob/2cddff91/plugins/cayenne-maven-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testSkipRelationshipsLoading.map.xml-result
----------------------------------------------------------------------
diff --git a/plugins/cayenne-maven-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testSkipRelationshipsLoading.map.xml-result b/plugins/cayenne-maven-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testSkipRelationshipsLoading.map.xml-result
new file mode 100644
index 0000000..a245765
--- /dev/null
+++ b/plugins/cayenne-maven-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testSkipRelationshipsLoading.map.xml-result
@@ -0,0 +1,55 @@
+<?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.my.home"/>
+ <db-entity name="A" schema="APP">
+ <db-attribute name="ID" type="INTEGER" isPrimaryKey="true" isMandatory="true" length="10"/>
+ </db-entity>
+ <db-entity name="A_B" schema="APP">
+ <db-attribute name="A_ID" type="INTEGER" isMandatory="true" length="10"/>
+ <db-attribute name="B_ID" type="INTEGER" isMandatory="true" length="10"/>
+ </db-entity>
+ <db-entity name="B" schema="APP">
+ <db-attribute name="ID" type="INTEGER" isPrimaryKey="true" isMandatory="true" length="10"/>
+ </db-entity>
+ <obj-entity name="A" className="A" dbEntityName="A">
+ </obj-entity>
+ <obj-entity name="AB" className="AB" dbEntityName="A_B">
+ </obj-entity>
+ <obj-entity name="B" className="B" dbEntityName="B">
+ </obj-entity>
+ <db-relationship name="aBArray" source="A" target="A_B" toMany="true">
+ <db-attribute-pair source="ID" target="A_ID"/>
+ </db-relationship>
+ <db-relationship name="toA" source="A_B" target="A" toMany="false">
+ <db-attribute-pair source="A_ID" target="ID"/>
+ </db-relationship>
+ <db-relationship name="toB" source="A_B" target="B" toMany="false">
+ <db-attribute-pair source="B_ID" target="ID"/>
+ </db-relationship>
+ <db-relationship name="aBArray" source="B" target="A_B" toMany="true">
+ <db-attribute-pair source="ID" target="B_ID"/>
+ </db-relationship>
+ <obj-relationship name="toA" source="AB" target="A" deleteRule="Nullify" db-relationship-path="toA"/>
+ <obj-relationship name="aBArray" source="B" target="AB" deleteRule="Deny" db-relationship-path="aBArray"/>
+</data-map>
http://git-wip-us.apache.org/repos/asf/cayenne/blob/2cddff91/plugins/cayenne-maven-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testSkipRelationshipsLoading.sql
----------------------------------------------------------------------
diff --git a/plugins/cayenne-maven-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testSkipRelationshipsLoading.sql b/plugins/cayenne-maven-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testSkipRelationshipsLoading.sql
new file mode 100644
index 0000000..0241d1d
--- /dev/null
+++ b/plugins/cayenne-maven-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testSkipRelationshipsLoading.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 TABLE APP.A (
+ id INTEGER NOT NULL,
+
+ PRIMARY KEY (id)
+);
+
+CREATE TABLE APP.B (
+ id INTEGER NOT NULL,
+
+ PRIMARY KEY (id)
+);
+
+CREATE TABLE APP.A_B (
+ A_ID INTEGER NOT NULL,
+ B_ID INTEGER NOT NULL,
+
+ CONSTRAINT A_B_A FOREIGN KEY (A_ID) REFERENCES APP.A (ID),
+ CONSTRAINT A_B_B FOREIGN KEY (B_ID) REFERENCES APP.B (ID)
+);
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/cayenne/blob/2cddff91/plugins/cayenne-maven-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testSupportsCatalogsOnReverseEngineering-pom.xml
----------------------------------------------------------------------
diff --git a/plugins/cayenne-maven-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testSupportsCatalogsOnReverseEngineering-pom.xml b/plugins/cayenne-maven-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testSupportsCatalogsOnReverseEngineering-pom.xml
new file mode 100644
index 0000000..f3409fa
--- /dev/null
+++ b/plugins/cayenne-maven-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testSupportsCatalogsOnReverseEngineering-pom.xml
@@ -0,0 +1,50 @@
+<?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>maven-cayenne-plugin</artifactId>
+ <configuration>
+ <map>
+ target/test-classes/org/apache/cayenne/tools/dbimport/testSupportsCatalogsOnReverseEngineering.map.xml
+ </map>
+
+ <dataSource>
+ <driver>org.apache.derby.jdbc.EmbeddedDriver</driver>
+ <url>jdbc:derby:memory:DbImporterMojoTest;create=true</url>
+ </dataSource>
+
+ <adapter>org.apache.cayenne.dba.postgres.PostgresAdapter</adapter>
+
+ <dbimport>
+ <catalog>DbImporterMojoTest1</catalog>
+ </dbimport>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+
+</project>
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/cayenne/blob/2cddff91/plugins/cayenne-maven-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testSupportsCatalogsOnReverseEngineering.map.xml
----------------------------------------------------------------------
diff --git a/plugins/cayenne-maven-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testSupportsCatalogsOnReverseEngineering.map.xml b/plugins/cayenne-maven-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testSupportsCatalogsOnReverseEngineering.map.xml
new file mode 100644
index 0000000..81fc363
--- /dev/null
+++ b/plugins/cayenne-maven-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testSupportsCatalogsOnReverseEngineering.map.xml
@@ -0,0 +1,25 @@
+<?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.my.home"/>
+</data-map>
http://git-wip-us.apache.org/repos/asf/cayenne/blob/2cddff91/plugins/cayenne-maven-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testTableTypes-pom.xml
----------------------------------------------------------------------
diff --git a/plugins/cayenne-maven-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testTableTypes-pom.xml b/plugins/cayenne-maven-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testTableTypes-pom.xml
new file mode 100644
index 0000000..2f60ff5
--- /dev/null
+++ b/plugins/cayenne-maven-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testTableTypes-pom.xml
@@ -0,0 +1,45 @@
+<?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>maven-cayenne-plugin</artifactId>
+ <configuration>
+ <map>target/test-classes/org/apache/cayenne/tools/dbimport/testTableTypes.map.xml</map>
+ <dataSource>
+ <driver>org.apache.derby.jdbc.EmbeddedDriver</driver>
+ <url>jdbc:derby:memory:DbImporterMojoTest;create=true</url>
+ </dataSource>
+
+ <dbimport>
+ <tableType>TABLE</tableType>
+ </dbimport>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+
+</project>
http://git-wip-us.apache.org/repos/asf/cayenne/blob/2cddff91/plugins/cayenne-maven-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testTableTypes.map.xml-result
----------------------------------------------------------------------
diff --git a/plugins/cayenne-maven-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testTableTypes.map.xml-result b/plugins/cayenne-maven-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testTableTypes.map.xml-result
new file mode 100644
index 0000000..cdc9ddd
--- /dev/null
+++ b/plugins/cayenne-maven-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testTableTypes.map.xml-result
@@ -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
+
+ 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="PERSON" schema="APP">
+ <db-attribute name="ID" type="INTEGER" isPrimaryKey="true" isMandatory="true" length="10"/>
+ </db-entity>
+ <obj-entity name="Person" className="Person" dbEntityName="PERSON">
+ </obj-entity>
+</data-map>
http://git-wip-us.apache.org/repos/asf/cayenne/blob/2cddff91/plugins/cayenne-maven-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testTableTypes.sql
----------------------------------------------------------------------
diff --git a/plugins/cayenne-maven-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testTableTypes.sql b/plugins/cayenne-maven-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testTableTypes.sql
new file mode 100644
index 0000000..cb7d3f5
--- /dev/null
+++ b/plugins/cayenne-maven-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testTableTypes.sql
@@ -0,0 +1,25 @@
+-- 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 TABLE Person (
+ id INTEGER NOT NULL,
+
+ PRIMARY KEY (id)
+);
+
+CREATE VIEW girl (id) AS SELECT id FROM Person;
+CREATE VIEW v_vview (id) AS SELECT id FROM Person;
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/cayenne/blob/2cddff91/plugins/cayenne-maven-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testUnFlattensManyToMany-pom.xml
----------------------------------------------------------------------
diff --git a/plugins/cayenne-maven-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testUnFlattensManyToMany-pom.xml b/plugins/cayenne-maven-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testUnFlattensManyToMany-pom.xml
new file mode 100644
index 0000000..bd43bb0
--- /dev/null
+++ b/plugins/cayenne-maven-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testUnFlattensManyToMany-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>maven-cayenne-plugin</artifactId>
+ <configuration>
+ <map>target/test-classes/org/apache/cayenne/tools/dbimport/testUnFlattensManyToMany.map.xml</map>
+ <dataSource>
+ <driver>org.apache.derby.jdbc.EmbeddedDriver</driver>
+ <url>jdbc:derby:memory:DbImporterMojoTest;create=true</url>
+ </dataSource>
+ <dbimport>
+ <defaultPackage>org.not.my.home</defaultPackage>
+ </dbimport>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+
+</project>
http://git-wip-us.apache.org/repos/asf/cayenne/blob/2cddff91/plugins/cayenne-maven-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testUnFlattensManyToMany.map.xml
----------------------------------------------------------------------
diff --git a/plugins/cayenne-maven-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testUnFlattensManyToMany.map.xml b/plugins/cayenne-maven-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testUnFlattensManyToMany.map.xml
new file mode 100644
index 0000000..689a94a
--- /dev/null
+++ b/plugins/cayenne-maven-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testUnFlattensManyToMany.map.xml
@@ -0,0 +1,55 @@
+<?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.my.home"/>
+ <db-entity name="A" schema="APP">
+ <db-attribute name="ID" type="INTEGER" isPrimaryKey="true" isMandatory="true" length="10"/>
+ </db-entity>
+ <db-entity name="A_B" schema="APP">
+ <db-attribute name="A_ID" type="INTEGER" isPrimaryKey="true" isMandatory="true" length="10"/>
+ <db-attribute name="B_ID" type="INTEGER" isPrimaryKey="true" isMandatory="true" length="10"/>
+ </db-entity>
+ <db-entity name="B" schema="APP">
+ <db-attribute name="ID" type="INTEGER" isPrimaryKey="true" isMandatory="true" length="10"/>
+ </db-entity>
+ <obj-entity name="A" className="A" dbEntityName="A">
+ </obj-entity>
+ <obj-entity name="AB" className="AB" dbEntityName="A_B">
+ </obj-entity>
+ <obj-entity name="B" className="B" dbEntityName="B">
+ </obj-entity>
+ <db-relationship name="aBs" source="A" target="A_B" toDependentPK="true" toMany="true">
+ <db-attribute-pair source="ID" target="A_ID"/>
+ </db-relationship>
+ <db-relationship name="toA" source="A_B" target="A" toMany="false">
+ <db-attribute-pair source="A_ID" target="ID"/>
+ </db-relationship>
+ <db-relationship name="toB" source="A_B" target="B" toMany="false">
+ <db-attribute-pair source="B_ID" target="ID"/>
+ </db-relationship>
+ <db-relationship name="aBs" source="B" target="A_B" toDependentPK="true" toMany="true">
+ <db-attribute-pair source="ID" target="B_ID"/>
+ </db-relationship>
+ <obj-relationship name="toA" source="AB" target="A" deleteRule="Nullify" db-relationship-path="toA"/>
+ <obj-relationship name="aBs" source="B" target="AB" deleteRule="Deny" db-relationship-path="aBs"/>
+</data-map>
http://git-wip-us.apache.org/repos/asf/cayenne/blob/2cddff91/plugins/cayenne-maven-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testUnFlattensManyToMany.map.xml-result
----------------------------------------------------------------------
diff --git a/plugins/cayenne-maven-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testUnFlattensManyToMany.map.xml-result b/plugins/cayenne-maven-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testUnFlattensManyToMany.map.xml-result
new file mode 100644
index 0000000..46d6a84
--- /dev/null
+++ b/plugins/cayenne-maven-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testUnFlattensManyToMany.map.xml-result
@@ -0,0 +1,88 @@
+<?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="org.not.my.home"/>
+ <db-entity name="A" schema="APP">
+ <db-attribute name="ID" type="INTEGER" isPrimaryKey="true" isMandatory="true" length="10"/>
+ </db-entity>
+ <db-entity name="A_B" schema="APP">
+ <db-attribute name="A_ID" type="INTEGER" isPrimaryKey="true" isMandatory="true" length="10"/>
+ <db-attribute name="B_ID" type="INTEGER" isPrimaryKey="true" isMandatory="true" length="10"/>
+ </db-entity>
+ <db-entity name="B" schema="APP">
+ <db-attribute name="ID" type="INTEGER" isPrimaryKey="true" isMandatory="true" length="10"/>
+ </db-entity>
+ <db-entity name="C" schema="APP">
+ <db-attribute name="ID" type="INTEGER" isPrimaryKey="true" isMandatory="true" length="10"/>
+ </db-entity>
+ <db-entity name="X" schema="APP">
+ <db-attribute name="ID" type="INTEGER" isPrimaryKey="true" isMandatory="true" length="10"/>
+ </db-entity>
+ <db-entity name="X_Y" schema="APP">
+ <db-attribute name="X_ID" type="INTEGER" isPrimaryKey="true" isMandatory="true" length="10"/>
+ <db-attribute name="Y_ID" type="INTEGER" isPrimaryKey="true" isMandatory="true" length="10"/>
+ </db-entity>
+ <db-entity name="Y" schema="APP">
+ <db-attribute name="ID" type="INTEGER" isPrimaryKey="true" isMandatory="true" length="10"/>
+ </db-entity>
+ <obj-entity name="A" className="A" dbEntityName="A">
+ </obj-entity>
+ <obj-entity name="AB" className="AB" dbEntityName="A_B">
+ </obj-entity>
+ <obj-entity name="B" className="B" dbEntityName="B">
+ </obj-entity>
+ <obj-entity name="C" className="org.not.my.home.C" dbEntityName="C">
+ </obj-entity>
+ <obj-entity name="X" className="org.not.my.home.X" dbEntityName="X">
+ </obj-entity>
+ <obj-entity name="Y" className="org.not.my.home.Y" dbEntityName="Y">
+ </obj-entity>
+ <db-relationship name="aBs" source="A" target="A_B" toDependentPK="true" toMany="true">
+ <db-attribute-pair source="ID" target="A_ID"/>
+ </db-relationship>
+ <db-relationship name="toA" source="A_B" target="A" toMany="false">
+ <db-attribute-pair source="A_ID" target="ID"/>
+ </db-relationship>
+ <db-relationship name="toB" source="A_B" target="B" toMany="false">
+ <db-attribute-pair source="B_ID" target="ID"/>
+ </db-relationship>
+ <db-relationship name="aBs" source="B" target="A_B" toDependentPK="true" toMany="true">
+ <db-attribute-pair source="ID" target="B_ID"/>
+ </db-relationship>
+ <db-relationship name="xIes" source="X" target="X_Y" toDependentPK="true" toMany="true">
+ <db-attribute-pair source="ID" target="X_ID"/>
+ </db-relationship>
+ <db-relationship name="x" source="X_Y" target="X" toMany="false">
+ <db-attribute-pair source="X_ID" target="ID"/>
+ </db-relationship>
+ <db-relationship name="y" source="X_Y" target="Y" toMany="false">
+ <db-attribute-pair source="Y_ID" target="ID"/>
+ </db-relationship>
+ <db-relationship name="xIes" source="Y" target="X_Y" toDependentPK="true" toMany="true">
+ <db-attribute-pair source="ID" target="Y_ID"/>
+ </db-relationship>
+ <obj-relationship name="toA" source="AB" target="A" deleteRule="Nullify" db-relationship-path="toA"/>
+ <obj-relationship name="aBs" source="B" target="AB" deleteRule="Deny" db-relationship-path="aBs"/>
+ <obj-relationship name="ies" source="X" target="Y" db-relationship-path="xIes.y"/>
+ <obj-relationship name="xes" source="Y" target="X" db-relationship-path="xIes.x"/>
+</data-map>
http://git-wip-us.apache.org/repos/asf/cayenne/blob/2cddff91/plugins/cayenne-maven-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testUnFlattensManyToMany.sql
----------------------------------------------------------------------
diff --git a/plugins/cayenne-maven-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testUnFlattensManyToMany.sql b/plugins/cayenne-maven-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testUnFlattensManyToMany.sql
new file mode 100644
index 0000000..b6f4eac
--- /dev/null
+++ b/plugins/cayenne-maven-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testUnFlattensManyToMany.sql
@@ -0,0 +1,64 @@
+-- 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 TABLE APP.A (
+ id INTEGER NOT NULL,
+
+ PRIMARY KEY (id)
+);
+
+CREATE TABLE APP.B (
+ id INTEGER NOT NULL,
+
+ PRIMARY KEY (id)
+);
+
+CREATE TABLE APP.A_B (
+ A_ID INTEGER NOT NULL,
+ B_ID INTEGER NOT NULL,
+
+ PRIMARY KEY (A_ID, B_ID),
+ CONSTRAINT A_B_A FOREIGN KEY (A_ID) REFERENCES APP.A (ID),
+ CONSTRAINT A_B_B FOREIGN KEY (B_ID) REFERENCES APP.B (ID)
+);
+
+CREATE TABLE APP.C (
+ id INTEGER NOT NULL,
+
+ PRIMARY KEY (id)
+);
+
+CREATE TABLE APP.X (
+ id INTEGER NOT NULL,
+
+ PRIMARY KEY (id)
+);
+
+CREATE TABLE APP.Y (
+ id INTEGER NOT NULL,
+
+ PRIMARY KEY (id)
+);
+
+CREATE TABLE APP.X_Y (
+ X_ID INTEGER NOT NULL,
+ Y_ID INTEGER NOT NULL,
+
+ PRIMARY KEY (X_ID, Y_ID),
+ CONSTRAINT X_Y_X FOREIGN KEY (X_ID) REFERENCES APP.X (ID),
+ CONSTRAINT X_Y_Y FOREIGN KEY (Y_ID) REFERENCES APP.Y (ID)
+);
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/cayenne/blob/2cddff91/plugins/cayenne-maven-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testViewsExclude-pom.xml
----------------------------------------------------------------------
diff --git a/plugins/cayenne-maven-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testViewsExclude-pom.xml b/plugins/cayenne-maven-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testViewsExclude-pom.xml
new file mode 100644
index 0000000..749b309
--- /dev/null
+++ b/plugins/cayenne-maven-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testViewsExclude-pom.xml
@@ -0,0 +1,45 @@
+<?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>maven-cayenne-plugin</artifactId>
+ <configuration>
+ <map>target/test-classes/org/apache/cayenne/tools/dbimport/testViewsExclude.map.xml</map>
+ <dataSource>
+ <driver>org.apache.derby.jdbc.EmbeddedDriver</driver>
+ <url>jdbc:derby:memory:DbImporterMojoTest;create=true</url>
+ </dataSource>
+
+ <dbimport>
+ <excludeTable>^V_.*</excludeTable>
+ </dbimport>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+
+</project>
http://git-wip-us.apache.org/repos/asf/cayenne/blob/2cddff91/plugins/cayenne-maven-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testViewsExclude.map.xml-result
----------------------------------------------------------------------
diff --git a/plugins/cayenne-maven-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testViewsExclude.map.xml-result b/plugins/cayenne-maven-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testViewsExclude.map.xml-result
new file mode 100644
index 0000000..d24df6e
--- /dev/null
+++ b/plugins/cayenne-maven-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testViewsExclude.map.xml-result
@@ -0,0 +1,43 @@
+<?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="GIRL" schema="APP">
+ <db-attribute name="ID" type="INTEGER" isMandatory="true" length="10"/>
+ </db-entity>
+ <db-entity name="PERSON" schema="APP">
+ <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="Girl" className="Girl" dbEntityName="GIRL">
+ <obj-attribute name="id" type="int" db-attribute-path="ID"/>
+ </obj-entity>
+ <obj-entity name="Person" className="Person" dbEntityName="PERSON">
+ <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/2cddff91/plugins/cayenne-maven-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testViewsExclude.sql
----------------------------------------------------------------------
diff --git a/plugins/cayenne-maven-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testViewsExclude.sql b/plugins/cayenne-maven-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testViewsExclude.sql
new file mode 100644
index 0000000..1af3f84
--- /dev/null
+++ b/plugins/cayenne-maven-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testViewsExclude.sql
@@ -0,0 +1,30 @@
+-- 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 TABLE Person (
+ id INTEGER NOT NULL,
+ COL2 CHAR(25),
+ COL3 DECIMAL(10,2),
+ COL4 VARCHAR(25),
+ COL5 DATE,
+
+ PRIMARY KEY (id),
+ UNIQUE (COL3)
+);
+
+CREATE VIEW girl (id) AS SELECT id FROM Person;
+CREATE VIEW v_vview (id) AS SELECT id FROM Person;
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/cayenne/blob/2cddff91/plugins/cayenne-maven-plugin/src/test/resources/org/apache/cayenne/tools/dbimporter-pom1.xml
----------------------------------------------------------------------
diff --git a/plugins/cayenne-maven-plugin/src/test/resources/org/apache/cayenne/tools/dbimporter-pom1.xml b/plugins/cayenne-maven-plugin/src/test/resources/org/apache/cayenne/tools/dbimporter-pom1.xml
new file mode 100644
index 0000000..43f71c1
--- /dev/null
+++ b/plugins/cayenne-maven-plugin/src/test/resources/org/apache/cayenne/tools/dbimporter-pom1.xml
@@ -0,0 +1,37 @@
+<?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>maven-cayenne-plugin</artifactId>
+ <configuration>
+ <map>target/test/org/apache/cayenne/tools/dbimporter-map1.map.xml</map>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+
+</project>
http://git-wip-us.apache.org/repos/asf/cayenne/blob/2cddff91/plugins/cayenne-maven-plugin/src/test/resources/org/apache/cayenne/tools/dbimporter-pom2.xml
----------------------------------------------------------------------
diff --git a/plugins/cayenne-maven-plugin/src/test/resources/org/apache/cayenne/tools/dbimporter-pom2.xml b/plugins/cayenne-maven-plugin/src/test/resources/org/apache/cayenne/tools/dbimporter-pom2.xml
new file mode 100644
index 0000000..24c065a
--- /dev/null
+++ b/plugins/cayenne-maven-plugin/src/test/resources/org/apache/cayenne/tools/dbimporter-pom2.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">
+
+ <name>DbImporterMojo Test2</name>
+
+ <build>
+ <plugins>
+ <plugin>
+ <artifactId>maven-cayenne-plugin</artifactId>
+ <configuration>
+ <dbimport>
+ <meaningfulPkTables>x,b*</meaningfulPkTables>
+ </dbimport>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+
+</project>
http://git-wip-us.apache.org/repos/asf/cayenne/blob/2cddff91/plugins/cayenne-maven-plugin/src/test/resources/org/apache/cayenne/tools/dbimporter-pom3.xml
----------------------------------------------------------------------
diff --git a/plugins/cayenne-maven-plugin/src/test/resources/org/apache/cayenne/tools/dbimporter-pom3.xml b/plugins/cayenne-maven-plugin/src/test/resources/org/apache/cayenne/tools/dbimporter-pom3.xml
new file mode 100644
index 0000000..73e65c5
--- /dev/null
+++ b/plugins/cayenne-maven-plugin/src/test/resources/org/apache/cayenne/tools/dbimporter-pom3.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">
+
+ <name>DbImporterMojo Test1</name>
+
+ <build>
+ <plugins>
+ <plugin>
+ <artifactId>maven-cayenne-plugin</artifactId>
+ <configuration>
+ <dbimport>
+ <meaningfulPkTables>*</meaningfulPkTables>
+ </dbimport>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+
+</project>
http://git-wip-us.apache.org/repos/asf/cayenne/blob/2cddff91/plugins/maven-cayenne-plugin/pom.xml
----------------------------------------------------------------------
diff --git a/plugins/maven-cayenne-plugin/pom.xml b/plugins/maven-cayenne-plugin/pom.xml
deleted file mode 100644
index bebdcf4..0000000
--- a/plugins/maven-cayenne-plugin/pom.xml
+++ /dev/null
@@ -1,186 +0,0 @@
-<?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/maven-v4_0_0.xsd">
-
- <parent>
- <artifactId>cayenne-plugins-parent</artifactId>
- <groupId>org.apache.cayenne.plugins</groupId>
- <version>4.0.M5-SNAPSHOT</version>
- </parent>
-
- <modelVersion>4.0.0</modelVersion>
- <artifactId>maven-cayenne-plugin</artifactId>
- <packaging>maven-plugin</packaging>
- <name>maven-cayenne-plugin: Cayenne Maven Plugin</name>
-
- <dependencies>
-
- <dependency>
- <groupId>org.apache.maven</groupId>
- <artifactId>maven-plugin-api</artifactId>
- </dependency>
-
- <dependency>
- <groupId>org.apache.maven</groupId>
- <artifactId>maven-artifact</artifactId>
- </dependency>
-
- <dependency>
- <groupId>org.apache.maven</groupId>
- <artifactId>maven-project</artifactId>
- </dependency>
-
- <dependency>
- <groupId>org.apache.maven.plugin-tools</groupId>
- <artifactId>maven-plugin-tools-api</artifactId>
- </dependency>
-
- <dependency>
- <groupId>org.apache.maven.plugin-tools</groupId>
- <artifactId>maven-plugin-annotations</artifactId>
- </dependency>
-
- <dependency>
- <groupId>org.apache.maven</groupId>
- <artifactId>maven-compat</artifactId>
- </dependency>
-
- <dependency>
- <groupId>org.codehaus.plexus</groupId>
- <artifactId>plexus-interpolation</artifactId>
- </dependency>
-
- <dependency>
- <groupId>org.codehaus.plexus</groupId>
- <artifactId>plexus-container-default</artifactId>
- </dependency>
-
- <dependency>
- <groupId>org.apache.cayenne</groupId>
- <artifactId>cayenne-project</artifactId>
- <version>${project.version}</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.cayenne</groupId>
- <artifactId>cayenne-server</artifactId>
- <version>${project.version}</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.cayenne</groupId>
- <artifactId>cayenne-tools</artifactId>
- <version>${project.version}</version>
- <exclusions>
- <exclusion>
- <groupId>foundrylogic.vpp</groupId>
- <artifactId>vpp</artifactId>
- </exclusion>
- </exclusions>
- </dependency>
-
- <!-- Test deps -->
- <dependency>
- <groupId>org.mockito</groupId>
- <artifactId>mockito-all</artifactId>
- <scope>test</scope>
- </dependency>
-
- <dependency>
- <groupId>junit</groupId>
- <artifactId>junit</artifactId>
- <scope>test</scope>
- </dependency>
-
- <dependency>
- <groupId>org.apache.maven.plugin-testing</groupId>
- <artifactId>maven-plugin-testing-harness</artifactId>
- <scope>test</scope>
- </dependency>
-
- <dependency>
- <groupId>org.apache.derby</groupId>
- <artifactId>derby</artifactId>
- <scope>test</scope>
- </dependency>
-
- <dependency>
- <groupId>xmlunit</groupId>
- <artifactId>xmlunit</artifactId>
- <scope>test</scope>
- </dependency>
-
- <dependency>
- <groupId>org.apache.maven</groupId>
- <artifactId>maven-core</artifactId>
- <scope>test</scope>
- </dependency>
-
- <dependency>
- <groupId>org.apache.cayenne</groupId>
- <artifactId>cayenne-server</artifactId>
- <version>${project.version}</version>
- <scope>test</scope>
- <type>test-jar</type>
- </dependency>
-
- <dependency>
- <groupId>org.apache.cayenne</groupId>
- <artifactId>cayenne-tools</artifactId>
- <version>${project.version}</version>
- <scope>test</scope>
- <type>test-jar</type>
- </dependency>
-
- <dependency>
- <groupId>org.apache.cayenne.build-tools</groupId>
- <artifactId>cayenne-test-utilities</artifactId>
- <version>${project.version}</version>
- <scope>test</scope>
- </dependency>
- </dependencies>
-
- <reporting>
- <plugins>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-plugin-plugin</artifactId>
- </plugin>
- </plugins>
- </reporting>
-
- <profiles>
- <profile>
- <id>code-quality</id>
-
- <activation>
- <property>
- <name>!fast-and-dirty</name>
- </property>
- </activation>
- <build>
- <plugins>
- <plugin>
- <artifactId>maven-checkstyle-plugin</artifactId>
- <!--<configuration>
- <suppressionsLocation>${project.basedir}/cayenne-checkstyle-suppression.xml</suppressionsLocation>
- </configuration>-->
- </plugin>
- <plugin>
- <artifactId>maven-pmd-plugin</artifactId>
- </plugin>
- </plugins>
- </build>
- </profile>
- </profiles>
-</project>
-
http://git-wip-us.apache.org/repos/asf/cayenne/blob/2cddff91/plugins/maven-cayenne-plugin/src/main/java/org/apache/cayenne/tools/CayenneGeneratorMojo.java
----------------------------------------------------------------------
diff --git a/plugins/maven-cayenne-plugin/src/main/java/org/apache/cayenne/tools/CayenneGeneratorMojo.java b/plugins/maven-cayenne-plugin/src/main/java/org/apache/cayenne/tools/CayenneGeneratorMojo.java
deleted file mode 100644
index f2bd4ff..0000000
--- a/plugins/maven-cayenne-plugin/src/main/java/org/apache/cayenne/tools/CayenneGeneratorMojo.java
+++ /dev/null
@@ -1,293 +0,0 @@
-/*****************************************************************
- * 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.
- ****************************************************************/
-
-package org.apache.cayenne.tools;
-
-import org.apache.cayenne.dbsync.filter.NamePatternMatcher;
-import org.apache.cayenne.gen.ClassGenerationAction;
-import org.apache.cayenne.gen.ClientClassGenerationAction;
-import org.apache.cayenne.map.DataMap;
-import org.apache.commons.logging.Log;
-import org.apache.maven.plugin.AbstractMojo;
-import org.apache.maven.plugin.MojoExecutionException;
-import org.apache.maven.plugin.MojoFailureException;
-
-import java.io.File;
-import java.io.FilenameFilter;
-
-/**
- * Maven mojo to perform class generation from data map. This class is an Maven
- * adapter to DefaultClassGenerator class.
- *
- * @since 3.0
- *
- * @phase generate-sources
- * @goal cgen
- */
-public class CayenneGeneratorMojo extends AbstractMojo {
-
- public static final File[] NO_FILES = new File[0];
- /**
- * Path to additional DataMap XML files to use for class generation.
- *
- * @parameter additionalMaps="additionalMaps"
- */
- private File additionalMaps;
-
- /**
- * Whether we are generating classes for the client tier in a Remote Object
- * Persistence application. Default is <code>false</code>.
- *
- * @parameter client="client" default-value="false"
- */
- private boolean client;
-
- /**
- * Destination directory for Java classes (ignoring their package names).
- *
- * @parameter destDir="destDir" default-value="${project.build.sourceDirectory}"
- */
- private File destDir;
-
- /**
- * Specify generated file encoding if different from the default on current
- * platform. Target encoding must be supported by the JVM running Maven
- * build. Standard encodings supported by Java on all platforms are
- * US-ASCII, ISO-8859-1, UTF-8, UTF-16BE, UTF-16LE, UTF-16. See Sun Java
- * Docs for java.nio.charset.Charset for more information.
- *
- * @parameter encoding="encoding"
- */
- private String encoding;
-
- /**
- * Entities (expressed as a perl5 regex) to exclude from template
- * generation. (Default is to include all entities in the DataMap).
- *
- * @parameter excludeEntities="excludeEntities"
- */
- private String excludeEntities;
-
- /**
- * Entities (expressed as a perl5 regex) to include in template generation.
- * (Default is to include all entities in the DataMap).
- *
- * @parameter includeEntities="includeEntities"
- */
- private String includeEntities;
-
- /**
- * If set to <code>true</code>, will generate subclass/superclass pairs,
- * with all generated code included in superclass (default is
- * <code>true</code>).
- *
- * @parameter makePairs="makePairs" default-value="true"
- */
- private boolean makePairs;
-
- /**
- * DataMap XML file to use as a base for class generation.
- *
- * @parameter map="map"
- * @required
- */
- private File map;
-
- /**
- * Specifies generator iteration target. "entity" performs one
- * iteration for each selected entity. "datamap" performs one
- * iteration per datamap (This is always one iteration since cgen currently
- * supports specifying one-and-only-one datamap). (Default is
- * "entity")
- *
- * @parameter mode="mode" default-value="entity"
- */
- private String mode;
-
- /**
- * Name of file for generated output. (Default is "*.java")
- *
- * @parameter outputPattern="outputPattern" default-value="*.java"
- */
- private String outputPattern;
-
- /**
- * If set to <code>true</code>, will overwrite older versions of generated
- * classes. Ignored unless makepairs is set to <code>false</code>.
- *
- * @parameter overwrite="overwrite" default-value="false"
- */
- private boolean overwrite;
-
- /**
- * Java package name of generated superclasses. Ignored unless
- * <code>makepairs</code> set to <code>true</code>. If omitted, each
- * superclass will be assigned the same package as subclass. Note that
- * having superclass in a different package would only make sense when
- * <code>usepkgpath</code> is set to <code>true</code>. Otherwise classes
- * from different packages will end up in the same directory.
- *
- * @parameter superPkg="superPkg"
- */
- private String superPkg;
-
- /**
- * Location of Velocity template file for Entity superclass generation.
- * Ignored unless <code>makepairs</code> set to <code>true</code>. If
- * omitted, default template is used.
- *
- * @parameter superTemplate="superTemplate"
- */
- private String superTemplate;
-
- /**
- * Location of Velocity template file for Entity class generation. If
- * omitted, default template is used.
- *
- * @parameter template="template"
- */
- private String template;
-
- /**
- * Location of Velocity template file for Embeddable superclass generation.
- * Ignored unless <code>makepairs</code> set to <code>true</code>. If
- * omitted, default template is used.
- *
- * @parameter embeddableSuperTemplate="embeddableSuperTemplate"
- */
- private String embeddableSuperTemplate;
-
- /**
- * Location of Velocity template file for Embeddable class generation. If
- * omitted, default template is used.
- *
- * @parameter embeddableTemplate="embeddableTemplate"
- */
- private String embeddableTemplate;
-
- /**
- * If set to <code>true</code> (default), a directory tree will be generated
- * in "destDir" corresponding to the class package structure, if set to
- * <code>false</code>, classes will be generated in "destDir"
- * ignoring their package.
- *
- * @parameter usePkgPath="usePkgPath" default-value="true"
- */
- private boolean usePkgPath;
-
- /**
- * If set to <code>true</code>, will generate String Property names.
- * Default is <code>false</code>.
- *
- * @parameter createPropertyNames="createPropertyNames" default-value="false"
- */
- private boolean createPropertyNames;
-
- public void execute() throws MojoExecutionException, MojoFailureException {
- // Create the destination directory if necessary.
- // TODO: (KJM 11/2/06) The destDir really should be added as a
- // compilation resource for maven.
- if (!destDir.exists()) {
- destDir.mkdirs();
- }
-
- Log logger = new MavenLogger(this);
- CayenneGeneratorMapLoaderAction loaderAction = new CayenneGeneratorMapLoaderAction();
- loaderAction.setMainDataMapFile(map);
-
- CayenneGeneratorEntityFilterAction filterAction = new CayenneGeneratorEntityFilterAction();
- filterAction.setClient(client);
- filterAction.setNameFilter(NamePatternMatcher.build(logger, includeEntities, excludeEntities));
-
- try {
- loaderAction.setAdditionalDataMapFiles(convertAdditionalDataMaps());
-
- DataMap dataMap = loaderAction.getMainDataMap();
-
- ClassGenerationAction generator = createGenerator();
- generator.setLogger(logger);
- generator.setTimestamp(map.lastModified());
- generator.setDataMap(dataMap);
- generator.addEntities(filterAction.getFilteredEntities(dataMap));
- // ksenia khailenko 15.10.2010
- // TODO add the "includeEmbeddables" and "excludeEmbeddables"
- // attributes
- generator.addEmbeddables(dataMap.getEmbeddables());
- // TODO add the "includeQueries" and "excludeQueries" attributes
- generator.addQueries(dataMap.getQueryDescriptors());
- generator.execute();
- } catch (Exception e) {
- throw new MojoExecutionException("Error generating classes: ", e);
- }
- }
-
- /**
- * Loads and returns DataMap based on <code>map</code> attribute.
- */
- protected File[] convertAdditionalDataMaps() throws Exception {
-
- if (additionalMaps == null) {
- return NO_FILES;
- }
-
- if (!additionalMaps.isDirectory()) {
- throw new MojoFailureException(
- "'additionalMaps' must be a directory.");
- }
-
- FilenameFilter mapFilter = new FilenameFilter() {
- @Override
- public boolean accept(File dir, String name) {
- return name != null &&
- name.toLowerCase().endsWith(".map.xml");
- }
- };
- return additionalMaps.listFiles(mapFilter);
- }
-
- /**
- * Factory method to create internal class generator. Called from
- * constructor.
- */
- protected ClassGenerationAction createGenerator() {
-
- ClassGenerationAction action;
- if (client) {
- action = new ClientClassGenerationAction();
- } else {
- action = new ClassGenerationAction();
- }
-
- action.setDestDir(destDir);
- action.setEncoding(encoding);
- action.setMakePairs(makePairs);
- action.setArtifactsGenerationMode(mode);
- action.setOutputPattern(outputPattern);
- action.setOverwrite(overwrite);
- action.setSuperPkg(superPkg);
- action.setSuperTemplate(superTemplate);
- action.setTemplate(template);
- action.setEmbeddableSuperTemplate(embeddableSuperTemplate);
- action.setEmbeddableTemplate(embeddableTemplate);
- action.setUsePkgPath(usePkgPath);
- action.setCreatePropertyNames(createPropertyNames);
-
- return action;
- }
-}