Class SqlProviderAdapter

java.lang.Object
org.mybatis.dynamic.sql.util.SqlProviderAdapter

public class SqlProviderAdapter extends Object
Adapter for use with MyBatis SQL provider annotations.
Author:
Jeff Butler
  • Constructor Details

    • SqlProviderAdapter

      public SqlProviderAdapter()
  • Method Details

    • delete

      public String delete(DeleteStatementProvider deleteStatement)
    • generalInsert

      public String generalInsert(GeneralInsertStatementProvider insertStatement)
    • insert

      public String insert(InsertStatementProvider<?> insertStatement)
    • insertMultiple

      public String insertMultiple(MultiRowInsertStatementProvider<?> insertStatement)
    • insertMultipleWithGeneratedKeys

      public String insertMultipleWithGeneratedKeys(Map<String,Object> parameterMap)
      This adapter method is intended for use with MyBatis' @InsertProvider annotation when there are generated values expected from executing the insert statement. The canonical method signature for using this adapter method is as follows:
       public interface FooMapper {
           @InsertProvider(type=SqlProviderAdapter.class, method="insertMultipleWithGeneratedKeys")
           @Options(useGeneratedKeys=true, keyProperty="records.id")
           int insertMultiple(String insertStatement, @Param("records") List<Foo> records)
       }
       
      Parameters:
      parameterMap - The parameter map is automatically created by MyBatis when there are multiple parameters in the insert method.
      Returns:
      the SQL statement contained in the parameter map. This is assumed to be the one and only map entry of type String.
    • insertSelect

      public String insertSelect(InsertSelectStatementProvider insertStatement)
    • select

      public String select(SelectStatementProvider selectStatement)
    • update

      public String update(UpdateStatementProvider updateStatement)