Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
DAO maps into record and then into POJO
public abstract class DAOImpl<R extends UpdatableRecord<R>, P, T> implements DAO<R, P, T> {
// ...
@Override
public /* non-final */ <Z> P fetchOne(Field<Z> field, Z value) {
R record = using(configuration)
.selectFrom(table)
.where(field.equal(value))
.fetchOne();
return record == null ? null : mapper().map(record);
}
// ...
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment