On Fri, Jun 27, 2014 at 4:19 PM, Lukas Eder <[email protected]> wrote:
> Ah, maybe, you're looking for something like this?
>
> Optional<MyPrefixClass> result =
> DSL.using(configuration)
>    .select(A)
>    .from(TABLE)
>    .fetch()
>
>    .map(PREFIX_MAPPER)
>
>    .stream()
>
>    .findFirst();

Very nice!

I think I might just give up writing code myself and get you to write
my app via the mailing list - do you also write mailing list parsers
:-)

So for note, I ended up using this to get rid of the check for null:

return db.execute(ctx ->
        ctx.select().
            from(PREFIXES).
            where(PREFIXES.NATIONAL.eq(prefix + "")).
            fetch().
            map(PREFIX_MAPPER).
            stream().
            findFirst().
            orElse(null)
    );

But just to get rid of that funny Optional thingy.

-- 
You received this message because you are subscribed to the Google Groups "jOOQ 
User Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to