use of net.idea.modbcum.i.query.QueryParam in project ambit-mirror by ideaconsult.
the class QueryCachedResults method getParameters.
public List<QueryParam> getParameters() throws AmbitException {
if ((getFieldname() == null) || (getValue() == null) || (getCategory() == null))
throw new AmbitException("Undefined parameters");
List<QueryParam> params = new ArrayList<QueryParam>();
params.add(new QueryParam<String>(String.class, getCategory()));
params.add(new QueryParam<String>(String.class, getFieldname()));
params.add(new QueryParam<Integer>(Integer.class, getValue().getIdchemical()));
return params;
}
use of net.idea.modbcum.i.query.QueryParam in project ambit-mirror by ideaconsult.
the class PreparedStatementBatchExecutor method addBatch.
public int addBatch(Q query) throws SQLException, AmbitException {
String[] sqls = query.getSQL();
int n = 0;
for (int i = 0; i < sqls.length; i++) {
PreparedStatement ps = getCachedStatement(sqls[i]);
if (ps == null) {
if (query.returnKeys(i))
ps = connection.prepareStatement(sqls[i], Statement.RETURN_GENERATED_KEYS);
else
ps = connection.prepareStatement(sqls[i]);
addStatementToCache(sqls[i], ps);
}
List<QueryParam> params = query.getParameters(i);
StatementExecutor.setParameters(ps, params);
ps.addBatch();
n++;
}
return n;
}
use of net.idea.modbcum.i.query.QueryParam in project ambit-mirror by ideaconsult.
the class BookmarksByTopicFacetQuery method getParameters.
@Override
public List<QueryParam> getParameters() throws AmbitException {
if ((getFieldname() == null) || (getFieldname().getCreator() == null))
throw new AmbitException("No user name");
List<QueryParam> params = new ArrayList<QueryParam>();
params.add(new QueryParam<String>(String.class, getFieldname().getCreator()));
return params;
}
use of net.idea.modbcum.i.query.QueryParam in project ambit-mirror by ideaconsult.
the class EndpointRoleByBundle method getParameters.
@Override
public List<QueryParam> getParameters() throws AmbitException {
if ((getFieldname() == null) || (getFieldname().getEndpoint() == null || getFieldname().getSubcategoryTitle() == null))
throw new AmbitException("Endpoint not defined");
if (getValue() == null || getValue().getID() <= 0)
throw new AmbitException("Bundle not defined");
List<QueryParam> params = new ArrayList<QueryParam>();
params.add(new QueryParam<Integer>(Integer.class, getValue().getID()));
params.add(new QueryParam<String>(String.class, getFieldname().getSubcategoryTitle()));
params.add(new QueryParam<String>(String.class, getFieldname().getEndpoint().name()));
return params;
}
use of net.idea.modbcum.i.query.QueryParam in project ambit-mirror by ideaconsult.
the class SubstanceRoleByBundle method getParameters.
@Override
public List<QueryParam> getParameters() throws AmbitException {
if ((getFieldname() == null) || (getFieldname().getIdsubstance() <= 0))
throw new AmbitException("Substance not defined");
if (getValue() == null || getValue().getID() <= 0)
throw new AmbitException("Bundle not defined");
List<QueryParam> params = new ArrayList<QueryParam>();
params.add(new QueryParam<Integer>(Integer.class, getValue().getID()));
params.add(new QueryParam<Integer>(Integer.class, getFieldname().getIdsubstance()));
return params;
}
Aggregations