Questions tagged [spring-mybatis]
527 questions
0
votes
1 answer
How to select a row having a column with min value
I am using oracle database and spring ibatis.
I have a query which will return two results from that i need to get a record which has minimum value on a column.
In Oracle i do that using below query:
SELECT *
FROM ANUMBER$ROOT ROOT
WHERE…

Prakash
- 139
- 1
- 9
0
votes
1 answer
myBatis: using typehandlers in insert statements
Trying to use the typehandler for an insert statement in mybatis, but it is not working. I am using mybatis-spring 1.2.1, mybatis 3.2.3. But I am getting an error message saying that parameter 2 is not set.
Here is the code,
mybatis config file:
…

aryanRaj_kary
- 503
- 2
- 7
- 28
0
votes
1 answer
My batis and spring integration
I am trying to source values from 2 different tables using mybatis and spring batch. I tried writing a composite item reader, with readers for each query but I am not able to successfully configure. Is this implementation correct or are there any…

Naren
- 1
- 2
0
votes
1 answer
MyBatis Parameter Passing
I want to use a common query template to do filtering in myBatis-3. My template look something like this:
SELECT * FROM (${subquery}) LIMIT ${page}, 20
The subquery placeholder can accept any query. I tried to pass the…

user3502676
- 317
- 3
- 7
0
votes
1 answer
transactionTemplate doesn't work with mybatis but I don't know why
I'm trying to using transactionTemplate to manage my transaction. The code may list as below:
private Boolean isCleanSuccess(){
return transactionTemplate.execute(new TransactionCallback() {
@Override
public Boolean…

Merorin
- 13
- 4
0
votes
1 answer
Is it possible to use bind with annotations?
I have the following abstract class:
public AbstractClass{
public abstract String getCode();
}
And the following concrete class:
public ConcreteClass extends AbstractClass{
public String getCode(){
return "EHY";
}
}
Now, I'd like…

Phate
- 6,066
- 15
- 73
- 138
0
votes
1 answer
execute Oracle stored procedure using MyBatis/Spring and parse results to a POJO
I'm trying to execute an Oracle stored procedure, and map the results to a POJO, with mybatis/spring using annotations (i.e. not XML). The inputs/outputs for the stored procedure are:
P_INPUT VARCHAR2 IN
P_OUTPUT…

Alex Woolford
- 4,433
- 11
- 47
- 80
0
votes
2 answers
How to debug spring-mybatis xml mappers ?
If there is a non syntax error in mybatis xml mapper like:
where "CutomObjTypeHandler" is misspelled for example, the app will start…

Nabil Sham
- 2,305
- 4
- 26
- 38
0
votes
1 answer
Spring Txn - multiple datasources, transactionManaggers, How to decide on a transaction manager in runtime using @Transcational?
I am looking at a way to dynamically pick up a transaction manager instance at runtime.
I have a service which is dynamically selecting a DAO reference at runtime based on a parameter like below
@Mapper //Spring-MyBatis mapper
public interface…

sriharishk
- 11
- 3
0
votes
1 answer
Reusing same ResultMap for two different queries in single fetch in mybatis
Requirement: I need to fetch partial data from two queries and populate the data into single resultmap.
Problem: When we get data from one query it is able to load the data into resultmap, but when I load the data from second query into the same…

Kishore Kanumalla
- 86
- 8
0
votes
1 answer
How to update the table value field which type is bit using mybatis in mysql?
I have a table called tbStudent. When I set the sex field using integers, and pass the parameter value in as 1 or 0 , it works just fine.
But now,when I try to update the sex field type using bits, and also pass the parameter value in as 1 or 0 , it…

flower
- 2,212
- 3
- 29
- 44
0
votes
2 answers
Trying to convert spring+spring security+hibernate project to spring+spring security+mybatis project
I am trying to convert this http://websystique.com/spring-security/spring-security-4-remember-me-example-with-hibernate/ into Spring, Spring Security and Mybatis, here is the project structure I have:
Since I using Java configuration, and I want to…

Vincent Zheng
- 122
- 1
- 11
0
votes
2 answers
Error injecting mybatis mapper in spring using Intellij IDEA
I configure it like this in the application-context.xml
And add @Component for the mapper interface.
@Component
public interface MenuMapper {}
And autowire it like this.
@Autowired
MenuMapper menuMapper;
It…

Angle Tom
- 1,060
- 1
- 11
- 29
0
votes
2 answers
spring can't autowire in mybatis NullPointerException
I am learning Spring and mybatis.
And I encountered a problem.I mainly learn from officail tutorial.But I can't get what i what.
The spring can't autowire UserMapper in ServiceImpl.
And there is a Exception which is
java.lang.NullPointerException
…

jack
- 5
- 7
0
votes
1 answer
org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type [org.mybatis.spring.SqlSessionTemplate]
Error in spring-boot with mybatis
@Component
public class UserMapper {
@Autowired
private SqlSessionTemplate sqlSessionTemplate;
public void testSpringBootWithMybatis() {
System.out.println("this is a test.");
}
}
and…

Jarvis
- 371
- 1
- 10
- 22