File tree 1 file changed +31
-0
lines changed
1 file changed +31
-0
lines changed Original file line number Diff line number Diff line change @@ -1208,6 +1208,37 @@ public interface NameMapper extends BaseMapper {
1208
1208
}
1209
1209
----
1210
1210
1211
+ [TIP]
1212
+ ====
1213
+ Since the MyBatis 3.5.6, you can omit the `type` attribute at each annotations
1214
+ when specify the default provider class as global configuration as follow:
1215
+
1216
+ .Mapper interface
1217
+ [source, java]
1218
+ ----
1219
+ public interface NameMapper extends BaseMapper {
1220
+ @SelectProvider
1221
+ List<Name> findByCondition(NameCondition condition);
1222
+ }
1223
+ ----
1224
+
1225
+ .Java based configuration
1226
+ [source, java]
1227
+ ----
1228
+ Configuration configuration = new Configuration();
1229
+ configuration.setDefaultSqlProviderType(TemplateFilePathProvider.class);
1230
+ ----
1231
+
1232
+ .XML based configuration
1233
+ [source, xml]
1234
+ ----
1235
+ <settings>
1236
+ <setting name="defaultSqlProviderType" value="org.mybatis.scripting.thymeleaf.support.TemplateFilePathProvider"/>
1237
+ </settings>
1238
+ ----
1239
+
1240
+ ====
1241
+
1211
1242
By default implementation, a template file path resolve following format and priority order.
1212
1243
If does not match all, it throw an exception that indicate not found a template file.
1213
1244
You can’t perform that action at this time.
0 commit comments