cayenne-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ntimof...@apache.org
Subject cayenne git commit: CAY-2347 cdbimport: can't get all relationships on the first pass release notes test case as actual fix was made by CAY-2321
Date Thu, 17 Aug 2017 09:31:51 GMT
Repository: cayenne
Updated Branches:
  refs/heads/master 50801e66d -> de0969a08


CAY-2347 cdbimport: can't get all relationships on the first pass
  release notes
  test case as actual fix was made by CAY-2321


Project: http://git-wip-us.apache.org/repos/asf/cayenne/repo
Commit: http://git-wip-us.apache.org/repos/asf/cayenne/commit/de0969a0
Tree: http://git-wip-us.apache.org/repos/asf/cayenne/tree/de0969a0
Diff: http://git-wip-us.apache.org/repos/asf/cayenne/diff/de0969a0

Branch: refs/heads/master
Commit: de0969a08bbb0ed1a0f834ef3a409f1ae03d7856
Parents: 50801e6
Author: Nikita Timofeev <stariy95@gmail.com>
Authored: Thu Aug 17 12:28:01 2017 +0300
Committer: Nikita Timofeev <stariy95@gmail.com>
Committed: Thu Aug 17 12:28:01 2017 +0300

----------------------------------------------------------------------
 docs/doc/src/main/resources/RELEASE-NOTES.txt   |  2 +
 .../cayenne/tools/DbImporterMojoTest.java       |  5 ++
 .../testAddedFlattenedRelationship-pom.xml      | 49 ++++++++++++++++++++
 .../testAddedFlattenedRelationship.map.xml      | 29 ++++++++++++
 ...estAddedFlattenedRelationship.map.xml-result | 37 +++++++++++++++
 .../dbimport/testAddedFlattenedRelationship.sql | 43 +++++++++++++++++
 6 files changed, 165 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cayenne/blob/de0969a0/docs/doc/src/main/resources/RELEASE-NOTES.txt
----------------------------------------------------------------------
diff --git a/docs/doc/src/main/resources/RELEASE-NOTES.txt b/docs/doc/src/main/resources/RELEASE-NOTES.txt
index 48cfa84..7e7a0fc 100644
--- a/docs/doc/src/main/resources/RELEASE-NOTES.txt
+++ b/docs/doc/src/main/resources/RELEASE-NOTES.txt
@@ -27,8 +27,10 @@ Bug Fixes:
 CAY-2312 Modeler: Undo does not work for checkboxes
 CAY-2318 Modeler: Query. Exception after Undo clicking
 CAY-2319 Modeler: Embeddable > Attributes. Undo does not cancel pasted objects
+CAY-2321 cdbimport: Reverse relationship is not created after adding and rev engineeering
new db table
 CAY-2323 Modeler: Graph. No warning while saving the image with existing name
 CAY-2331 cgen: broken templates for data map
+CAY-2347 cdbimport: can't get all relationships on the first pass
 CAY-2349 Cache issue: 'SelectQuery' with prefetches loses relationships
 CAY-2350 Expression: NotIn with empty collection returns empty result
 

http://git-wip-us.apache.org/repos/asf/cayenne/blob/de0969a0/maven-plugins/cayenne-maven-plugin/src/test/java/org/apache/cayenne/tools/DbImporterMojoTest.java
----------------------------------------------------------------------
diff --git a/maven-plugins/cayenne-maven-plugin/src/test/java/org/apache/cayenne/tools/DbImporterMojoTest.java
b/maven-plugins/cayenne-maven-plugin/src/test/java/org/apache/cayenne/tools/DbImporterMojoTest.java
index d3ac706..1f3a29a 100644
--- a/maven-plugins/cayenne-maven-plugin/src/test/java/org/apache/cayenne/tools/DbImporterMojoTest.java
+++ b/maven-plugins/cayenne-maven-plugin/src/test/java/org/apache/cayenne/tools/DbImporterMojoTest.java
@@ -267,6 +267,11 @@ public class DbImporterMojoTest extends AbstractMojoTestCase {
     }
 
     @Test
