Mybatis and Spring Boot 2.5 - mybatis

Will Mybatis support Spring Boot 2.5? Currently Mybatis Framework is shown as an unsupported Dependency on the Spring initializer Site for Spring Boot 2.5.0 M1 release.

Yes, it will once it reaches GA.
'M1' means it still is a milestone release.
See this answer for the details.

Even 2.5.0 GA can not choose Mybatis Framework In Initializr,
but I hear it is preparing now.
Besides, I can still use it by adding mybatis-spring-boot-starter to dependencies.

Related

Mapstruct Java Spring Compatibility

I am planning to use MapStruct in my project. Using JDK11, Spring boot 2.7.x has my current version but soon planning to upgrade it to JDK17 and Spring Boot 3.0. Based on documentation, latest library will support JDK8 onwards. Would like to know, whether library will support for above said specification. And also would like to know, how actively the project is going to support in near future?

spring-data-aerospike compatibility matrix

Hi looking for guidance on a version of spring-data-aerospike for Springboot 2.4.2. I don't see it listed here
There wasn't a specific spring-data-aerospike version that used Spring Boot 2.4.2.
spring-data-aerospike 2.4.2.RELEASE used Spring Boot 2.3.5.RELEASE.
spring-data-aerospike 2.5.0/3.0.0 used Spring Boot 2.5.1.
spring-data-aerospike 3.0.1 is using Spring Boot 2.5.3.
Using the latest spring-data-aerospike is recommended, if you can I would consider an upgrade, if its not an option - I would suggest using the latest version possible that works with your current version of Spring Boot (probably 2.4.2.RELEASE).

What is the difference between Spring Tool Suite 3 and 4?

I want to study Spring. In the case of STS (Spring Tool Suite) 3, there is "Spring legacy Project". 4 has a "Spring Starter Project", is it the same?
When I asked the Internet, people say "just use version 3".
What is the difference between version 3 and version 4?
Is "Spring Starter Project" and "Spring Legacy Project" the same thing?
1.What is the difference between version 3 and version 4?
Version 4.0 is the latest major release of the Spring Framework and the first to fully support Java 8 and few new features.[more]
Is "Spring Starter Project" and "Spring Legacy Project" the same thing?
Technically both are same spring project's. But they have some difference in configuration and build areas.
Spring Starter Project- Helps to create the spring boot project.(Spring Boot is basically an extension of the Spring framework which eliminated the boilerplate configurations required for setting up a Spring application.)
Spring Legacy Project - Helps to create the spring maven project. In which all the required configuration like servlet context,web,.. need to be configured manually either by using xml file or java classes.
Take a look at this page to know more about the difference between spring vs spring boot
If you are going to start learning spring from beginning, my suggestion is use Spring Starter Project because in Spring boot project setup is so simple, you can start coding with zero manual configuration.
For a more detailed introduction of the Spring Tools 4, please take a look at the blog post from the initial GA release of the Spring Tools 4:
https://spring.io/blog/2018/09/25/spring-tools-4-ga-released
There is no direct relation between the version numbers of the Spring Framework itself and the Spring Tools. In general, the Spring Tools 4 as well as the older Spring Tool Suite 3 support various Spring versions, ranging from Spring Framework 3 up to Spring Framework 5.2 and beyond.
I would strongly recommend to start with learning Spring by starting with Spring Boot, not the Spring Legacy projects. This is the way modern Spring applications are being built nowadays... :-)

Spring Integration Kafka not working

I am trying to explore Spring Integration using Kafka and Spring Boot. I am following this tutorial Spring Integration and Kafka
I am using the dependencies provided in that document,but i am getting the following exception
Caused by: org.xml.sax.SAXParseException: cvc-complex-type.3.2.2: Attribute 'compression-codec' is not allowed to appear in element 'int-kafka:producer-configuration'.
I think this is a jar mismatch issue, but i am not able to resolve it, i tried to change the version a lot but the combination is not working for me. Please find my below gradle dependencies.
compile('org.springframework.boot:spring-boot-starter-integration')
compile('org.springframework.boot:spring-boot-starter')
compile('org.apache.kafka:kafka_2.10:0.8.1.1')
compile('org.springframework.integration:spring-integration-kafka:2.1.0.RELEASE')
compile('org.springframework.integration:spring-integration-java-dsl:1.1.0.M1')
Please do let me know if you need more details on this one.
That's a very old article based on the 1.x version; the configuration has changed considerably - see the updated Spring Integration Kafka documentation in the spring-kafka reference manual.
Spring Integration Kafka (2.x) is now based on the Spring Kafka project.
http://projects.spring.io/spring-kafka/
There is also a sample application but it uses Java configuration, not XML.
I have used the following dependencies and they worked.
compile('org.springframework.boot:spring-boot-starter')
compile('org.springframework.integration:spring-integration-stream')
compile('org.springframework.integration:spring-integration-kafka:2.1.0.RELEASE')
compile('org.springframework.integration:spring-integration-java-dsl:1.1.0.M1')

MyBatis integration with JBoss 7.1 web application

Had anybody attempted to use MyBatis as their persistence library for a JBoss 7.1 /Java EE6 application?
I'm wondering what are the best approaches to handling connections, transations, rollbacks etc?
How about CDI support? Looking around online it seems at this time MyBatis only supports two Dependency Injection (JSR-330) frameworks, Google Guice and Spring. I did run into CDI Extensions which may be something look into.
My idea would be to have the container handle all of the above however it may be difficult getting to that point.
Any tips, hints, experiences?
There is a new mybatis-cdi module. It is not released yet, but you can try the snapshot, it is at github: https://github.com/mybatis/cdi
There is no CDI support at all but as you said, if you want DI go Spring or Guice.
With JBoss you have mainly two chances:
- EJB 3
- Spring
If using EJB 3 transactions are handled automatically by them. MyBatis just ignores transactions and lets the container commit/rollback.
When using Spring, MyBatis ties to Spring transactions using the integration module MyBatis-Spring.
I would create my own CDI bean - use #Produces for a factory, and #Inject to get the session.
Here is old iBatis Spring factory, that might be the producer, after some changes:
SqlMapClientFactoryBean