CompatibleSet.java 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. /*
  2. * Copyright (c) 2011-2025, baomidou (jobob@qq.com).
  3. *
  4. * Licensed under the Apache License, Version 2.0 (the "License");
  5. * you may not use this file except in compliance with the License.
  6. * You may obtain a copy of the License at
  7. *
  8. * http://www.apache.org/licenses/LICENSE-2.0
  9. *
  10. * Unless required by applicable law or agreed to in writing, software
  11. * distributed under the License is distributed on an "AS IS" BASIS,
  12. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  13. * See the License for the specific language governing permissions and
  14. * limitations under the License.
  15. */
  16. package com.baomidou.mybatisplus.extension.spi;
  17. import org.apache.ibatis.logging.Log;
  18. import org.apache.ibatis.session.SqlSession;
  19. import org.apache.ibatis.session.SqlSessionFactory;
  20. import java.io.InputStream;
  21. import java.util.function.Consumer;
  22. /**
  23. * Web 开发平台待兼容方法集接口类
  24. */
  25. public interface CompatibleSet {
  26. SqlSession getSqlSession(SqlSessionFactory sessionFactory);
  27. void closeSqlSession(SqlSession session, SqlSessionFactory sessionFactory);
  28. boolean executeBatch(SqlSessionFactory sqlSessionFactory, Log log, Consumer<SqlSession> consumer);
  29. /**
  30. * @deprecated 3.5.12 无需实现
  31. */
  32. @Deprecated
  33. InputStream getInputStream(String path) throws Exception;
  34. /**
  35. * 获取容器bean实例
  36. *
  37. * @param clz 类型
  38. * @return bean实例 (当无实例时返回null)
  39. * @since 3.5.12
  40. */
  41. default <T> T getBean(Class<T> clz) {
  42. return null;
  43. }
  44. }