use of org.openforis.collect.persistence.jooq.tables.records.OfcUserRecord in project collect by openforis.
the class UserDao method loadByUserName.
public User loadByUserName(String userName, Boolean enabled) {
UserDSLContext dsl = dsl();
SelectConditionStep<OfcUserRecord> query = dsl.selectFrom(OFC_USER).where(OFC_USER.USERNAME.equal(userName));
if (enabled != null) {
String enabledFlag = enabled ? "Y" : "N";
query.and(OFC_USER.ENABLED.equal(enabledFlag));
}
Record r = query.fetchOne();
User user = r != null ? dsl.fromRecord(r) : null;
return user;
}
use of org.openforis.collect.persistence.jooq.tables.records.OfcUserRecord in project collect by openforis.
the class UserDao method loadAll.
@Override
public List<User> loadAll() {
UserDSLContext dsl = dsl();
Result<OfcUserRecord> r = dsl.selectFrom(OFC_USER).orderBy(OFC_USER.USERNAME).fetch();
List<User> users = r != null ? dsl.fromResult(r) : null;
return users;
}
Aggregations