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:
tine
  • 11
  • 3
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…
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…
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…
1
2 3 4 5