Generates code to get the JDBCSupport instance and store it in a local
variable.
552151
private LocalVariable getJDBCSupport(CodeBuilder b) {
        pushJDBCSupport(b);
        LocalVariable supportVar =
            b.createLocalVariable("support", TypeDesc.forClass(JDBCSupport.class));
        b.storeLocal(supportVar);
        return supportVar;
    }
719442
public void generateWhereCondition(MethodSpec.Builder methodBuilder, SQLiteModelMethod method, SqlAnalyzer analyzer) {
		SQLiteEntity entity = method.getEntity();

		String beanParamName = method.getParameters().get(0).value0;
		SQLProperty property;
		boolean nullable;
		TypeName beanClass = typeName(entity.getElement());

		// methodBuilder.addStatement("$T<String>
		// _sqlWhereParams=getWhereParamsArray()", ArrayList.class);

		for (String item : analyzer.getUsedBeanPropertyNames()) {
			property = entity.findPropertyByName(item);
			// methodBuilder.addCode("_sqlWhereParams.add(");
			methodBuilder.addCode("_contentValues.addWhereArgs(");
			nullable = TypeUtility.isNullable(property);

			if (nullable && !(property.hasTypeAdapter())) {
				// transform null in ""
				methodBuilder.addCode("($L==null?\"\":", getter(beanParamName, beanClass, property));
			}

			// check for string conversion
			TypeUtility.beginStringConversion(methodBuilder, property);
			SQLTransformer.javaProperty2WhereCondition(methodBuilder, method, beanParamName, beanClass, property);
			// check for string conversion
			TypeUtility.endStringConversion(methodBuilder, property);

			if (nullable && !(property.hasTypeAdapter())) {
				methodBuilder.addCode(")");
			}

			methodBuilder.addCode(");\n");

		}
	}
613653
@Override
	public void generate(TypeSpec.Builder classBuilder, boolean mapFields, SQLiteModelMethod method) {
		Set<JQLProjection> fieldList = JQLChecker.getInstance().extractProjections(method, method.jql.value, method.getEntity());

		// generate method code
		MethodSpec.Builder methodBuilder = generateMethodBuilder(method);

		generateCommonPart(method, classBuilder, methodBuilder, fieldList, true);
		methodBuilder.addComment("Specialized part - $L - BEGIN", this.getClass().getSimpleName());
		generateSpecializedPart(method, classBuilder, methodBuilder, fieldList, selectType.isMapFields());
		methodBuilder.addComment("Specialized part - $L - END", this.getClass().getSimpleName());

		if (!method.isPagedLiveData()) {
			// method ForLiveData do not have to be generated for paged live
			// data
			classBuilder.addMethod(methodBuilder.build());
		}

	}
995174
public void buildReturnCode(MethodSpec.Builder methodBuilder, boolean updateMode, SQLiteModelMethod method, TypeName returnType) {
		if (returnType == TypeName.VOID) {

		} else if (isTypeIncludedIn(returnType, Boolean.TYPE, Boolean.class)) {
			methodBuilder.addJavadoc("\n");
			if (updateMode)
				methodBuilder.addJavadoc("@return <code>true</code> if record is updated, <code>false</code> otherwise");
			else
				methodBuilder.addJavadoc("@return <code>true</code> if record is deleted, <code>false</code> otherwise");
			methodBuilder.addJavadoc("\n");

			methodBuilder.addCode("return result!=0;\n");
		} else if (isTypeIncludedIn(returnType, Long.TYPE, Long.class, Integer.TYPE, Integer.class, Short.TYPE, Short.class)) {
			methodBuilder.addJavadoc("\n");
			if (updateMode) {
				methodBuilder.addJavadoc("@return number of updated records");
			} else {
				methodBuilder.addJavadoc("@return number of deleted records");
			}
			methodBuilder.addJavadoc("\n");

			methodBuilder.addCode("return result;\n");
		} else {
			// more than one listener found
			throw (new InvalidMethodSignException(method, "invalid return type"));
		}
	}
