Search in sources :

Example 1 with InsertQuery

use of org.jooq.InsertQuery in project collect by openforis.

the class MappingDSLContext method insertQuery.

@SuppressWarnings({ "rawtypes" })
public InsertQuery insertQuery(E object) {
    Integer id = getId(object);
    if (id == null) {
        int nextId = nextId();
        setId(object, nextId);
    }
    InsertQuery insert = insertQuery(getTable());
    fromObject(object, insert);
    return insert;
}
Also used : InsertQuery(org.jooq.InsertQuery)

Example 2 with InsertQuery

use of org.jooq.InsertQuery in project jOOQ by jOOQ.

the class DefaultDSLContext method executeInsert.

@Override
public int executeInsert(TableRecord<?> record) {
    InsertQuery insert = insertQuery(record.getTable());
    insert.setRecord(record);
    return insert.execute();
}
Also used : InsertQuery(org.jooq.InsertQuery)

Aggregations

InsertQuery (org.jooq.InsertQuery)2