Created
August 29, 2017 15:12
-
-
Save jklingsporn/c33527ecb16a7c31858ebe2f8b8bea4f to your computer and use it in GitHub Desktop.
DAO maps into record and then into POJO
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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