1359978
void generate(T input) throws SourceFileGenerationException {
    ClassName generatedTypeName = nameGeneratedType(input);
    try {
      Optional<TypeSpec.Builder> type = write(generatedTypeName, input);
      if (!type.isPresent()) {
        return;
      }
      buildJavaFile(generatedTypeName, type.get()).writeTo(filer);
    } catch (Exception e) {
      // if the code above threw a SFGE, use that
      Throwables.propagateIfPossible(e, SourceFileGenerationException.class);
      // otherwise, throw a new one
      throw new SourceFileGenerationException(
          Optional.<ClassName>absent(), e, getElementForErrorReporting(input));
    }
  }
659705
private Object getColumnTranslatedToJDBC( String columnName ) throws SQLException {
        notClosed();
        isRowSet();

        Value value = null;
        this.currentValue = null;

        try {
            value = row.getValue(columnName);
        } catch (javax.jcr.PathNotFoundException pnf) {
            // do nothing
        } catch (RepositoryException e) {
            throw new SQLException(e.getLocalizedMessage(), e);
        }

        if (value == null) return null;

        this.currentValue = JcrType.translateValueToJDBC(value);
        return this.currentValue;
    }
873720
private StatementHandler getStatementHandler(Class<? extends StatementHandler> statementHandlerClazz) {
        StatementHandler result = null;
        Constructor<? extends StatementHandler> constructor = null;

        Class<? extends StatementHandler> clazz = statementHandlerClazz;

        try {
            constructor = clazz.getConstructor(Overrider.class);
            result = constructor.newInstance(overrider);
        } catch (SecurityException e) {
            throw new MjdbcRuntimeException(ERROR_SH_INIT_FAILED, e);
        } catch (NoSuchMethodException e) {
            throw new MjdbcRuntimeException(ERROR_SH_INIT_FAILED, e);
        } catch (IllegalArgumentException e) {
            throw new MjdbcRuntimeException(ERROR_SH_INIT_FAILED, e);
        } catch (InstantiationException e) {
            throw new MjdbcRuntimeException(ERROR_SH_INIT_FAILED, e);
        } catch (IllegalAccessException e) {
            throw new MjdbcRuntimeException(ERROR_SH_INIT_FAILED, e);
        } catch (InvocationTargetException e) {
            throw new MjdbcRuntimeException(ERROR_SH_INIT_FAILED, e);
        }

        return result;
    }
640187
private void init_jdbcTypes() throws SQLException
    {
        ReportQuery q = (ReportQuery) getQueryObject().getQuery();
        m_jdbcTypes = new int[m_attributeCount];
        
        // try to get jdbcTypes from Query
        if (q.getJdbcTypes() != null)
        {
            m_jdbcTypes = q.getJdbcTypes();
        }
        else
        {
            ResultSetMetaData rsMetaData = getRsAndStmt().m_rs.getMetaData();
            for (int i = 0; i < m_attributeCount; i++)
            {
                m_jdbcTypes[i] = rsMetaData.getColumnType(i + 1);
            }
            
        }
    }
