Skip to content

Commit 076ed93

Browse files
committed
Add javadoc for annotations
1 parent 79f2c1d commit 076ed93

29 files changed

+458
-24
lines changed

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

Lines changed: 48 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/**
2-
* Copyright 2009-2018 the original author or authors.
2+
* Copyright 2009-2019 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -25,29 +25,76 @@
2525
import org.apache.ibatis.type.UnknownTypeHandler;
2626

2727
/**
28+
* The annotation that specify a mapping definition for the constructor argument.
29+
*
2830
* @author Clinton Begin
2931
*/
3032
@Documented
3133
@Retention(RetentionPolicy.RUNTIME)
3234
@Target({})
3335
public @interface Arg {
36+
37+
/**
38+
* Returns whether id column or not.
39+
*
40+
* @return {@code true} if id column; {@code false} if otherwise
41+
*/
3442
boolean id() default false;
3543

44+
/**
45+
* Return the column name(or column label) to map to this argument.
46+
*
47+
* @return the column name(or column label)
48+
*/
3649
String column() default "";
3750

51+
/**
52+
* Return the java type for this argument.
53+
*
54+
* @return the java type
55+
*/
3856
Class<?> javaType() default void.class;
3957

58+
/**
59+
* Return the jdbc type for column that map to this argument.
60+
*
61+
* @return the jdbc type
62+
*/
4063
JdbcType jdbcType() default JdbcType.UNDEFINED;
4164

65+
/**
66+
* Returns the {@link TypeHandler} type for retrieving a column value from result set.
67+
*
68+
* @return the {@link TypeHandler} type
69+
*/
4270
Class<? extends TypeHandler> typeHandler() default UnknownTypeHandler.class;
4371

72+
/**
73+
* Return the statement id for retrieving a object that map to this argument.
74+
*
75+
* @return the statement id
76+
*/
4477
String select() default "";
4578

79+
/**
80+
* Returns the result map id for mapping to a object that map to this argument.
81+
*
82+
* @return the result map id
83+
*/
4684
String resultMap() default "";
4785

86+
/**
87+
* Returns the parameter name for applying this mapping.
88+
*
89+
* @return the parameter name
90+
* @since 3.4.3
91+
*/
4892
String name() default "";
4993

5094
/**
95+
* Returns the column prefix that use when applying {@link #resultMap()}.
96+
*
97+
* @return the column prefix
5198
* @since 3.5.0
5299
*/
53100
String columnPrefix() default "";

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

Lines changed: 36 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,27 +26,62 @@
2626
import org.apache.ibatis.cache.impl.PerpetualCache;
2727

2828
/**
29+
* The annotation that specify to use cache on namespace(e.g. mapper interface).
30+
*
2931
* @author Clinton Begin
3032
* @author Kazuki Shimizu
3133
*/
3234
@Documented
3335
@Retention(RetentionPolicy.RUNTIME)
3436
@Target(ElementType.TYPE)
3537
public @interface CacheNamespace {
38+
39+
/**
40+
* Returns the cache implementation type to use.
41+
*
42+
* @return the cache implementation type
43+
*/
3644
Class<? extends Cache> implementation() default PerpetualCache.class;
3745

46+
/**
47+
* Returns the cache evicting implementation type to use.
48+
*
49+
* @return the cache evicting implementation type
50+
*/
3851
Class<? extends Cache> eviction() default LruCache.class;
3952

53+
/**
54+
* Returns the flush interval.
55+
*
56+
* @return the flush interval
57+
*/
4058
long flushInterval() default 0;
4159

60+
/**
61+
* Return the cache size.
62+
*
63+
* @return the cache size
64+
*/
4265
int size() default 1024;
4366

67+
/**
68+
* Returns whether use read/write cache.
69+
*
70+
* @return {@code true} if use read/write cache; {@code false} if otherwise
71+
*/
4472
boolean readWrite() default true;
4573

74+
/**
75+
* Returns whether block the cache at request time or not.
76+
*
77+
* @return {@code true} if block the cache; {@code false} if otherwise
78+
*/
4679
boolean blocking() default false;
4780

4881
/**
49-
* Property values for a implementation object.
82+
* Returns property values for a implementation object.
83+
*
84+
* @return property values
5085
* @since 3.4.2
5186
*/
5287
Property[] properties() default {};

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

Lines changed: 25 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/**
2-
* Copyright 2009-2016 the original author or authors.
2+
* Copyright 2009-2019 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -21,17 +21,41 @@
2121
import java.lang.annotation.Target;
2222

2323
/**
24+
* The annotation that conditional mapping definition for {@link TypeDiscriminator}.
25+
*
2426
* @author Clinton Begin
2527
*/
2628
@Documented
2729
@Retention(RetentionPolicy.RUNTIME)
2830
@Target({})
2931
public @interface Case {
32+
33+
/**
34+
* Return the condition value to apply this mapping.
35+
*
36+
* @return the condition value
37+
*/
3038
String value();
3139

40+
/**
41+
* Return the object type that create a object using this mapping.
42+
*
43+
* @return the object type
44+
*/
3245
Class<?> type();
3346

47+
/**
48+
* Return mapping definitions for property.
49+
*
50+
* @return mapping definitions for property
51+
*/
3452
Result[] results() default {};
3553

54+
/**
55+
* Return mapping definitions for constructor.
56+
*
57+
* @return mapping definitions for constructor
58+
*/
3659
Arg[] constructArgs() default {};
60+
3761
}

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

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/**
2-
* Copyright 2009-2016 the original author or authors.
2+
* Copyright 2009-2019 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -22,11 +22,18 @@
2222
import java.lang.annotation.Target;
2323

2424
/**
25+
* The annotation that be grouping mapping definitions for constructor.
26+
*
2527
* @author Clinton Begin
2628
*/
2729
@Documented
2830
@Retention(RetentionPolicy.RUNTIME)
2931
@Target(ElementType.METHOD)
3032
public @interface ConstructorArgs {
33+
/**
34+
* Returns mapping definitions for constructor.
35+
*
36+
* @return mapping definitions
37+
*/
3138
Arg[] value() default {};
3239
}

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

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/**
2-
* Copyright 2009-2016 the original author or authors.
2+
* Copyright 2009-2019 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -22,11 +22,18 @@
2222
import java.lang.annotation.Target;
2323

2424
/**
25+
* The annotation that specify an SQL for deleting record(s).
26+
*
2527
* @author Clinton Begin
2628
*/
2729
@Documented
2830
@Retention(RetentionPolicy.RUNTIME)
2931
@Target(ElementType.METHOD)
3032
public @interface Delete {
33+
/**
34+
* Returns an SQL for deleting record(s).
35+
*
36+
* @return an SQL for deleting record(s)
37+
*/
3138
String[] value();
3239
}

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,8 @@
2222
import java.lang.annotation.Target;
2323

2424
/**
25+
* The annotation that specify a method that provide an SQL for deleting record(s).
26+
*
2527
* @author Clinton Begin
2628
*/
2729
@Documented

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

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/**
2-
* Copyright 2009-2016 the original author or authors.
2+
* Copyright 2009-2019 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -22,11 +22,18 @@
2222
import java.lang.annotation.Target;
2323

2424
/**
25+
* The annotation that specify an SQL for inserting record(s).
26+
*
2527
* @author Clinton Begin
2628
*/
2729
@Documented
2830
@Retention(RetentionPolicy.RUNTIME)
2931
@Target(ElementType.METHOD)
3032
public @interface Insert {
33+
/**
34+
* Returns an SQL for inserting record(s).
35+
*
36+
* @return an SQL for inserting record(s)
37+
*/
3138
String[] value();
3239
}

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,8 @@
2222
import java.lang.annotation.Target;
2323

2424
/**
25+
* The annotation that specify a method that provide an SQL for inserting record(s).
26+
*
2527
* @author Clinton Begin
2628
*/
2729
@Documented

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

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,11 +24,18 @@
2424
import org.apache.ibatis.scripting.LanguageDriver;
2525

2626
/**
27+
* The annotation that specify a {@link LanguageDriver} to use.
28+
*
2729
* @author Clinton Begin
2830
*/
2931
@Documented
3032
@Retention(RetentionPolicy.RUNTIME)
3133
@Target(ElementType.METHOD)
3234
public @interface Lang {
35+
/**
36+
* Returns the {@link LanguageDriver} implementation type to use.
37+
*
38+
* @return the {@link LanguageDriver} implementation type
39+
*/
3340
Class<? extends LanguageDriver> value();
3441
}

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

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/**
2-
* Copyright 2009-2016 the original author or authors.
2+
* Copyright 2009-2019 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -23,14 +23,26 @@
2323
import org.apache.ibatis.mapping.FetchType;
2424

2525
/**
26+
* The annotation that specify the nested statement for retrieving collections.
27+
*
2628
* @author Clinton Begin
2729
*/
2830
@Documented
2931
@Retention(RetentionPolicy.RUNTIME)
3032
@Target({})
3133
public @interface Many {
34+
/**
35+
* Returns the statement id that retrieves collection.
36+
*
37+
* @return the statement id
38+
*/
3239
String select() default "";
3340

41+
/**
42+
* Returns the fetch strategy for nested statement.
43+
*
44+
* @return the fetch strategy
45+
*/
3446
FetchType fetchType() default FetchType.DEFAULT;
3547

3648
}

0 commit comments

Comments
 (0)