1
1
/**
2
- * Copyright 2009-2018 the original author or authors.
2
+ * Copyright 2009-2019 the original author or authors.
3
3
*
4
4
* Licensed under the Apache License, Version 2.0 (the "License");
5
5
* you may not use this file except in compliance with the License.
@@ -219,7 +219,7 @@ public String buildSelectByIdAndNameMultipleParamAndProviderContext(final Intege
219
219
}}.toString ();
220
220
}
221
221
222
- private Class getEntityClass (ProviderContext providerContext ){
222
+ private Class <?> getEntityClass (ProviderContext providerContext ) {
223
223
Method mapperMethod = providerContext .getMapperMethod ();
224
224
Class <?> declaringClass = mapperMethod .getDeclaringClass ();
225
225
Class <?> mapperClass = providerContext .getMapperType ();
@@ -234,27 +234,26 @@ private Class getEntityClass(ProviderContext providerContext){
234
234
}
235
235
}
236
236
}
237
- throw new RuntimeException ("The interface ["
238
- + mapperClass .getCanonicalName () + "] must specify a generic type." );
237
+ throw new RuntimeException ("The interface [" + mapperClass .getCanonicalName () + "] must specify a generic type." );
239
238
}
240
239
241
- private Map <String , String > getColumnMap (ProviderContext context ){
242
- Class entityClass = getEntityClass (context );
240
+ private Map <String , String > getColumnMap (ProviderContext context ) {
241
+ Class <?> entityClass = getEntityClass (context );
243
242
Field [] fields = entityClass .getDeclaredFields ();
244
243
Map <String , String > columnMap = new LinkedHashMap <String , String >();
245
244
for (Field field : fields ) {
246
245
BaseMapper .Column column = field .getAnnotation (BaseMapper .Column .class );
247
- if (column != null ){
246
+ if (column != null ) {
248
247
String columnName = column .value ();
249
- if (columnName == null || columnName .length () == 0 ){
248
+ if (columnName == null || columnName .length () == 0 ) {
250
249
columnName = field .getName ();
251
250
}
252
251
columnMap .put (columnName , field .getName ());
253
252
}
254
253
}
255
- if (columnMap .size () == 0 ){
256
- throw new RuntimeException ("There is no field in the class ["
257
- + entityClass . getCanonicalName () + "] that specifies the @BaseMapper.Column annotation." );
254
+ if (columnMap .size () == 0 ) {
255
+ throw new RuntimeException ("There is no field in the class [" + entityClass . getCanonicalName ()
256
+ + "] that specifies the @BaseMapper.Column annotation." );
258
257
}
259
258
return columnMap ;
260
259
}
@@ -298,7 +297,7 @@ public String buildUpdateSelective(ProviderContext context) {
298
297
sqlBuffer .append ("</if>" );
299
298
}
300
299
sqlBuffer .append ("</set>" );
301
- //For simplicity, there is no @Id annotation here, using default id directly
300
+ // For simplicity, there is no @Id annotation here, using default id directly
302
301
sqlBuffer .append ("where id = #{id}" );
303
302
sqlBuffer .append ("</script>" );
304
303
return sqlBuffer .toString ();
0 commit comments