834997
private static JQL buildJQLUpdate(final SQLiteModelMethod method, final JQL result, final Map<JQLDynamicStatementType, String> dynamicReplace, String preparedJql) {
		final Class<? extends Annotation> annotation = BindSqlUpdate.class;

		// extract some informaction from method and bean
		// use annotation's attribute value and exclude and bean definition to
		// define field list
		// final Set<String> fields = defineFields(JQLType.UPDATE, method,
		// annotation, false);

		if (StringUtils.hasText(preparedJql)) {
			result.value = preparedJql;
			// UPDATE can contains bind parameter in column values and select
			// statement
			final One<Boolean> inWhereCondition = new One<Boolean>(false);
			final One<Boolean> inColumnsToUpdate = new One<Boolean>(false);

			JQLChecker.getInstance().analyze(method, result, new JqlBaseListener() {

				@Override
				public void enterProjected_columns(Projected_columnsContext ctx) {
					if (inColumnsToUpdate.value0) {
						result.containsSelectOperation = true;
					}

				}

				@Override
				public void enterConflict_algorithm(Conflict_algorithmContext ctx) {
					result.conflictAlgorithmType = ConflictAlgorithmType.valueOf(ctx.getText().toUpperCase());
				}

				@Override
				public void enterWhere_stmt(Where_stmtContext ctx) {
					inWhereCondition.value0 = true;
				}

				@Override
				public void exitWhere_stmt_clauses(Where_stmt_clausesContext ctx) {
					inWhereCondition.value0 = false;
				}

				@Override
				public void enterBind_parameter(Bind_parameterContext ctx) {
					if (inWhereCondition.value0) {
						result.bindParameterOnWhereStatementCounter++;
					} else {
						result.bindParameterAsColumnValueCounter++;
					}
				}

				@Override
				public void enterBind_dynamic_sql(Bind_dynamic_sqlContext ctx) {
					JQLDynamicStatementType dynamicType = JQLDynamicStatementType.valueOf(ctx.bind_parameter_name().getText().toUpperCase());

					int start = ctx.getStart().getStartIndex() - 1;
					int stop = ctx.getStop().getStopIndex() + 1;

					String dynamicWhere = result.value.substring(start, stop);

					dynamicReplace.put(dynamicType, dynamicWhere);

					// super.enterBind_dynamic_sql(ctx);
				}

				@Override
				public void enterColumns_to_update(Columns_to_updateContext ctx) {
					inColumnsToUpdate.value0 = true;
				}

				@Override
				public void exitColumns_to_update(Columns_to_updateContext ctx) {
					inColumnsToUpdate.value0 = false;
				}

			});

			JQLChecker.getInstance().replaceVariableStatements(method, preparedJql, new JQLReplaceVariableStatementListenerImpl() {

				@Override
				public String onWhere(String statement) {
					result.annotatedWhere = true;
					result.staticWhereConditions = true;
					return null;
				}

			});

			if (result.containsSelectOperation) {
				AssertKripton.assertTrueOrInvalidMethodSignException(method.getReturnClass().equals(TypeName.VOID), method, "defined JQL requires that method's return type is void");
			}
		} else {
			final SQLiteDaoDefinition dao = method.getParent();
			Set<String> fields;
			ModifyType modifyType = SqlModifyBuilder.detectModifyType(method, JQLType.UPDATE);
			if (modifyType == ModifyType.UPDATE_BEAN) {
				fields = extractFieldsFromAnnotation(method, annotation, false);
			} else {
				fields = extractFieldsFromMethodParameters(method, annotation);
			}

			AssertKripton.assertTrueOrInvalidMethodSignException(fields.size() > 0, method, "no field was specified for update");

			result.conflictAlgorithmType = ConflictAlgorithmType.valueOf(AnnotationUtility.extractAsEnumerationValue(method.getElement(), annotation, AnnotationAttributeType.CONFLICT_ALGORITHM_TYPE));

			StringBuilder builder = new StringBuilder();
			builder.append(UPDATE_KEYWORD);
			builder.append(" " + result.conflictAlgorithmType.getSqlForInsert());
			// entity name
			builder.append(dao.getEntitySimplyClassName());

			// recreate fields
			final One<String> prefix = new One<>("");
			if (result.hasParamBean()) {
				prefix.value0 = result.paramBean + ".";
			}

			builder.append(" " + SET_KEYWORD + " ");

			builder.append(forEachFields(fields, new OnFieldListener() {

				@Override
				public String onField(String item) {
					return item + "=" + SqlAnalyzer.PARAM_PREFIX + prefix.value0 + item + SqlAnalyzer.PARAM_SUFFIX;
				}
			}));

			builder.append(defineWhereStatement(method, result, annotation, dynamicReplace));

			result.value = builder.toString();
		}
		result.operationType = JQLType.UPDATE;
		result.dynamicReplace = dynamicReplace;
		return result;
	}
