MybatisXMLLanguageDriver.java 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. /**
  2. * Copyright (c) 2011-2014, hubin (jobob@qq.com).
  3. * <p>
  4. * Licensed under the Apache License, Version 2.0 (the "License"); you may not
  5. * use this file except in compliance with the License. You may obtain a copy of
  6. * the License at
  7. * <p>
  8. * http://www.apache.org/licenses/LICENSE-2.0
  9. * <p>
  10. * Unless required by applicable law or agreed to in writing, software
  11. * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
  12. * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
  13. * License for the specific language governing permissions and limitations under
  14. * the License.
  15. */
  16. package com.baomidou.mybatisplus;
  17. import org.apache.ibatis.executor.parameter.ParameterHandler;
  18. import org.apache.ibatis.mapping.BoundSql;
  19. import org.apache.ibatis.mapping.MappedStatement;
  20. import org.apache.ibatis.scripting.xmltags.XMLLanguageDriver;
  21. /**
  22. * <p>
  23. * 继承 XMLLanguageDriver 重装构造函数,使用自定义 ParameterHandler
  24. * </p>
  25. *
  26. * @author hubin
  27. * @Date 2016-03-11
  28. */
  29. public class MybatisXMLLanguageDriver extends XMLLanguageDriver {
  30. @Override
  31. public ParameterHandler createParameterHandler(MappedStatement mappedStatement, Object parameterObject,
  32. BoundSql boundSql) {
  33. /* 使用自定义 ParameterHandler */
  34. return new MybatisDefaultParameterHandler(mappedStatement, parameterObject, boundSql);
  35. }
  36. }