Questions tagged [mybatis-mapper]

67 questions
1
vote
1 answer

Using Environment variables in Mybatis properties file

I am using mybatis to connect to database and i have stored some schema information in external properties file. I have kept this property file somewhere on my disk and referring it in my config.xml like below In Config.xml
0
votes
0 answers

Extends in mybatis do not take effect

I used the extends attribute of reslutMap in mybatis to use the invalid effect, and the parent class result of the query was not populated into the map I used the entends concrete path, but it still doesn't work, I want the fields of the query to…
roooooob
  • 1
  • 1
0
votes
1 answer

How to read nested optional object for an insert statement?

How to read nested optional object for an insert statement? I have the following classes; public class MyObj { private String myField; private MyChildObj myChild; public (String myField, MyChildObj myChild) { …
0
votes
0 answers

can't read resource in src/main/resources in test code init through classpath

I have project using Spring framework which set container AnnotaionConfigWebApplicationContext and MyBatis framework as SQL mapper. When I wrote test code in src/test/java for integration test and execute the execute test case, the initialization…
0
votes
0 answers

How can I map two different cursor from stored procedure with config xml only using Mybatis

Author (Cursor 1 Data) ID NAME PUBLISH_ID 1 John 123 2 Jane 345 Book (Cursor 2 Data) PUBLISH_ID BOOK_ID BOOK_NAME 123 B101 C# 123 B102 Python 345 J001 SQL 345 J002 JAVA Class Author { String Id String authName; …
0
votes
2 answers

Using if statement to select table inside FROM statement in ORACLE

please someone help me. I want to convert this query from mybatis to ORACLE SELECT * FROM TABLE_A , ( SELECT * FROM TABLE_B ) B WHERE .... A.key = B.key …
0
votes
0 answers

How to map composite class with generic in MyBatis?

We're using MyBatis with XMLs to map DB tables to Java POJOs. I'm facing an issue because we've a wrapper class for POJO fields. The structure is as follows: Wrapper class: class ColumnWrapper { T value; T nextValue; } Class to be mapped…
VaibS
  • 1,627
  • 1
  • 15
  • 21
0
votes
0 answers

How to map complex joins in MyBatis (one-to-many to many-to-one)

I know how to handle a one-to-many join in MyBatis using a mapper xml file with a result mapper with an embedded collection section. My understanding is that if there were a further one-to-many between the second and a third table, you could handle…
Koranke
  • 1
  • 1
0
votes
1 answer

MyBatis update returning a list of values

I have the following update query in my mybatis xml: UPDATE sandbox.roles SET rolename = #{roleName}, description = #{description}, active = #{active}, …
Mark Smith
  • 487
  • 1
  • 3
  • 16
0
votes
1 answer

Querying multiple records using composite key in the mybatis

I have a table with composite key. I want to query it in bulk in mybatis. Is it possible? if yes, how? Table structure of table Foo with foo_id_1 and foo_id_2 as composite primary key. { foo_id_1 uniqueIdentifier, foo_id_2 uniqueIdentifier, …
Anmol Garg
  • 113
  • 1
  • 6
0
votes
0 answers

Problem of org.apache.ibatis.binding.BindingException: Invalid bound statement (not found)

Here's my problem. I was trying to learn about mybatis in springboot. It can connect to JDBC correctly. However it keeps throwing Invalid bound statement (not found). And I cannot find the bug. pom.xml
0
votes
0 answers

How to compare dates with less than operator in mybatis XML in block

it works but is there a better way which mybatis documentation approves?
Lisbon
  • 126
  • 1
  • 1
  • 12
0
votes
0 answers

Error querying database. cannot invoke "Object.hashCode()" because "key" is null

I'm getting the following error Error Querying database. cannot invoke "Object.hashCode()" because "key" is null stack trace: org.mybatis.spring.MyBatisSyste Exception: nested exception is org.apache.ibatis.exceptions.Pers…
ip1234
  • 1
  • 2
0
votes
0 answers

Add a Mapper to cache with java api

I want to add a Mapper to cache with java api in MyBatis. I try this way and add Mapper's namespace to caches, but the statements of the Mapper still has no cache. is there any way to add Mapper statements into the cache? ... Cache cache = (new…
MHSaffari
  • 858
  • 1
  • 16
  • 39
0
votes
3 answers

mybatis mapper on node express xml regular expression error

when I open the web page via node express + mybatis-mapper, it works on dev environment on my PC(windows + vscode). But it not works on linux(ubuntu) server with below error message. It seems like xml encoding error, but I can't find the way to…
J.S.Choi
  • 1
  • 1