Questions tagged [mybatis-mapper]
67 questions
3
votes
3 answers
How to solve indexOutOfBounds error in MyBatis selectForUpdate?
I use postgreSQL. Here is my request in a myBatisMapper:

Maksym Rybalkin
- 453
- 1
- 8
- 22
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
1
vote
1 answer
How to use conditional where clauses with Mybatis using annotations?
My service is as follows,
public List find(@RequestBody String type){
List conditions = new ArrayList<>();
WhereClauseParams condition = new WhereClauseParams("type", type);
…

Abhishek Acharya
- 339
- 4
- 12
1
vote
0 answers
how can i solve mapper null pointer error in dao with spring
[First, I was built bean for mapper interface and dao in Dispatcher Servlet.xml .Then I built the new package for mapper then add interface and i built dao too.In dao, i built service from dao bean in dispatcher servlet and mapper too.In…

Minthway Khaing
- 11
- 2
1
vote
0 answers
How to populate values to Map of a POJO in MyBatis
I have a Java class that looks like this.
class Student {
private String studeID;
private String UUID;
private Map attributes;
}
And I have SQL to get students as follows.
SELECT studeID, UUID, F_NAME, L_NAME, PHONE FROM…

Santosh Hegde
- 3,420
- 10
- 35
- 51
1
vote
0 answers
Typehandler with mybatis annotations
i have a question about mybatis annotations and Oracle stored procedure
i have this in my mapper.xml:
...
1
vote
2 answers
How to insert java HashMap keys and values as columns in database using mybatis
I am following a SpringBoot + MyBatis tutorial.I am able to insert simple objects into the database. Eg I tried inserting an employee object:
Employee{
private String id;
private String name;
}
@Mapper
public interface EmployeeMapper {
…

Akash Sharma
- 330
- 3
- 18
1
vote
0 answers
How can I propagate properties into a nested sql fragment?
I have an sql looks like this.
${alias}some AS ${prefix}some
Now I want to nest above fragment into another fragment while propagating those two properties.
${alias}other AS ${prefix}other,
…

Jin Kwon
- 20,295
- 14
- 115
- 184
1
vote
3 answers
How to map JSON_ARRAYAGG results with mybatis
I can't map the results from JSON_ARRAYAGG function.
mybatis mapper:

yong ho
- 3,892
- 9
- 40
- 81
1
vote
0 answers
Escaping braces from MyBatis value - Oracle
This is the problematic part of my MyBatis mapper:
contains(t.mycol, '{' || #{item} || '}') > 0
If, for example, the #{item} contains '}', I…

Ondřej
- 151
- 1
- 5
1
vote
2 answers
coalesce mybatis switch case
Iam using coalesce mybatis switch case in my query, where iam getting error like
Error querying database. Cause: java.sql.SQLException: ORA-01427:
single-row subquery returns more than one row
this is my query
(select
(case when…

Elakkiya
- 13
- 3
1
vote
0 answers
Why must Mybatis provide no parameter construction method?
I only defined a parameterized construction method in the class. When the number of parameters and the number of mappings are different, the query can still be correct.
I'm doing a one-to-many association query. When the ArrayList is not written in…

Jellow
- 93
- 6
1
vote
0 answers
Spring boot with Mybatis; can I split xml mappers to external location?
I'm develop some Spring boot applications accessing DB using Mybatis starter.
I'm trying to split xml mapper files to external location like project root (when dev env), or jar-located directory (when prod env).
I change some options on…

Choryu Park
- 11
- 1
1
vote
1 answer
Getting Map> using MyBatis
Here is my method, I need to get a Map>:
@Mapper
public interface CMBillMapper {
@MapKey("groupId")
Map> getCMInvoicesByIdListSQL(@Param("invoiceIds") Set invoiceIds);
}
Here is MyBatis xml…

Maksym Rybalkin
- 453
- 1
- 8
- 22
1
vote
1 answer
MyBatis is not closing Prepared Statement
I'm using mybatis 3.1 with spring 4.3 to connect Maria db. In my application I am using only 2 prepared statement (callable statement type). But after few hours of the running of the app it starts giving error "Can't create more than…

monu dwivedi
- 550
- 7
- 15