Author: aadamchik
Date: Tue Dec 11 18:23:27 2012
New Revision: 1420323
URL: http://svn.apache.org/viewvc?rev=1420323&view=rev
Log:
CAY-1779 Flatten object entities for many to many relationships on reverse
engineering
renamed a few things and added Apache licenses to the new classes
Modified:
cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/access/DbLoader.java
cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/access/ManyToManyCandidateEntity.java
cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/access/ManyToManyCandidateEntityTest.java
Modified:
cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/access/DbLoader.java
URL:
http://svn.apache.org/viewvc/cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/access/DbLoader.java?rev=1420323&r1=1420322&r2=1420323&view=diff
==============================================================================
---
cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/access/DbLoader.java
(original)
+++
cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/access/DbLoader.java
Tue Dec 11 18:23:27 2012
@@ -750,10 +750,9 @@ public class DbLoader {
}
/**
- * Method remove temporary entities from dataMap and optimize relationships
- * @param map
+ * Flattens many-to-many relationships in the generated model.
*/
- private void optimizeObjRelationships(DataMap map) {
+ private void flattenManyToManyRelationships(DataMap map) {
List<ObjEntity> entitiesForDelete = new ArrayList<ObjEntity>();
for (ObjEntity curEntity : map.getObjEntities()) {
@@ -871,7 +870,7 @@ public class DbLoader {
loadDbRelationships(dataMap);
loadObjEntities(dataMap);
- optimizeObjRelationships(dataMap);
+ flattenManyToManyRelationships(dataMap);
fireObjEntitiesAddedEvents(dataMap);
}
}
Modified:
cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/access/ManyToManyCandidateEntity.java
URL:
http://svn.apache.org/viewvc/cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/access/ManyToManyCandidateEntity.java?rev=1420323&r1=1420322&r2=1420323&view=diff
==============================================================================
---
cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/access/ManyToManyCandidateEntity.java
(original)
+++
cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/access/ManyToManyCandidateEntity.java
Tue Dec 11 18:23:27 2012
@@ -1,3 +1,21 @@
+/*****************************************************************
+ * 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.access;
import org.apache.cayenne.map.DbRelationship;
Modified:
cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/access/ManyToManyCandidateEntityTest.java
URL:
http://svn.apache.org/viewvc/cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/access/ManyToManyCandidateEntityTest.java?rev=1420323&r1=1420322&r2=1420323&view=diff
==============================================================================
---
cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/access/ManyToManyCandidateEntityTest.java
(original)
+++
cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/access/ManyToManyCandidateEntityTest.java
Tue Dec 11 18:23:27 2012
@@ -1,3 +1,21 @@
+/*****************************************************************
+ * 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.access;
import junit.framework.TestCase;
@@ -20,9 +38,6 @@ import org.apache.cayenne.resource.URLRe
import java.net.URL;
import java.util.ArrayList;
-/**
- *
- */
public class ManyToManyCandidateEntityTest extends TestCase {
private DataMap map;