160086
private JdbcTemplateProxy getProxy(){
		if(_proxy == null){
			_proxy = new JdbcTemplateProxy();
			_proxy.setJdbcTemplate(jdbcTemplate);
		}
		return _proxy;
	}
21309
function getLocalExportMetadata(programPath){
    const bindingKindLookup = new Map();

    programPath.get('body').forEach(child => {
        let kind;
        if (child.isImportDeclaration()) {
            kind = 'import';
        }
        else {
            if (child.isExportDefaultDeclaration()) {
                child = child.get('declaration');
            }
            if (child.isExportNamedDeclaration() && child.node.declaration) {
                child = child.get('declaration');
            }

            if (child.isFunctionDeclaration()) {
                kind = 'hoisted';
            }
            else if (child.isClassDeclaration()) {
                kind = 'block';
            }
            else if (child.isVariableDeclaration({ kind: 'var' })) {
                kind = 'var';
            }
            else if (child.isVariableDeclaration()) {
                kind = 'block';
            }
            else {
                return;
            }
        }

        Object.keys(child.getOuterBindingIdentifiers()).forEach(name => {
            bindingKindLookup.set(name, kind);
        });
    });

    const localMetadata = new Map();
    const getLocalMetadata = idPath => {
        const localName = idPath.node.name;
        let metadata = localMetadata.get(localName);
        if (!metadata) {
            const kind = bindingKindLookup.get(localName);

            if (kind === undefined) {
                throw idPath.buildCodeFrameError(`Exporting local "${localName}", which is not declared.`);
            }

            metadata = {
                names: [],
                kind,
            };
            localMetadata.set(localName, metadata);
        }
        return metadata;
    };

    programPath.get('body').forEach(child => {
        if (child.isExportNamedDeclaration() && !child.node.source) {
            if (child.node.declaration) {
                const declaration = child.get('declaration');
                const ids = declaration.getOuterBindingIdentifierPaths();
                Object.keys(ids).forEach(name => {
                if (name === '__esModule') {
                    throw declaration.buildCodeFrameError('Illegal export "__esModule".');
                }

                getLocalMetadata(ids[name]).names.push(name);
                });
            }
            else {
                child.get('specifiers').forEach(spec => {
                    const local = spec.get('local');
                    const exported = spec.get('exported');

                    if (exported.node.name === '__esModule') {
                        throw exported.buildCodeFrameError('Illegal export "__esModule".');
                    }

                    getLocalMetadata(local).names.push(exported.node.name);
                });
            }
        }
        else if (child.isExportDefaultDeclaration()) {
            const declaration = child.get('declaration');
            if (
                declaration.isFunctionDeclaration() ||
                declaration.isClassDeclaration()
            ) {
                getLocalMetadata(declaration.get('id')).names.push('default');
            }
            else {
                // These should have been removed by the nameAnonymousExports() call.
                throw declaration.buildCodeFrameError('Unexpected default expression export.');
            }
        }
    });

    return localMetadata;
}
716228
void generateClassCode(Definition def, String className, String subDir)
   {
      if (className == null || className.equals(""))
         return;

      try
      {
         String clazzName = this.getClass().getPackage().getName() + ".code." + className + "CodeGen";
         String javaFile =
               Definition.class.getMethod("get" + className + "Class").invoke(def, (Object[]) null) + ".java";
         FileWriter fw;
         if (subDir == null)
            fw = Utils.createSrcFile(javaFile, def.getRaPackage(), def.getOutputDir());
         else
            fw = Utils.createSrcFile(javaFile, def.getRaPackage() + "." + subDir, def.getOutputDir());

         Class<?> clazz = Class.forName(clazzName, true, Thread.currentThread().getContextClassLoader());
         AbstractCodeGen codeGen = (AbstractCodeGen) clazz.newInstance();

         codeGen.generate(def, fw);

         fw.flush();
         fw.close();
      }
      catch (Exception e)
      {
         e.printStackTrace();
      }
   }
