You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ofbiz.apache.org by do...@apache.org on 2009/09/21 18:04:13 UTC

svn commit: r817305 - /ofbiz/trunk/framework/entity/src/org/ofbiz/entity/condition/EntityOperator.java

Author: doogie
Date: Mon Sep 21 16:04:12 2009
New Revision: 817305

URL: http://svn.apache.org/viewvc?rev=817305&view=rev
Log:
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) {