Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add RecordMapper<E>, similar to RecordHandler<R>, mapping records to custom types #1756

Closed
lukaseder opened this issue Aug 26, 2012 · 1 comment

Comments

@lukaseder
Copy link
Member

The current RecordHandler type is used as a "sink" receiving records, returning void:

create.selectFrom(BOOK).fetchInto(new RecordHandler<BookRecord>() {
    public void next(BookRecord record) {
        dothings(record);
    }
});

A RecordMapper on the other hand, transforms record into another type. For instance:

List<Integer> result = 
create.selectFrom(BOOK).fetchInto(new RecordMapper<BookRecord, Integer>() {
    public Integer map(BookRecord record) {
        return dothings(record);
    }
});

Possibly, all other into(Class<E>) methods should be refactored to use RecordMapper types instead, e.g. a POJORecordMapper

@ghost ghost assigned idugic Aug 27, 2012
@lukaseder
Copy link
Member Author

@idugic : I'm taking this one back, as I need this for another implementation

@ghost ghost assigned lukaseder Sep 28, 2012
lukaseder added a commit that referenced this issue Sep 28, 2012
lukaseder added a commit that referenced this issue Oct 26, 2012
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants