Rename variable for better readability
This commit is contained in:
parent
d6390ce79f
commit
015f3fd1d2
|
@ -976,7 +976,7 @@ public class AnnotationMetaEntity extends AnnotationMeta {
|
||||||
if ( value != null ) {
|
if ( value != null ) {
|
||||||
final Object query = value.getValue();
|
final Object query = value.getValue();
|
||||||
if ( query instanceof String ) {
|
if ( query instanceof String ) {
|
||||||
final String hql = (String) query;
|
final String queryString = (String) query;
|
||||||
final List<String> paramNames = parameterNames( method );
|
final List<String> paramNames = parameterNames( method );
|
||||||
final List<String> paramTypes = parameterTypes( method );
|
final List<String> paramTypes = parameterTypes( method );
|
||||||
final String[] sessionType = sessionTypeFromParameters( paramNames, paramTypes );
|
final String[] sessionType = sessionTypeFromParameters( paramNames, paramTypes );
|
||||||
|
@ -984,12 +984,12 @@ public class AnnotationMetaEntity extends AnnotationMeta {
|
||||||
new QueryMethod(
|
new QueryMethod(
|
||||||
this,
|
this,
|
||||||
method.getSimpleName().toString(),
|
method.getSimpleName().toString(),
|
||||||
hql,
|
queryString,
|
||||||
returnType == null ? null : returnType.toString(),
|
returnType == null ? null : returnType.toString(),
|
||||||
containerType == null ? null : containerType.getQualifiedName().toString(),
|
containerType == null ? null : containerType.getQualifiedName().toString(),
|
||||||
paramNames,
|
paramNames,
|
||||||
paramTypes,
|
paramTypes,
|
||||||
isInsertUpdateDelete( hql ),
|
isInsertUpdateDelete( queryString ),
|
||||||
isNative,
|
isNative,
|
||||||
dao,
|
dao,
|
||||||
sessionType[0],
|
sessionType[0],
|
||||||
|
@ -999,14 +999,14 @@ public class AnnotationMetaEntity extends AnnotationMeta {
|
||||||
putMember( attribute.getPropertyName() + paramTypes, attribute );
|
putMember( attribute.getPropertyName() + paramTypes, attribute );
|
||||||
|
|
||||||
if ( isNative ) {
|
if ( isNative ) {
|
||||||
validateSql( method, mirror, hql, paramNames, value );
|
validateSql( method, mirror, queryString, paramNames, value );
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
validateHql( method, returnType, mirror, value, hql, paramNames, paramTypes );
|
validateHql( method, returnType, mirror, value, queryString, paramNames, paramTypes );
|
||||||
}
|
}
|
||||||
|
|
||||||
// now check that the query has a parameter for every method parameter
|
// now check that the query has a parameter for every method parameter
|
||||||
checkParameters( method, paramNames, paramTypes, mirror, value, hql );
|
checkParameters( method, paramNames, paramTypes, mirror, value, queryString );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1120,11 +1120,11 @@ public class AnnotationMetaEntity extends AnnotationMeta {
|
||||||
private void validateSql(
|
private void validateSql(
|
||||||
ExecutableElement method,
|
ExecutableElement method,
|
||||||
AnnotationMirror mirror,
|
AnnotationMirror mirror,
|
||||||
String hql,
|
String sql,
|
||||||
List<String> paramNames,
|
List<String> paramNames,
|
||||||
AnnotationValue value) {
|
AnnotationValue value) {
|
||||||
// for SQL queries check that there is a method parameter for every query parameter
|
// for SQL queries check that there is a method parameter for every query parameter
|
||||||
ParameterParser.parse(hql, new ParameterRecognizer() {
|
ParameterParser.parse(sql, new ParameterRecognizer() {
|
||||||
int ordinalCount = 0;
|
int ordinalCount = 0;
|
||||||
@Override
|
@Override
|
||||||
public void ordinalParameter(int sourcePosition) {
|
public void ordinalParameter(int sourcePosition) {
|
||||||
|
|
Loading…
Reference in New Issue