Search in sources :

Example 1 with UpdateQuery

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;
}
Also used : UpdateQuery(org.jooq.UpdateQuery)

Example 2 with UpdateQuery

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();
}
Also used : UpdateQuery(org.jooq.UpdateQuery)

Example 3 with UpdateQuery

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();
}
Also used : UpdateQuery(org.jooq.UpdateQuery)

Aggregations

UpdateQuery (org.jooq.UpdateQuery)3