You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cayenne.apache.org by aa...@apache.org on 2015/11/16 20:48:49 UTC
cayenne git commit: getting rid of unneeded entity copying
Repository: cayenne
Updated Branches:
refs/heads/master 80de06e8f -> 46aee4828
getting rid of unneeded entity copying
Project: http://git-wip-us.apache.org/repos/asf/cayenne/repo
Commit: http://git-wip-us.apache.org/repos/asf/cayenne/commit/46aee482
Tree: http://git-wip-us.apache.org/repos/asf/cayenne/tree/46aee482
Diff: http://git-wip-us.apache.org/repos/asf/cayenne/diff/46aee482
Branch: refs/heads/master
Commit: 46aee48280e63135bae7548b4623448a144057c8
Parents: 80de06e
Author: aadamchik <aa...@apache.org>
Authored: Mon Nov 16 14:46:54 2015 -0500
Committer: aadamchik <aa...@apache.org>
Committed: Mon Nov 16 14:46:54 2015 -0500
----------------------------------------------------------------------
.../org/apache/cayenne/ashwood/AshwoodEntitySorter.java | 10 +++-------
1 file changed, 3 insertions(+), 7 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/cayenne/blob/46aee482/cayenne-server/src/main/java/org/apache/cayenne/ashwood/AshwoodEntitySorter.java
----------------------------------------------------------------------
diff --git a/cayenne-server/src/main/java/org/apache/cayenne/ashwood/AshwoodEntitySorter.java b/cayenne-server/src/main/java/org/apache/cayenne/ashwood/AshwoodEntitySorter.java
index 9337955..2eba171 100644
--- a/cayenne-server/src/main/java/org/apache/cayenne/ashwood/AshwoodEntitySorter.java
+++ b/cayenne-server/src/main/java/org/apache/cayenne/ashwood/AshwoodEntitySorter.java
@@ -101,20 +101,16 @@ public class AshwoodEntitySorter implements EntitySorter {
*/
protected void doIndexSorter() {
- Map<DbEntity, List<DbRelationship>> reflexiveDbEntities = new HashMap<>(32);
-
+ Map<DbEntity, List<DbRelationship>> reflexiveDbEntities = new HashMap<>();
Digraph<DbEntity, List<DbAttribute>> referentialDigraph = new MapDigraph<>();
- Map<String, DbEntity> tableMap = new HashMap<>();
-
if (entityResolver != null) {
for (DbEntity entity : entityResolver.getDbEntities()) {
- tableMap.put(entity.getFullyQualifiedName(), entity);
referentialDigraph.addVertex(entity);
}
}
- for (DbEntity destination : tableMap.values()) {
+ for (DbEntity destination : entityResolver.getDbEntities()) {
for (DbRelationship candidate : destination.getRelationships()) {
if ((!candidate.isToMany() && !candidate.isToDependentPK()) || candidate.isToMasterPK()) {
DbEntity origin = candidate.getTargetEntity();
@@ -367,7 +363,7 @@ public class AshwoodEntitySorter implements EntitySorter {
ComponentRecord rec2 = components.get(t2);
int index1 = rec1.index;
int index2 = rec2.index;
-
+
int result = index1 > index2 ? 1 : (index1 < index2 ? -1 : 0);
// TODO: is this check really needed?