534 questions
0
votes
1
answer
53
views
Using Map in where clause in @Select query, giving error parameter not found
@Select("""
SELECT CURRENCY_CD,COUNTRY_CD,FEE_RATE_VAL FROM FEE
WHERE (COUNTRY_CD, CURRENCY_CD) IN
<foreach item="currencyCd" ...
0
votes
0
answers
33
views
MyBatis with Spring - @Delete annotation run multiple queries
How do I run multiple queries for a delete:
@Delete(
"""DELETE FROM punch_attachment WHERE tablename = '${tableName}' AND recordid = #{id};
DELETE FROM ...
0
votes
0
answers
37
views
MyBatis With Cloud Spanner -- Is Selecting A Collection of Inner POJOs w/Single Parent Key From Single Table Possible?
Looking at the MyBatis docs for building entities which themselves contain lists of other entities, the following SHOULD work unless I'm misunderstanding (completely possible), but it results in ...
0
votes
0
answers
51
views
mybatis springboot data copy from 1 databse server to another
Using mybatis batch session template to copy data from a table having millions of records to another table in another oracle server.
@Bean(value = "batchSqlSession")
@Autowired
public ...
0
votes
1
answer
624
views
Class org.apache.commons.pool2.impl.BaseObjectPoolConfig does not have member field 'java.time.Duration DEFAULT_DURATION_BETWEEN_EVICTION_RUNS
I'm trying to run a Java 21 app with Spring boot 2.7.18 and mybatis 3.5.10. The project compiles fine but I get the exception below when i run it. The DEFAULT_DURATION_BETWEEN_EVICTION_RUNS ...
0
votes
1
answer
660
views
Can we use mybatis <foreach> in UPDATE statement with mysql
I'm trying to run multiple update statements in my Spring Boot application that is calling MySQL db using MyBatis. XML configured query looks like this:
<update id="updateAnglersTrackPositions&...
1
vote
0
answers
464
views
Why can't I correctly use ibatis
I already induct the dependency of Mybatis, in way of pom. The part of the pom be like:
<dependency>
<groupId>org.mybatis.spring.boot</groupId>
<artifactId&...
-1
votes
1
answer
73
views
Updating List of values in MyBatis - SQLSyntaxErrorException
Getting SQLSyntaxErrorException while updating List of values in MyBatis. I am using separator=";" in forecach tag, but still I am getting the error. Below is my sql query
<update id=&...
0
votes
1
answer
183
views
Failed to map to class with member objects when used with Lombok
The Task class has an instance of TaskPayload as a member object.
@Data
@Builder
public class Task {
private int id;
private TaskPayload payload;
// skipping other members
}
@Data
@...
0
votes
0
answers
139
views
How can I avoid Mybatis reloading configuration for every `SqlSessionTemplate`?
Recently I noticed that my project takes quite a long time initializing Mybatis-related beans and classes. My database has tens of shards and there is a wrapper that routes queries to the shards. ...
0
votes
1
answer
454
views
What is resultType for bytea column of postgres while retrieving using mbatis mapper?
I have a query which returns data from bytea column from postgres.
The data type used at java side is byte[]
The query in mybatis mapper is like below :
<select id="getPhoto" ...
2
votes
2
answers
810
views
MyBatis xml update query using set tag throws org.springframework.jdbc.BadSqlGrammarException
Built update query in MyBatis xml but no luck to pass BadSqlGrammarException
Here's my query
<update id="updateRecordingVideoStatus">
UPDATE
...
0
votes
0
answers
373
views
how to use mybatis collection property when tables don't have direct relationship?
i have the following data (which were simplified for the purpose of this question):
t1
pk | a | b | c | other1
1 | text1 | 123 | text3 | otherValues1
2 | text2 | 456 | text4 | otherValues2
...
0
votes
0
answers
632
views
How to set global custom property in MyBatis with Spring configuration
It like to be able to set custom properties in MyBatis java config that I can reference later in my XML mappers. I've created a config class that sets two beans:
@Bean
public DataSource ...
0
votes
1
answer
279
views
how to wrap a boolean oracle function on a java integer using mybatis?
so this is pack_name.func_name working at sql developer:
using spring and mybatis, i have the issue to deal with oracle's BOOLEAN type with an old jdbc driver that i cannot update. trying this idea, ...
0
votes
1
answer
3k
views
MyBatis update returning a list of values
I have the following update query in my mybatis xml:
<update id="updateRoleValues" parameterType="map">
UPDATE sandbox.roles
SET rolename = #{roleName},
...
0
votes
0
answers
397
views
Choose schema name dynamically in mybatis xml based on request attribute
How to dynamically pick the schema name based on a request in my batis schema?
We would like to do this without changing the arguments or definitions of Mapper files or with parameterType as this ...
0
votes
1
answer
92
views
does these 2 ways of querying equivalent?
I'm a Spring backend learner, currently want to query some data from mysql. What I want is just a field from table.(I want categoryName in category).
First, I was using LambdaQueryWrapper. I wrote
...
1
vote
0
answers
1k
views
Type handler implementation for array of objects in myBatis
I am trying to write type handler for array of objects but this is giving me errors. I want to store arraylist as JSON in DB(mysql) and retrieve it as arraylist . I got the type handler examples with ...
0
votes
1
answer
560
views
How to compare MySQL binary UUID using dynamic SQL in Mybatis
We store one of the UUID values as binary(16) in mysql db.
spec
MyTable myTable = new MyTable();` //table
SqlColumn<Long> id = column("id");` // id column
SqlColumn<UUID> ...
0
votes
0
answers
586
views
Mocking Mybatis Mapper Not working in Spring boot integration tests
I am trying to mock my batis mapper.
@SpringBootTest(classes = ApiApplication.class, webEnvironment = WebEnvironment.DEFINED_PORT)
@AutoConfigureMockMvc
@TestPropertySource("classpath:test-...
-1
votes
1
answer
30
views
mysql query date erro
Why is the difference between the time of the database query and the result 13 hours?
0
votes
1
answer
952
views
UUID insert fails when using a UUIDTypeHandler
I'm trying to insert a UUID value, into a Postgresql table, so I've defined and configured a UUIDTypeHandler to deal with this at mybatis level.
Unfortunately, the insert operations are failing with ...
0
votes
0
answers
3k
views
spring mybatis - Failed to parse mapping resource
I made a boardContentMap in clubMapper.xml, but I don't know why they can't find it.
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sqlSessionFactory' defined ...
0
votes
1
answer
959
views
Getting error while iterating Map in mybatis
Getting this error while iterating over Map in mybatis
Cause: org.apache.ibatis.type.TypeException: Could not set parameters for mapping: ParameterMapping{property='__frch_key_0', mode=IN, javaType=...