+    public void testAddedFlattenedRelationship() throws Exception {
+        test("testAddedFlattenedRelationship");
+    }
+
+    @Test
     public void testFilteringConfig() throws Exception {
         DbImporterMojo cdbImport = getCdbImport("config/pom-01.xml");
 

http://git-wip-us.apache.org/repos/asf/cayenne/blob/de0969a0/maven-plugins/cayenne-maven-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testAddedFlattenedRelationship-pom.xml
----------------------------------------------------------------------
diff --git a/maven-plugins/cayenne-maven-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testAddedFlattenedRelationship-pom.xml
b/maven-plugins/cayenne-maven-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testAddedFlattenedRelationship-pom.xml
new file mode 100644
index 0000000..a4ccf75
--- /dev/null
+++ b/maven-plugins/cayenne-maven-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testAddedFlattenedRelationship-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>cayenne-maven-plugin</artifactId>
+                <configuration>
+                    <map>target/test-classes/org/apache/cayenne/tools/dbimport/testAddedFlattenedRelationship.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/de0969a0/maven-plugins/cayenne-maven-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testAddedFlattenedRelationship.map.xml
----------------------------------------------------------------------
diff --git a/maven-plugins/cayenne-maven-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testAddedFlattenedRelationship.map.xml
b/maven-plugins/cayenne-maven-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testAddedFlattenedRelationship.map.xml
new file mode 100644
index 0000000..338e749
--- /dev/null
+++ b/maven-plugins/cayenne-maven-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testAddedFlattenedRelationship.map.xml
@@ -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/10/modelMap"
+          xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+          xsi:schemaLocation="http://cayenne.apache.org/schema/10/modelMap http://cayenne.apache.org/schema/10/modelMap.xsd"
+          project-version="10">
+
+    <db-entity name="A" schema="SCHEMA_01">
+        <db-attribute name="ID" type="INTEGER" isPrimaryKey="true" isMandatory="true"
length="10"/>
+    </db-entity>
+    <obj-entity name="A" className="A" dbEntityName="A"/>
+</data-map>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/cayenne/blob/de0969a0/maven-plugins/cayenne-maven-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testAddedFlattenedRelationship.map.xml-result
----------------------------------------------------------------------
diff --git a/maven-plugins/cayenne-maven-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testAddedFlattenedRelationship.map.xml-result
b/maven-plugins/cayenne-maven-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testAddedFlattenedRelationship.map.xml-result
new file mode 100644
index 0000000..2560d8e
--- /dev/null
+++ b/maven-plugins/cayenne-maven-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testAddedFlattenedRelationship.map.xml-result
@@ -0,0 +1,37 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<data-map xmlns="http://cayenne.apache.org/schema/10/modelMap"
+          xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+          xsi:schemaLocation="http://cayenne.apache.org/schema/10/modelMap http://cayenne.apache.org/schema/10/modelMap.xsd"
+          project-version="10">
+
+    <db-entity name="A" schema="SCHEMA_01">
+        <db-attribute name="ID" type="INTEGER" isPrimaryKey="true" isMandatory="true"
length="10"/>
+    </db-entity>
+    <db-entity name="A_B" schema="SCHEMA_01">
+        <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="SCHEMA_01">
+        <db-attribute name="ID" type="INTEGER" isPrimaryKey="true" isMandatory="true"
length="10"/>
+    </db-entity>
+
+    <obj-entity name="A" className="A" dbEntityName="A"/>
+    <obj-entity name="B" className="B" dbEntityName="B"/>
+
+    <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="a" source="A_B" target="A">
+        <db-attribute-pair source="A_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="b" source="A_B" target="B">
+        <db-attribute-pair source="B_ID" target="ID"/>
+    </db-relationship>
+
+    <obj-relationship name="bs" source="A" target="B" db-relationship-path="aBs.b"/>
+    <obj-relationship name="as" source="B" target="A" db-relationship-path="aBs.a"/>
+</data-map>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/cayenne/blob/de0969a0/maven-plugins/cayenne-maven-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testAddedFlattenedRelationship.sql
----------------------------------------------------------------------
diff --git a/maven-plugins/cayenne-maven-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testAddedFlattenedRelationship.sql
b/maven-plugins/cayenne-maven-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testAddedFlattenedRelationship.sql
new file mode 100644
index 0000000..cd2904d
--- /dev/null
+++ b/maven-plugins/cayenne-maven-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testAddedFlattenedRelationship.sql
@@ -0,0 +1,43 @@
+--  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.A (
+    ID INTEGER NOT NULL,
+    PRIMARY KEY (ID)
+);
+
+CREATE TABLE SCHEMA_01.B (
+    ID INTEGER NOT NULL,
+    PRIMARY KEY (ID)
+);
+
+CREATE TABLE SCHEMA_01.A_B (
+    A_ID INTEGER NOT NULL,
+    B_ID INTEGER NOT NULL
+    ,PRIMARY KEY (A_ID, B_ID)
+);
+
+ALTER TABLE SCHEMA_01.A_B
+    ADD FOREIGN KEY (A_ID)
+    REFERENCES SCHEMA_01.A (ID);
+
+ALTER TABLE SCHEMA_01.A_B
+    ADD FOREIGN KEY (B_ID)
+    REFERENCES SCHEMA_01.B (ID);
\ No newline at end of file


Mime
View raw message