public static ModifyType detectModifyType(SQLiteModelMethod method, JQLType jqlType) {
		// Elements elementUtils = BaseProcessor.elementUtils;
		SQLiteDaoDefinition daoDefinition = method.getParent();
		SQLiteEntity entity = method.getEntity();

		ModifyType updateResultType = null;

		// check type of arguments
		int count = 0;
		for (Pair<String, TypeName> param : method.getParameters()) {
			if (method.isThisDynamicWhereConditionsName(param.value0)) {
				// if current parameter is dynamic where, skip it
				continue;
			}

			if (TypeUtility.isEquals(param.value1, typeName(entity.getElement()))) {
				count++;
			}
		}

		if (count == 0) {
			// method to update raw data: no bean is used
			updateResultType = jqlType == JQLType.UPDATE ? ModifyType.UPDATE_RAW : ModifyType.DELETE_RAW;

			ModelAnnotation annotation;

			if (jqlType == JQLType.UPDATE) {
				annotation = method.getAnnotation(BindSqlUpdate.class);

				AssertKripton.assertTrueOrInvalidMethodSignException(
						AnnotationUtility.extractAsStringArray(method, annotation, AnnotationAttributeType.FIELDS)
								.size() == 0,
						method, " can not use attribute %s in this kind of query definition",
						AnnotationAttributeType.FIELDS.getValue());
				AssertKripton
						.assertTrueOrInvalidMethodSignException(
								AnnotationUtility.extractAsStringArray(method, annotation,
										AnnotationAttributeType.EXCLUDED_FIELDS).size() == 0,
								method, " can not use attribute %s in this kind of query definition",
								AnnotationAttributeType.EXCLUDED_FIELDS.getValue());

			} else {
				annotation = method.getAnnotation(BindSqlDelete.class);
			}

			// check if there is only one parameter
			AssertKripton.failWithInvalidMethodSignException(method.getParameters().size() > 1
					&& TypeUtility.isEquals(method.getParameters().get(0).value1, daoDefinition.getEntityClassName()),
					method);

		} else if (count == 1) {
			updateResultType = jqlType == JQLType.UPDATE ? ModifyType.UPDATE_BEAN : ModifyType.DELETE_BEAN;

			// with dynamic where conditions, we have to add 1 to parameter
			// check size (one parameter is a bean and one is the where
			// conditions)
			AssertKripton.assertTrueOrInvalidMethodSignException(
					method.getParameters().size() == 1 + (method.hasDynamicWhereConditions() ? 1 : 0)
							+ (method.hasDynamicWhereArgs() ? 1 : 0),
					method, " expected only one parameter of %s type", daoDefinition.getEntityClassName());
		} else {
			throw (new InvalidMethodSignException(method,
					"only one parameter of type " + typeName(entity.getElement()) + " can be used"));
		}
		return updateResultType;
	}
public static ModifyType detectModifyType ( SQLiteModelMethod method , JQLType jqlType ) { SQLiteDaoDefinition daoDefinition = method . getParent ( ) ; SQLiteEntity entity = method . getEntity ( ) ; ModifyType updateResultType = null ; int count = 0 ; for ( Pair < String , TypeName > param : method . getParameters ( ) ) { if ( method . isThisDynamicWhereConditionsName ( param . value0 ) ) { continue ; } if ( TypeUtility . isEquals ( param . value1 , typeName ( entity . getElement ( ) ) ) ) { count ++ ; } } if ( count == 0 ) { updateResultType = jqlType == JQLType . UPDATE ? ModifyType . UPDATE_RAW : ModifyType . DELETE_RAW ; ModelAnnotation annotation ; if ( jqlType == JQLType . UPDATE ) { annotation = method . getAnnotation ( BindSqlUpdate . class ) ; AssertKripton . assertTrueOrInvalidMethodSignException ( AnnotationUtility . extractAsStringArray ( method , annotation , AnnotationAttributeType . FIELDS ) . size ( ) == 0 , method , " can not use attribute %s in this kind of query definition" , AnnotationAttributeType . FIELDS . getValue ( ) ) ; AssertKripton . assertTrueOrInvalidMethodSignException ( AnnotationUtility . extractAsStringArray ( method , annotation , AnnotationAttributeType . EXCLUDED_FIELDS ) . size ( ) == 0 , method , " can not use attribute %s in this kind of query definition" , AnnotationAttributeType . EXCLUDED_FIELDS . getValue ( ) ) ; } else { annotation = method . getAnnotation ( BindSqlDelete . class ) ; } AssertKripton . failWithInvalidMethodSignException ( method . getParameters ( ) . size ( ) > 1 && TypeUtility . isEquals ( method . getParameters ( ) . get ( 0 ) . value1 , daoDefinition . getEntityClassName ( ) ) , method ) ; } else if ( count == 1 ) { updateResultType = jqlType == JQLType . UPDATE ? ModifyType . UPDATE_BEAN : ModifyType . DELETE_BEAN ; AssertKripton . assertTrueOrInvalidMethodSignException ( method . getParameters ( ) . size ( ) == 1 + ( method . hasDynamicWhereConditions ( ) ? 1 : 0 ) + ( method . hasDynamicWhereArgs ( ) ? 1 : 0 ) , method , " expected only one parameter of %s type" , daoDefinition . getEntityClassName ( ) ) ; } else { throw ( new InvalidMethodSignException ( method , "only one parameter of type " + typeName ( entity . getElement ( ) ) + " can be used" ) ) ; } return updateResultType ; }
Detect method type.

@param method
the method
@param jqlType
jql type is necessary because method.jql can be not properly initialized
@return the modify type