Open easybest opened 4 years ago
Good afternoon @easybest,
I wanted to take your attention on https://github.com/easybest/spring-data-mybatis/issues/189#issuecomment-683533742 , from what I have learn in v1, it is not possible to migrate to v2 without any further notices.
We use a lot of @Conditions coupled with XML before mappers in our spring-data-mybatis 1 application and so far, the example does not use before mappers (nor can execute all entities without errors).
I also take your attention on https://github.com/easybest/spring-data-mybatis/issues/215#issuecomment-683161764 , with a v2 documentation or v2 migration guide, this will solve #189, is there an estimated time of arrival for v2 documentation ?
Or before mappers completely removed ?
before mappers
: part XML statement for mybatis where statement will be injected after the WHERE condition. before mapper
just marked the mapper files been executed before spring data mybatis automatic generate mappers.
But in v2, it used mybatis starter from mybatis official, so you can define any mapper files if you want, and it will be added to the mybatis context before spring data mybatis, so theoretically, before mappers
still can be used in a more reasonable way.
If you want, you can show me some part of your project, and let me see that how to migrate it from V1.
@conditions was marked as @Deprecated
, it is not a good(normative) way to condition query. Instead of it, in v2, there's new ways to resolve the probleam.
and in my roadmap, I will maintain the v1 version after v2 features completed, and v1 will migrate all new features from v2.
Querydsl is a framework that enables the construction of statically typed SQL-like queries through its fluent API.
Spring Data Mybatis offer integration with Querydsl through QuerydslPredicateExecutor, as shown in the following example:
To make use of Querydsl support, extend QuerydslPredicateExecutor on your repository interface, as shown in the following example
The preceding example lets you write typesafe queries using Querydsl Predicate instances, as shown in the following example:
How to use?
Add dependencies to you pom.xml
spring-data-mybatis-querydsl
use APT to generate query code