-
Notifications
You must be signed in to change notification settings - Fork 2.6k
Support controlling to use lazy Initialization or not on mapper scanning feature #376
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
kazuki43zoo
added a commit
to kazuki43zoo/spring
that referenced
this issue
Apr 30, 2019
kazuki43zoo
added a commit
that referenced
this issue
Apr 30, 2019
Support enable/disable lazy Initialization on mapper scanning feature
kazuki43zoo
added a commit
that referenced
this issue
Apr 30, 2019
kazuki43zoo
added a commit
that referenced
this issue
May 1, 2019
kazuki43zoo
added a commit
to mybatis/mybatis.github.io
that referenced
this issue
May 1, 2019
pulllock
pushed a commit
to pulllock/mybatis-spring
that referenced
this issue
Oct 19, 2023
pulllock
pushed a commit
to pulllock/mybatis-spring
that referenced
this issue
Oct 19, 2023
Support enable/disable lazy Initialization on mapper scanning feature
pulllock
pushed a commit
to pulllock/mybatis-spring
that referenced
this issue
Oct 19, 2023
pulllock
pushed a commit
to pulllock/mybatis-spring
that referenced
this issue
Oct 19, 2023
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Since Spring Boot 2.2(not release yet), the lazy Initialization feature will be support. For details see https://spring.io/blog/2019/03/14/lazy-initialization-in-spring-boot-2-2. When it is enabled and one-to-one or one-to-many relationship map using
@One
or@Many
, there are cases that it does not work fine.Known case is as follow:
Solutions
Add
lazyInitialization
option on<mybatis:scan>
and@MapperScan
. The default value isfalse
(=not use lazy initialization). If developer want to use lazy initialization for mapper bean, it should be set to thetrue
expressly.e.g.)
Limitations
Description
If following feature use, cannot use lazy Initialization.
ref statement on
@One
or@Many
(<association select="...">
or<collection select="...">
) with other mapper statementinclude fragment with other mapper statement (
<include refid="...">
)ref cache with other mapper cache (
<cache-ref namespace="...">
)ref resultMap with other mapper result map (
<select resultMap="...">
)Solution for limitations
@DependsOn
(Spring's annotation)The text was updated successfully, but these errors were encountered: