Questions tagged [spring-mybatis]
527 questions
3
votes
0 answers
MyBatis with Guava multimap
I want to use Guava multimap as a resultMap with MyBatis, to return a resultset that has a collection of several one to many entries, but I am not able to figure out the exact syntax for the same. Below is a sample of my table…

student for life
- 101
- 2
3
votes
1 answer
Can we import MyBatis XML file into another MyBatis XML file?
I am using Spring and MyBatis. I have tried to import another MyBatis file(which is auto-generated) by refering Can we import XML file into another XML file?.
1) MyTest.xml

user1040933
- 277
- 5
- 14
3
votes
1 answer
MyBatis 2nd nested list returns null
Everything was working with MyBatis and the objects I have outlined, until I introduced a LIST within the first child List object. So now, my structure is:
See Object Relationship
I've tried a number of approaches through the XML mapper, with…

J Rutledge
- 31
- 2
3
votes
2 answers
Allowed values for RequestParam in get url
Is it possible to set possible values for @RequestParam(value = "id") String id)
?
The ideal is: I give some List allowedValues and it automatically validate it. (This list will be loaded from database).
user7311580
3
votes
2 answers
mapping input and output parameters with MyBatis
I am learning how to use MyBatis. Honestly I like this framework very well. It is easy to use and I am happy with it because I can use my sql commands with it :) I use MyBatis 3.4.2 and PostgreSQL database.
For example I like how easy to execute a…

zappee
- 20,148
- 14
- 73
- 129
3
votes
1 answer
MyBatis DB_VENDOR doesn't work
can you please help me figure out what is wrong with the DB_VENDOR in MyBatis? I'm using mybatis 3.4.2, mybatis-spring 1.3.1, spring 4.3.6.RELEASE.
Everything, but the vendor dependent queries, works fine. The example query is not vendor dependent,…

Kousalik
- 3,111
- 3
- 24
- 46
3
votes
2 answers
How use PagingAndSorting with MyBatis?
I use mybatis for retriving data from the DB. But I would use the Pageable object (from spring) to have the pagination functionalities. Is this possible? It is still enough to extend myMapper with a…

code4fun
- 1,012
- 3
- 24
- 41
3
votes
1 answer
Error creating bean with name 'sqlSessionFactory' ... Invocation of init method failed; nested exception is java.lang.NullPointerException
I'm trying to integrate spring-mybatis in my application. I'm using spring 4.1.4 and mybatis 3.2.8 java 7 and the server is WebSphere Application Server Liberty. I'm using a spring java configuration class. This error is showing only when I'm…

user2282936
- 97
- 1
- 6
3
votes
2 answers
MyBatis TooManyResultsException for seemingly correct mapping
For the sake of resolving this problem I have pared down a lot of my code.
I continue to get this error as I try different things to get this collection working:
nested exception is
org.apache.ibatis.exceptions.TooManyResultsException: Expected…

Missy Williams
- 71
- 1
- 1
- 7
3
votes
1 answer
How to config mybatis mapper xml files in Spring boot's application.yml
I am a newbie to spring boot and I want to make my spring boot application integrate with mybatis and mysql database.
I generate the entity,mapper interfaces,and the mapper xml files with the generator. And I also use @MapperScan annotation to tell…

yimlu
- 175
- 1
- 12
3
votes
0 answers
spring cloud config client not injecting properties when MyBatis @MapperScan is present
I have an spring-boot application with 3 @Configuration annotated classes: Application, DBScannerConfig and ElasticSearchConfiguration. My application also consumes configuration from a Spring Cloud Config Server.
The problem is that, when I try to…

Emilio Garcia
- 141
- 5
3
votes
2 answers
Mybatis BindingException Parameter '__frch_e_0' not found
I'm trying to insert a list to Mybatis and getting the foloowing error:
org.apache.ibatis.binding.BindingException: Parameter '__frch_e_0' not found. Available parameters are [list]
Can you please let know what I'm missing. Thanks
DAO…

Harry
- 546
- 6
- 22
- 50
3
votes
2 answers
Mybatis - multiple base package in mapperscan?
How to configure multiple base packages for mapperconfigurer.
We tried giving comma separated/ semi colon to put multiple base packages.
@Bean
public MapperScannerConfigurer mapper1(Environment env)
throws Exception
{
MapperScannerConfigurer…

Karthikaiselvan
- 63
- 1
- 9
3
votes
2 answers
Dynamic datasource routing - DataSource router not initialized
I'm referring to this article, in which we can use the AbstractRoutingDataSource from Spring Framework to dynamically change the data source used by the application. I'm using Mybatis (3.3.0) with Spring (4.1.6.RELEASE). I want to switch to the…

Pankaj
- 3,512
- 16
- 49
- 83
3
votes
1 answer
MyBatis - ResultMap according to javaType
Hello StackOverflowers,
There is something I don't get about MyBatis resultMap.
The model I'm working on is beeing updated. We decided to create a new graph of objects which reflects our future DB schema (the current one is awful).
To sum up our…

Grégory Elhaimer
- 2,731
- 1
- 16
- 21