* Be case insensitive when comparing database columns.

This commit is contained in:
hns 2007-04-17 21:37:06 +00:00
parent 6a19c73e27
commit fdce5dc09e
2 changed files with 6 additions and 6 deletions

View file

@ -882,11 +882,11 @@ public final class Relation {
} }
} }
if (value == null) { if (value == null) {
if (columnName.equals(dbmap.getIDField())) { if (columnName.equalsIgnoreCase(dbmap.getIDField())) {
value = nonvirtual.getID(); value = nonvirtual.getID();
} else if (columnName.equals(dbmap.getNameField())) { } else if (columnName.equalsIgnoreCase(dbmap.getNameField())) {
value = nonvirtual.getName(); value = nonvirtual.getName();
} else if (columnName.equals(dbmap.getPrototypeField())) { } else if (columnName.equalsIgnoreCase(dbmap.getPrototypeField())) {
value = dbmap.getExtensionId(); value = dbmap.getExtensionId();
} }
} }
@ -1209,7 +1209,7 @@ public final class Relation {
public Map getKeyParts(INode home) { public Map getKeyParts(INode home) {
Map map = new HashMap(); Map map = new HashMap();
for (int i=0; i<constraints.length; i++) { for (int i=0; i<constraints.length; i++) {
if (ownType.getIDField().equals(constraints[i].localName)) { if (ownType.getIDField().equalsIgnoreCase(constraints[i].localName)) {
map.put(constraints[i].foreignName, home.getID()); map.put(constraints[i].foreignName, home.getID());
} else { } else {
map.put(constraints[i].foreignName, home.getString(constraints[i].localProperty())); map.put(constraints[i].foreignName, home.getString(constraints[i].localProperty()));

View file

@ -245,7 +245,7 @@ public class UpdateableSubnodeList extends OrderedSubnodeList {
*/ */
private Node updateBorder(int idx, NodeHandle nh, Node node) { private Node updateBorder(int idx, NodeHandle nh, Node node) {
String cret = updateCriteria[idx]; String cret = updateCriteria[idx];
if (rel.otherType.getIDField().equals(cret)) { if (rel.otherType.getIDField().equalsIgnoreCase(cret)) {
String nid = nh.getID(); String nid = nh.getID();
if (updateTypeDesc[idx] if (updateTypeDesc[idx]
&& OrderedSubnodeList.compareNumericString(nid, (String) lowestValues[idx]) < 0) { && OrderedSubnodeList.compareNumericString(nid, (String) lowestValues[idx]) < 0) {
@ -282,7 +282,7 @@ public class UpdateableSubnodeList extends OrderedSubnodeList {
Node node = nh.getNode(rel.otherType.getWrappedNodeManager()); Node node = nh.getNode(rel.otherType.getWrappedNodeManager());
for (int i = 0; i < updateCriteria.length; i++) { for (int i = 0; i < updateCriteria.length; i++) {
String cret = updateCriteria[i]; String cret = updateCriteria[i];
if (cret.equals(rel.otherType.getIDField())) { if (cret.equalsIgnoreCase(rel.otherType.getIDField())) {
check[i] = (updateTypeDesc[i] check[i] = (updateTypeDesc[i]
&& nh.getID().equals(lowestValues[i])) && nh.getID().equals(lowestValues[i]))
|| (!updateTypeDesc[i] || (!updateTypeDesc[i]