use of org.simpleflatmapper.jdbc.named.NamedParameter in project SimpleFlatMapper by arnaudroger.
the class SqlParameterSourceBuilder method buildFactory.
@SuppressWarnings("unchecked")
public SqlParameterSourceFactory<T> buildFactory(String sql) {
NamedSqlQuery namedSqlQuery = NamedSqlQuery.parse(sql);
for (int i = 0; i < namedSqlQuery.getParametersSize(); i++) {
NamedParameter parameter = namedSqlQuery.getParameter(i);
add(parameter.getName());
}
return buildFactory();
}
use of org.simpleflatmapper.jdbc.named.NamedParameter in project SimpleFlatMapper by arnaudroger.
the class MappingSqlQuery method extractParameters.
private SqlParameter[] extractParameters(String sql) {
NamedSqlQuery query = NamedSqlQuery.parse(sql);
SqlParameter[] params = new SqlParameter[query.getParametersSize()];
for (int i = 0; i < params.length; i++) {
NamedParameter namedParameter = query.getParameter(i);
params[i] = new SqlParameter(namedParameter.getName(), 0);
}
return params;
}
Aggregations