OPENJPA-720 The pushdown sql for version columns in primary and secondary tables has unpredictable ordering in the select and from clause

git-svn-id: https://svn.apache.org/repos/asf/openjpa/trunk@694057 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Catalina Wei 2008-09-10 23:06:36 +00:00
parent b3951a1c11
commit a098b86d73
2 changed files with 4 additions and 3 deletions

View File

@ -24,6 +24,7 @@ import java.util.Arrays;
import java.util.Collections; import java.util.Collections;
import java.util.HashMap; import java.util.HashMap;
import java.util.Iterator; import java.util.Iterator;
import java.util.LinkedHashMap;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
import java.util.Map.Entry; import java.util.Map.Entry;
@ -229,7 +230,7 @@ public class ClassMappingInfo
if (cols == null) if (cols == null)
cols = Collections.EMPTY_LIST; cols = Collections.EMPTY_LIST;
if (_seconds == null) if (_seconds == null)
_seconds = new HashMap(); _seconds = new LinkedHashMap();
_seconds.put(tableName, cols); _seconds.put(tableName, cols);
} }

View File

@ -20,8 +20,8 @@ package org.apache.openjpa.jdbc.meta;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Arrays; import java.util.Arrays;
import java.util.HashMap;
import java.util.HashSet; import java.util.HashSet;
import java.util.LinkedHashMap;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
import java.util.Set; import java.util.Set;
@ -71,7 +71,7 @@ public class VersionMappingInfo
Table primaryTable = vers.getClassMapping().getTable(); Table primaryTable = vers.getClassMapping().getTable();
List<String> secondaryTableNames = Arrays.asList(vers List<String> secondaryTableNames = Arrays.asList(vers
.getClassMapping().getMappingInfo().getSecondaryTableNames()); .getClassMapping().getMappingInfo().getSecondaryTableNames());
Map<Table, List<Column>> assign = new HashMap<Table, List<Column>>(); Map<Table, List<Column>> assign = new LinkedHashMap<Table, List<Column>>();
for (Column col : templates) { for (Column col : templates) {
String tableName = col.getTableName(); String tableName = col.getTableName();
Table table; Table table;