144128
protected PreparedStatement createStatment(Connection conn, Sql sql) throws SQLException {

		if (sql == null) {
			throw new NullPointerException("Sql Object is NULL");
		}
		String sqlBody = sql.getSql();

		if (StringUtils.isNotEmpty(sqlBody)) {
			PreparedStatement stmt = null;
			if (sql.isProcedure()) {
				stmt = conn.prepareCall("{" + sqlBody + "}");
			} else if (sql.isPreperStatement()) {
				stmt = conn.prepareStatement(sqlBody);
			}
			
			if (stmt != null) {
				Map<Integer, Object> prepareValues = sql.getPreperValues();
	
				Set<Integer> indexSet = prepareValues.keySet();
				for (Integer index : indexSet) {
					Object value = prepareValues.get(index);
					if (index != null && value != null) {
						if (value instanceof String) {
							stmt.setString(index, value.toString());
						} else if (value instanceof Integer) {
							stmt.setInt(index, ((Integer) value).intValue());
						} else if (value instanceof Long) {
							stmt.setLong(index, ((Long) value).longValue());
						} else if (value instanceof Double) {
							stmt.setDouble(index, ((Double) value).doubleValue());
						} else if (value instanceof Float) {
							stmt.setFloat(index, ((Float) value).floatValue());
						} else if (value instanceof Short) {
							stmt.setShort(index, ((Short) value).shortValue());
						} else if (value instanceof Byte) {
							stmt.setByte(index, ((Byte) value).byteValue());
						} else if (value instanceof Boolean) {
							stmt.setBoolean(index, ((Boolean) value).booleanValue());
						} else if (value instanceof Date) {
							stmt.setDate(index, (Date) value);
						} else if (value instanceof Time) {
							stmt.setTime(index, (Time) value, Calendar.getInstance());
						} else if (value instanceof Blob) {
							stmt.setBlob(index, (Blob) value);
						} else if (value instanceof Clob) {
							stmt.setClob(index, (Clob) value);
						} else if (value instanceof BigDecimal) {
							stmt.setBigDecimal(index, (BigDecimal) value);
						} else if (value instanceof byte[]) {
							stmt.setBytes(index, (byte[]) value);
						} else if (value instanceof Out) {
							if (stmt instanceof CallableStatement) {
								int outType = getProcedureOutType((Out)value);
								if (outType != -999) {
									((CallableStatement)stmt).registerOutParameter(index, outType);
								}
							}
						} else {
							stmt.setObject(index, value);
						}
					}
				}
				return stmt;
			} else {
				return conn.prepareStatement(sqlBody);
			}
		}
18217
String getPreparedStatementText(ControlBeanContext context, Method m, Object[] args) {
        StringBuilder sb = new StringBuilder();
        for (SqlFragment sf : _children) {
            sb.append(sf.getPreparedStatementText(context, m, args));
        }
        return sb.toString();
    }
746886
public static void main(String[] args) throws Exception {

		prepareTestDb();
		JDBCExample tut = new JDBCExample();
		JobExecutionResult res = LocalExecutor.execute(tut, args);
		System.out.println("runtime: " + res.getNetRuntime());

		System.exit(0);
	}
61086
private void generateJavaDoc(final SQLiteModelMethod method, MethodSpec.Builder methodBuilder, boolean updateMode, String whereCondition, Pair<String, List<Pair<String, TypeName>>> where,
			List<Pair<String, TypeName>> methodParams) {

		final List<SQLProperty> updatedProperties = new ArrayList<>();
		final One<Boolean> onWhereStatement = new One<Boolean>(false);

		String sqlModify = JQLChecker.getInstance().replace(method, method.jql, new JQLReplacerListenerImpl(method) {

			@Override
			public void onWhereStatementBegin(Where_stmtContext ctx) {
				onWhereStatement.value0 = true;
			}

			@Override
			public void onWhereStatementEnd(Where_stmtContext ctx) {
				onWhereStatement.value0 = false;
			}

			@Override
			public String onColumnNameToUpdate(String columnName) {
				SQLProperty tempProperty = currentEntity.get(columnName);

				AssertKripton.assertTrueOrUnknownPropertyInJQLException(tempProperty != null, method, columnName);

				updatedProperties.add(tempProperty);

				return tempProperty.columnName;
			}

			@Override
			public String onColumnName(String columnName) {
				SQLProperty tempProperty = currentEntity.get(columnName);

				AssertKripton.assertTrueOrUnknownPropertyInJQLException(tempProperty != null, method, columnName);

				return tempProperty.columnName;
			}

			@Override
			public String onBindParameter(String bindParameterName, boolean inStatement) {
				String resolvedParamName = method.findParameterNameByAlias(bindParameterName);
				AssertKripton.assertTrueOrUnknownParamInJQLException(resolvedParamName != null, method, bindParameterName);

				if (onWhereStatement.value0) {
					return SqlAnalyzer.PARAM_PREFIX + bindParameterName + SqlAnalyzer.PARAM_SUFFIX;
				} else {
					return SqlAnalyzer.PARAM_PREFIX + bindParameterName + SqlAnalyzer.PARAM_SUFFIX;
				}

			}

		});

		if (updateMode) {
			methodBuilder.addJavadoc("<h2>SQL update</h2>\n");
			methodBuilder.addJavadoc("<pre>$L</pre>\n", sqlModify);
			methodBuilder.addJavadoc("\n");

			// list of updated fields
			methodBuilder.addJavadoc("<h2>Updated columns:</h2>\n");
			methodBuilder.addJavadoc("<ul>\n");
			for (SQLProperty property : updatedProperties) {
				methodBuilder.addJavadoc("\t<li>$L</li>\n", property.columnName);
			}
			methodBuilder.addJavadoc("</ul>");
			methodBuilder.addJavadoc("\n\n");

		} else {
			methodBuilder.addJavadoc("<h2>SQL delete</h2>\n");
			methodBuilder.addJavadoc("<pre>$L</pre>", sqlModify);
			methodBuilder.addJavadoc("\n\n");
		}

		// list of where parameter
		if (where.value1.size() > 0) {
			methodBuilder.addJavadoc("<h2>Where parameters:</h2>\n");
			methodBuilder.addJavadoc("<dl>\n");
			for (Pair<String, TypeName> property : where.value1) {
				String rawName = method.findParameterNameByAlias(property.value0);
				methodBuilder.addJavadoc("\t<dt>$L</dt>", SqlAnalyzer.PARAM_PREFIX + property.value0 + SqlAnalyzer.PARAM_SUFFIX);
				methodBuilder.addJavadoc("<dd>is mapped to method's parameter <strong>$L</strong></dd>\n", rawName);
			}
			methodBuilder.addJavadoc("</dl>");
		} else {
			methodBuilder.addJavadoc("<p>No where parameters were found.</p>");
		}
		methodBuilder.addJavadoc("\n\n");

		if (method.hasDynamicWhereConditions()) {
			methodBuilder.addJavadoc("<dl>\n");
			methodBuilder.addJavadoc("<dt>$L</dt><dd>is part of where conditions resolved at runtime. In above SQL it is displayed as #{$L}</dd>", method.dynamicWhereParameterName,
					JQLDynamicStatementType.DYNAMIC_WHERE);
			methodBuilder.addJavadoc("\n</dl>");
			methodBuilder.addJavadoc("\n\n");
		}

		// dynamic conditions
		if (method.hasDynamicWhereConditions()) {
			methodBuilder.addJavadoc("<h2>Method's parameters and associated dynamic parts:</h2>\n");
			methodBuilder.addJavadoc("<dl>\n");

			if (method.hasDynamicWhereConditions()) {
				methodBuilder.addJavadoc("<dt>$L</dt><dd>is part of where conditions resolved at runtime. In above SQL it is displayed as #{$L}</dd>", method.dynamicWhereParameterName,
						JQLDynamicStatementType.DYNAMIC_WHERE);
			}

			methodBuilder.addJavadoc("</dl>");
			methodBuilder.addJavadoc("\n\n");
		}

		// method parameters
		if (methodParams.size() > 0) {
			for (Pair<String, TypeName> param : methodParams) {
				String resolvedName = method.findParameterAliasByName(param.value0);
				methodBuilder.addJavadoc("@param $L", param.value0);
				if (method.isThisDynamicWhereConditionsName(param.value0)) {
					methodBuilder.addJavadoc("\n\tis used as dynamic where conditions\n");
				} else if (where.value1.contains(new Pair<>(resolvedName, param.value1))) {
					methodBuilder.addJavadoc("\n\tis used as where parameter <strong>$L</strong>\n", SqlAnalyzer.PARAM_PREFIX + resolvedName + SqlAnalyzer.PARAM_SUFFIX);
				} else {
					methodBuilder.addJavadoc("\n\tis used as updated field <strong>$L</strong>\n", resolvedName);
				}
			}
		}

		// if true, field must be associate to ben attributes
		TypeName returnType = method.getReturnClass();
		// define return value
		if (returnType == TypeName.VOID) {

		} else {
			methodBuilder.addJavadoc("\n");
			if (isIn(returnType, Boolean.TYPE, Boolean.class)) {
				if (updateMode) {
					methodBuilder.addJavadoc("@return <code>true</code> if record is updated, <code>false</code> otherwise");
				} else {
					methodBuilder.addJavadoc("@return <code>true</code> if record is deleted, <code>false</code> otherwise");
				}
				// methodBuilder.addCode("return result!=0;\n");
			} else if (isIn(returnType, Long.TYPE, Long.class, Integer.TYPE, Integer.class, Short.TYPE, Short.class)) {
				if (updateMode) {
					methodBuilder.addJavadoc("@return number of updated records");
				} else {
					methodBuilder.addJavadoc("@return number of deleted records");
				}

				// methodBuilder.addCode("return result;\n");
			} else {
				// more than one listener found
				throw (new InvalidMethodSignException(method, "invalid return type"));
			}
			methodBuilder.addJavadoc("\n");
		}

	}
281832
public static void generateSQL(final SQLiteModelMethod method, MethodSpec.Builder methodBuilder) {
		JQLChecker jqlChecker = JQLChecker.getInstance();

		methodBuilder.addCode("\n// generate sql\n");
		String sql = jqlChecker.replace(method, method.jql, new JQLReplacerListenerImpl(method) {
			@Override
			public String onColumnNameToUpdate(String columnName) {
				// only entity's columns
				return currentEntity.findPropertyByName(columnName).columnName;
			}

			@Override
			public String onColumnName(String columnName) {
				return currentSchema.findColumnNameByPropertyName(method, columnName);
			}

			@Override
			public String onBindParameter(String bindParameterName, boolean inStatement) {
				return "?";
			}

		});

		if (method.jql.dynamicReplace.containsKey(JQLDynamicStatementType.DYNAMIC_WHERE)) {
			methodBuilder.addStatement("String _sql=String.format($S, $L)",
					sql.replace(method.jql.dynamicReplace.get(JQLDynamicStatementType.DYNAMIC_WHERE), "%s"),
					"StringUtils.ifNotEmptyAppend(_sqlDynamicWhere,\" AND \")");
		} else {
			methodBuilder.addStatement("String _sql=$S", sql);
		}
	}