Search in sources :

Example 1 with OfcUsergroupRecord

use of org.openforis.collect.persistence.jooq.tables.records.OfcUsergroupRecord in project collect by openforis.

the class UserGroupDao method insert.

@Override
public void insert(UserGroup ug) {
    DSLContext dsl = dsl();
    if (dsl.dialect() == SQLDialect.SQLITE) {
        OfcUsergroupRecord insertResult = dsl.insertInto(OFC_USERGROUP).columns(OFC_USERGROUP.CREATED_BY, OFC_USERGROUP.CREATION_DATE, OFC_USERGROUP.DESCRIPTION, OFC_USERGROUP.ENABLED, OFC_USERGROUP.LABEL, OFC_USERGROUP.NAME, OFC_USERGROUP.PARENT_ID, OFC_USERGROUP.QUALIFIER1_NAME, OFC_USERGROUP.QUALIFIER1_VALUE, OFC_USERGROUP.SYSTEM_DEFINED, OFC_USERGROUP.VISIBILITY_CODE).values(ug.getCreatedBy(), ug.getCreationDate(), ug.getDescription(), ug.getEnabled(), ug.getLabel(), ug.getName(), ug.getParentId(), ug.getQualifier1Name(), ug.getQualifier1Value(), ug.getSystemDefined(), ug.getVisibilityCode()).returning(OFC_USERGROUP.ID).fetchOne();
        ug.setId(insertResult.getId());
    } else {
        Integer id;
        id = dsl.nextval(Sequences.OFC_USERGROUP_ID_SEQ).intValue();
        ug.setId(id);
        super.insert(ug);
    }
}
Also used : OfcUsergroupRecord(org.openforis.collect.persistence.jooq.tables.records.OfcUsergroupRecord) DSLContext(org.jooq.DSLContext)

Aggregations

DSLContext (org.jooq.DSLContext)1 OfcUsergroupRecord (org.openforis.collect.persistence.jooq.tables.records.OfcUsergroupRecord)1