Questions tagged [mybatis-mapper]
67 questions
0
votes
0 answers
mybatis cursor "A Cursor is already closed." error msg although transactional is defined
Mapper:
@SelectProvider(type = Provider.class, method = "retrieveTx")
@Results(value = {
@Result(property = "transactionId", column = "transaction_id", javaType = Integer.class, jdbcType = JdbcType.INTEGER),
…

Alvin
- 8,219
- 25
- 96
- 177
0
votes
1 answer
Mybatis returningHashMap
I am new to MyBatis. Could anyone help me to resolve this. Thank you.
I created a table named "CodeValue" with columns like "Code","Value" etc. I am retrieving the columns "Code","Value" from the table using mybatis selectMap() method which should…

rajani chowdhary
- 175
- 1
- 4
- 16
0
votes
1 answer
is there any way to force mybatis to use setter
I need to do some logic before the value is set from the db with mybatis,
however, my list field always has size=0
i really need help, if someone knows please help me,
I'm so appreciative

namnv
- 49
- 9
0
votes
1 answer
MyBatis Typehandler with String Substitution Instead of Prepared Statement
Does MyBatis support specifying type handlers with string substitution ${} instead of prepared statement substitution #{}?
I am trying to populate an order by clause with an enum value so I am using a TypeHandler for this but I can't get it to…

A_B
- 1,009
- 3
- 15
- 37
0
votes
0 answers
How to generalize similar namespaces of mappers in MyBatis?
There is an XML mapping associated with an interface FirstMapper:
The namespace…

diziaq
- 6,881
- 16
- 54
- 96
0
votes
1 answer
MyBatis mapping collection inside association
I have a next resultMap
...

Vasiliy Pupkov
- 1
- 1
0
votes
0 answers
Mybatis PostgreSQL throws an error "column does not exist" for an column that exists and its values are auto generated
Below is the create table statement which has successfully created the table in the PostgreSQL database.
CREATE TABLE
SYNC_REPOSITORIES (
REPOSITORY_ID BIGINT NOT NULL GENERATED ALWAYS AS IDENTITY PRIMARY KEY,
REPOSITORY_NAME…

Anusha HV
- 131
- 11
0
votes
1 answer
Unable to create hazelcast cache in mybatis mapper annotation
I have designed the Data access object mybatis mapper to read the read only data from Mysql database.
@Mapper
public interface XYZMapper {
@Select("SELECT TYPES FROM abc WHERE STORE_ID = #{storeId} and CUSTOMER_ID =…

Tech User
- 137
- 1
- 3
- 16
0
votes
1 answer
mybatis 3 + spring : Can I put a collection result into two groups based on a column value from the query result
I have a 2 java models like this
public class DeviceData {
private String name;
private List up;
private List down;
}
public class Metric{
private Long data;
private LocalDateTime timeStamp;
}
actual query…

srinivasreddyramaram
- 37
- 1
- 7
0
votes
1 answer
How to iterate through a dynamic list in MyBatis and access the objects of the list
I would like to iterate through a list, get the object's name and match that name with the record in my database. Then fetch that record.
I tried to use the foreach tag in Mybatis but I only get an empty list in return. Please help me out and point…

dev77
- 21
- 4
0
votes
0 answers
MyBatis proper way of mapping collections
I have POJO Team that contains list of anglers:
@Entity
public class Team {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
private Long id;
private int orderNumber;
private String name;
private int rank;
@ManyToOne
private Competition…
0
votes
1 answer
How to write mybatis mapper for this inserting in temporary table created in between?
I'm trying to write mapper using annotation mybatis for the following sql extract :
CREATE TEMP TABLE XYZ
.
/* Something */
.
CREATE TEMP TABLE ABC
as
Select ptype,pvalue,id,djob
from XYZ
where pvalue> 0
and CASE WHEN djob = ptype
then pvalue =…

Aman kumar
- 83
- 1
- 7
0
votes
0 answers
Mybatis batch insert performance slow down on JDK upgrade
We are upgrading our jdk from 1.8.0_51 to 1.8.0_251.
Project is using spring, spring-mybatis with oracle db.
There are some mapper.insert calls in the code where the performance deteriorates too much.
Data inserted - 100000 to a table of 14…

Adhiraj
- 3
- 4
0
votes
0 answers
Mybatis to map automatically to support dot
configuration
mybatis.configuration.map-underscore-to-camel-case=true
I…

HelloWorld
- 147
- 1
- 1
- 14
0
votes
0 answers
How use myBatis with relation OneToOne using (if possible) Java configuration in Spring?
I want to have a relation oneToOne between Person and Address. So my Entities will be (without getter and setter):
public class Address {
private Integer addressId;
private String streetAddress;
...getter and setter
}
public class…

AM13
- 661
- 1
- 8
- 18