Author: doogie
Date: Mon Sep 21 16:04:12 2009
New Revision: 817305
URL:
http://svn.apache.org/viewvc?rev=817305&view=revLog:
Add some more register variants, to support other lookups.
Modified:
ofbiz/trunk/framework/entity/src/org/ofbiz/entity/condition/EntityOperator.java
Modified: ofbiz/trunk/framework/entity/src/org/ofbiz/entity/condition/EntityOperator.java
URL:
http://svn.apache.org/viewvc/ofbiz/trunk/framework/entity/src/org/ofbiz/entity/condition/EntityOperator.java?rev=817305&r1=817304&r2=817305&view=diff==============================================================================
--- ofbiz/trunk/framework/entity/src/org/ofbiz/entity/condition/EntityOperator.java (original)
+++ ofbiz/trunk/framework/entity/src/org/ofbiz/entity/condition/EntityOperator.java Mon Sep 21 16:04:12 2009
@@ -55,8 +55,15 @@
private static HashMap<String, EntityOperator> registry = new HashMap<String, EntityOperator>();
+ private static void registerCase(String name, EntityOperator operator) {
+ registry.put(name.toLowerCase(), operator);
+ registry.put(name.toUpperCase(), operator);
+ }
+
private static void register(String name, EntityOperator operator) {
- registry.put(name, operator);
+ registerCase(name, operator);
+ registerCase(name.replaceAll("-", "_"), operator);
+ registerCase(name.replaceAll("_", "-"), operator);
}
public static EntityOperator lookup(String name) {