Questions tagged [spring-mybatis]

527 questions
5
votes
0 answers

Spring boot seems could not find mybatis mapper configurations(Mapped Statements collection does not contain value)

I am working with mybatis and spring-boot. I have been suffered for several hours with follow message. 2018-02-18 15:25:13.774 ERROR 77556 --- [nio-8080-exec-5] o.a.c.c.C.[.[.[/].[dispatcherServlet] : Servlet.service() for servlet…
Juneyoung Oh
  • 7,318
  • 16
  • 73
  • 121
5
votes
2 answers

Flush MyBatis Cache externally (outside of mapper)

I'm using MyBatis with second level cache activated via in xml mapper files. Suppose I want to interact with the underlying DB/DataSource decoupled from MyBatis, for instance via direct jdbcTemplate. How can I assure, that the MyBatis…
Mahatma_Fatal_Error
  • 720
  • 1
  • 10
  • 26
4
votes
1 answer

MyBatis Spring Boot custom type handler

I need help with Spring Boot and MyBatis integration. I have an issue with custom BaseTypeHandler. I've created a mapper: @MappedTypes({LocalDateTime.class}) public class LocalDateTimeHandler extends BaseTypeHandler { I've added a…
Alex Lybetsky
  • 41
  • 1
  • 1
  • 4
4
votes
2 answers

How to return an Optional from MyBatis query

Is there any way to get MyBatis to return an Optional instance rather than simply a MyClass instance?
GordyB
  • 179
  • 4
  • 14
4
votes
2 answers

MyBatis maps the attribute to the wrong Enum

My domain class has attributes mapped to an enum. Strangely MyBatis 3.4.x (Both 3.4.0 and 3.4.4. This worked with 3.3.x) with Spring MyBatis 1.3.1 tries to map it with an unrelated enum and gives the…
Gunith D
  • 1,843
  • 1
  • 31
  • 36
4
votes
0 answers

MyBatis google Guava support

I want to use google Guava collections as return types (resultType/resultMap) in MyBatis, and I wanted to know if this is supported out of the box. I did not find any official documentation regarding the same. Are Guava collections supported as…
4
votes
3 answers

How do I set MyBatis configuration properties in an application.properties file in a Spring Boot application?

The MyBatis Spring Boot Starter documentation lists properties that can be set in the application.properties file, and that list includes: configuration: A MyBatis Configuration bean. About available properties see the MyBatis reference page It's…
DaveyDaveDave
  • 9,821
  • 11
  • 64
  • 77
4
votes
1 answer

Updating multiple database rows in Spring - Mybatis

I am trying to update multiple database rows. Using mybatis 3.1 and spring 3 here is my update query in mapper.xml:
Shuddh
  • 1,920
  • 2
  • 19
  • 30
4
votes
2 answers

MyBatis Batch Insert/Update Using Annotations

Please let me know, how to perform batch insert/update in mybatis using annotated mappers.
4
votes
0 answers

mybatis foreach with annotations

Does anybody know how the following xml configuration can be expressed with annotations? INSERT ALL INTO EMPLOYEE (id,name)…
Nikolay
  • 1,111
  • 2
  • 12
  • 16
3
votes
3 answers

How to solve indexOutOfBounds error in MyBatis selectForUpdate?

I use postgreSQL. Here is my request in a myBatisMapper: