1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 package org.apache.ibatis.submitted.language;
17
18 import org.apache.ibatis.executor.parameter.ParameterHandler;
19 import org.apache.ibatis.mapping.BoundSql;
20 import org.apache.ibatis.mapping.MappedStatement;
21 import org.apache.ibatis.mapping.SqlSource;
22 import org.apache.ibatis.parsing.XNode;
23 import org.apache.ibatis.scripting.LanguageDriver;
24 import org.apache.ibatis.scripting.defaults.DefaultParameterHandler;
25 import org.apache.ibatis.session.Configuration;
26
27
28
29
30 public class VelocityLanguageDriver implements LanguageDriver {
31
32 @Override
33 public ParameterHandler createParameterHandler(MappedStatement mappedStatement, Object parameterObject,
34 BoundSql boundSql) {
35 return new DefaultParameterHandler(mappedStatement, parameterObject, boundSql);
36 }
37
38 @Override
39 public SqlSource createSqlSource(Configuration configuration, XNode script, Class<?> parameterType) {
40 return new VelocitySqlSource(configuration, script.getStringBody(""));
41 }
42
43 @Override
44 public SqlSource createSqlSource(Configuration configuration, String script, Class<?> parameterType) {
45 return new VelocitySqlSource(configuration, script);
46 }
47 }