You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@velocity.apache.org by cb...@apache.org on 2019/04/21 23:12:54 UTC

svn commit: r1857929 - in /velocity/tools/branches/model: velocity-tools-examples/velocity-tools-examples-bookshelf/src/main/webapp/WEB-INF/ velocity-tools-model/src/main/java/org/apache/velocity/tools/model/filter/

Author: cbrisson
Date: Sun Apr 21 23:12:54 2019
New Revision: 1857929

URL: http://svn.apache.org/viewvc?rev=1857929&view=rev
Log:
[tools/model] Fix testcase after VTL objects package change

Modified:
    velocity/tools/branches/model/velocity-tools-examples/velocity-tools-examples-bookshelf/src/main/webapp/WEB-INF/velocity.properties
    velocity/tools/branches/model/velocity-tools-model/src/main/java/org/apache/velocity/tools/model/filter/ColumnMapper.java
    velocity/tools/branches/model/velocity-tools-model/src/main/java/org/apache/velocity/tools/model/filter/TableMapper.java

Modified: velocity/tools/branches/model/velocity-tools-examples/velocity-tools-examples-bookshelf/src/main/webapp/WEB-INF/velocity.properties
URL: http://svn.apache.org/viewvc/velocity/tools/branches/model/velocity-tools-examples/velocity-tools-examples-bookshelf/src/main/webapp/WEB-INF/velocity.properties?rev=1857929&r1=1857928&r2=1857929&view=diff
==============================================================================
--- velocity/tools/branches/model/velocity-tools-examples/velocity-tools-examples-bookshelf/src/main/webapp/WEB-INF/velocity.properties (original)
+++ velocity/tools/branches/model/velocity-tools-examples/velocity-tools-examples-bookshelf/src/main/webapp/WEB-INF/velocity.properties Sun Apr 21 23:12:54 2019
@@ -15,7 +15,7 @@
 # specific language governing permissions and limitations
 # under the License.
 
-runtime.introspector.uberspect = org.apache.velocity.tools.model.ModelUberspector, org.apache.velocity.util.introspection.UberspectImpl, org.apache.velocity.tools.view.WebappUberspector
+runtime.introspector.uberspect = org.apache.velocity.tools.model.context.ModelUberspector, org.apache.velocity.util.introspection.UberspectImpl, org.apache.velocity.tools.view.WebappUberspector
 
 model.identifiers.mapping.* = lowercase
 model.identifiers.mapping.*.* = lowercase

Modified: velocity/tools/branches/model/velocity-tools-model/src/main/java/org/apache/velocity/tools/model/filter/ColumnMapper.java
URL: http://svn.apache.org/viewvc/velocity/tools/branches/model/velocity-tools-model/src/main/java/org/apache/velocity/tools/model/filter/ColumnMapper.java?rev=1857929&r1=1857928&r2=1857929&view=diff
==============================================================================
--- velocity/tools/branches/model/velocity-tools-model/src/main/java/org/apache/velocity/tools/model/filter/ColumnMapper.java (original)
+++ velocity/tools/branches/model/velocity-tools-model/src/main/java/org/apache/velocity/tools/model/filter/ColumnMapper.java Sun Apr 21 23:12:54 2019
@@ -7,6 +7,12 @@ import java.io.Serializable;
 import java.util.HashMap;
 import java.util.Map;
 
+/**
+ * Node : For speed considerations, matching columns are calculated for each known column at configuration time. It means that
+ * unknown result set column names will only be applied the <b>default</b> column filter, aka *.*
+ * @param <T>
+ */
+
 public abstract class ColumnMapper<T extends Serializable> extends TableMapper<T>
 {
     public ColumnMapper(String configurationPrefix)
@@ -29,8 +35,8 @@ public abstract class ColumnMapper<T ext
             {
                 throw new ConfigurationException("invalid mappingEntry key: " + getConfigurationPrefix() + "." + key);
             }
-            String tablePattern = key.substring(0, dot);
-            String columnPattern = key.substring(dot + 1);
+            String tablePattern = key.substring(0, dot).replaceAll("\b_\b", "*");
+            String columnPattern = key.substring(dot + 1).replaceAll("\b_\b", "*");
             MappingEntry mappingEntry = new MappingEntry(columnPattern, leaf);
             addColumnMapping(tablePattern, columnPattern, mappingEntry);
         }
@@ -53,7 +59,7 @@ public abstract class ColumnMapper<T ext
 
         if ("*".equals(columnPattern) && "*".equals(tablePattern))
         {
-            defaultColumnLeaf = mappingEntry.getLeaf();
+            setDefaultColumnLeaf(mappingEntry.getLeaf());
         }
     }
 

Modified: velocity/tools/branches/model/velocity-tools-model/src/main/java/org/apache/velocity/tools/model/filter/TableMapper.java
URL: http://svn.apache.org/viewvc/velocity/tools/branches/model/velocity-tools-model/src/main/java/org/apache/velocity/tools/model/filter/TableMapper.java?rev=1857929&r1=1857928&r2=1857929&view=diff
==============================================================================
--- velocity/tools/branches/model/velocity-tools-model/src/main/java/org/apache/velocity/tools/model/filter/TableMapper.java (original)
+++ velocity/tools/branches/model/velocity-tools-model/src/main/java/org/apache/velocity/tools/model/filter/TableMapper.java Sun Apr 21 23:12:54 2019
@@ -4,12 +4,6 @@ import java.io.Serializable;
 import java.util.HashMap;
 import java.util.Map;
 
-/**
- * Node : For speed considerations, filters are calculated for each known column at configuration time. It means that
- * unknown result set column names will only be applied the <b>default</b> column filter, aka *.*
- * @param <T>
- */
-
 public abstract class TableMapper<T extends Serializable> extends Mapper<T>
 {
     public TableMapper(String configurationPrefix)