Skip to content

Commit f71e08f

Browse files
committed
Using jee term FetchType [ci skip]
1 parent 04726b0 commit f71e08f

File tree

4 files changed

+10
-10
lines changed

4 files changed

+10
-10
lines changed

src/main/java/org/apache/ibatis/annotations/Many.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,13 +20,13 @@
2020
import java.lang.annotation.RetentionPolicy;
2121
import java.lang.annotation.Target;
2222

23-
import org.apache.ibatis.mapping.Loading;
23+
import org.apache.ibatis.mapping.FetchType;
2424

2525
@Retention(RetentionPolicy.RUNTIME)
2626
@Target(ElementType.METHOD)
2727
public @interface Many {
2828
String select() default "";
2929

30-
Loading lazy() default Loading.DEFAULT;
30+
FetchType lazy() default FetchType.DEFAULT;
3131

3232
}

src/main/java/org/apache/ibatis/annotations/One.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,13 +20,13 @@
2020
import java.lang.annotation.RetentionPolicy;
2121
import java.lang.annotation.Target;
2222

23-
import org.apache.ibatis.mapping.Loading;
23+
import org.apache.ibatis.mapping.FetchType;
2424

2525
@Retention(RetentionPolicy.RUNTIME)
2626
@Target(ElementType.METHOD)
2727
public @interface One {
2828
String select() default "";
2929

30-
Loading lazy() default Loading.DEFAULT;
30+
FetchType lazy() default FetchType.DEFAULT;
3131

3232
}

src/main/java/org/apache/ibatis/builder/annotation/MapperAnnotationBuilder.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@
6767
import org.apache.ibatis.executor.keygen.SelectKeyGenerator;
6868
import org.apache.ibatis.io.Resources;
6969
import org.apache.ibatis.mapping.Discriminator;
70-
import org.apache.ibatis.mapping.Loading;
70+
import org.apache.ibatis.mapping.FetchType;
7171
import org.apache.ibatis.mapping.MappedStatement;
7272
import org.apache.ibatis.mapping.ResultFlag;
7373
import org.apache.ibatis.mapping.ResultMapping;
@@ -497,12 +497,12 @@ private String nestedSelectId(Result result) {
497497

498498
private boolean isLazy(Result result) {
499499
Boolean isLazy = null;
500-
if (Loading.DEFAULT != result.one().lazy()) {
501-
isLazy = (result.one().lazy() == Loading.LAZY);
500+
if (FetchType.DEFAULT != result.one().lazy()) {
501+
isLazy = (result.one().lazy() == FetchType.LAZY);
502502
}
503-
if (Loading.DEFAULT != result.many().lazy()) {
503+
if (FetchType.DEFAULT != result.many().lazy()) {
504504
if (isLazy == null) {
505-
isLazy = (result.many().lazy() == Loading.LAZY);
505+
isLazy = (result.many().lazy() == FetchType.LAZY);
506506
} else {
507507
throw new BuilderException("Cannot use both @One and @Many annotations in the same @Result");
508508
}

src/main/java/org/apache/ibatis/mapping/Loading.java renamed to src/main/java/org/apache/ibatis/mapping/FetchType.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,6 @@
1515
*/
1616
package org.apache.ibatis.mapping;
1717

18-
public enum Loading {
18+
public enum FetchType {
1919
LAZY, EAGER, DEFAULT
2020
}

0 commit comments

Comments
 (0)