Questions tagged [spring-mybatis]
527 questions
2
votes
1 answer
MyBatis stored procedure not running in postgres
Having a strange error when running a mybatis sproc that I can't quite figure out - the xml mapper I think is pretty straightforward:

Aeonstrife
- 553
- 1
- 6
- 20
2
votes
1 answer
Mybatis Insert PK manually
I am trying to single insert data into table with assigned PK. Manually assiging PK.
XML file
…

Surya Chandra
- 59
- 4
2
votes
0 answers
mybatis interceptor redundant wrap
I use mybatis interceptor to intercept before update sql operation, but now all query operations also go into "plugin" method.
I don't known why this happens. what i expect is only update operation go into this method , i think it is unnecessary to…

user14326144
- 21
- 2
2
votes
1 answer
Does mybatis change time zone while inserting into a DB?
While inserting a record into a table in Oracle, the time stamp in the created date column is 4 pm UTC(in the complete format eg...2020-05-20 10:30:20.15 UTC). That is verified even just before calling the save method of Mybatis. After the save…

Praveen Nvs
- 331
- 3
- 14
2
votes
1 answer
How to use UUID type handler with @Many annotation in MyBatis?
I`m using mybatis-spring-boot-starter with 2.1.0 version. And I need to process UUID type to get a nested collection.
@Select("SELECT id, name FROM t_service s")
@Results(value = {
@Result(column = "id", property = "id", jdbcType =…

Fedor Polschikov
- 21
- 1
- 4
2
votes
1 answer
why mybatis update and delete are not working?
I am developing a microservice using myBatis but UPDATE and DELETE statements are not working in it.
Even simple update statements are not executing whenever I execute it just stuck and no response
…

Eshu Yadav
- 61
- 1
- 7
2
votes
2 answers
Retrieve generated ID using MyBatis Annotation Spring Boot
I am trying to learn MyBatis. How to do I get the auto-generated ID after I have inserted a statement using the @InsertAnnotation.
Example of my code:
@Insert("INSERT INTO user(name, mobile, password) VALUES(#{name}, #{mobile},…

UnknownFunnyC200
- 23
- 1
- 3
2
votes
1 answer
Is there an "dirty checking mechanism" for MyBatis similar to that in Hibernate?
Hibernate has a dirty-checking mechanism which can auto-detect changes and generate appropriate UPDATE queries.
Is there any similar thing that exists for MyBatis?
I know there isn't any one-to-one mapping between a Java-Entity and DB-table in…

Lavish Kothari
- 2,211
- 21
- 29
2
votes
1 answer
Unable to call Mapper.xml file by using junit testing for the application developed using Mybatis+Springboot
I'm very new to junit testing. How to write junit test real database call from mybatis.xml file.
Please find the below code.
@RunWith(SpringRunner.class)
//@MybatisTest
@SpringBootTest
public class HotelMapperTest {
@Autowired
private…

Giridhar Reddy
- 45
- 1
- 5
2
votes
1 answer
Spring-boot with MyBatis doesn't rollback transactions
I've got a Spring Boot (version 2.1.8.RELEASE) web application (deployed inside a Wildfly 9 application container), with MyBatis, being auto-configured using the Spring Boot starter, but when using the @transactional annotation, the statements are…

Raj
- 125
- 1
- 11
2
votes
1 answer
Spring Data JDBC with MyBatis not finding custom query
I'm trying to use Spring Data JDBC with MyBatis. I'm interested in using the out-of-the-box CRUD methods that CrudRepository provides and in writing ADDITIONAL custom queries defined in MyBatis XML files.
From reading the instructions from…

Tony Falabella
- 335
- 1
- 6
- 17
2
votes
1 answer
Mapping multiple out params in mybatis mapper when calling an oracle stored procedure from java
The problem is this, i want to call a stored procedure from java, using mybatis / ibatis, this procedure has multiple OUT params,7 precisely, 2 of them are Numbers, the other 5 Varchars, plus one IN Number param
There is a huge limitation within…

Meiroa
- 51
- 5
2
votes
1 answer
MyBatis: how to map nested objecs
I want to avoid xml files in my project and use only annotations. What I'm not understand is how to map nested object with MyBatis 3.5.
I have a POJO like this
public class Father {
private String name;
private int age;
…

DeooK
- 535
- 3
- 8
- 23
2
votes
1 answer
Is it OK to globally set the mybatis executor mode to BATCH?
I am currently developing a Spring Boot app, which uses mybatis for its persistence layer. I want to optimize the batch insertion of entities in the following scenario:
// flightSerieMapper and legMapper are used to create a series of flights.
//…

BigONotation
- 4,406
- 5
- 43
- 72
2
votes
1 answer
what happened between getSqlSession and openConnection
My springboot + mybatis service is very slow, and I analysis the log and find this:
[DEBUG 2018-06-11 15:30:06.295] [http-nio-9973-exec-1] logid:102789834531274752 org.mybatis.spring.SqlSessionUtils.getSqlSession(SqlSessionUtils.java:97) [Creating a…

Peniel Shen
- 41
- 4