use of org.jooq.UpdateQuery in project collect by openforis.
the class MappingDSLContext method updateQuery.
@SuppressWarnings({ "rawtypes" })
public UpdateQuery updateQuery(E object) {
UpdateQuery update = updateQuery(getTable());
fromObject(object, update);
Integer id = getId(object);
if (id == null) {
throw new IllegalArgumentException("Cannot update with null id");
}
update.addConditions(idField.equal(id));
return update;
}
use of org.jooq.UpdateQuery in project jOOQ by jOOQ.
the class DefaultDSLContext method executeUpdate.
@Override
public int executeUpdate(TableRecord<?> record, Condition condition) {
UpdateQuery update = updateQuery(record.getTable());
update.addConditions(condition);
update.setRecord(record);
return update.execute();
}
use of org.jooq.UpdateQuery in project jOOQ by jOOQ.
the class DefaultDSLContext method executeUpdate.
@Override
public int executeUpdate(UpdatableRecord<?> record) {
UpdateQuery update = updateQuery(record.getTable());
Tools.addConditions(update, record, record.getTable().getPrimaryKey().getFieldsArray());
update.setRecord(record);
return update.execute();
}
Aggregations