Example:
override fun listAccounts(customerKey: CustomerKey, pageable:
Pageable): Set<Account> {
return dslContext
.select()
.from(T_ACCOUNT.join(T_CUSTOMER_ACCOUNT).onKey().join(T_CUSTOMER).onKey())
.where(
T_CUSTOMER
.ORGID
.eq(customerKey.orgId)
.and(T_CUSTOMER.CUSTOMERID.eq(customerKey.customerId)))
.limit(pageable.pageSize)
.offset(pageable.offset.toInt())
.fetchGroups(T_ACCOUNT, T_CUSTOMER)
.entries
.map { map(it) }
.toSet()
}
private fun map(
entry: MutableMap.MutableEntry<TAccountRecord, Result<TCustomerRecord>>
): Account {
val customers =
entry.value.map { record ->
Customer(
record.id?.toLong(),
record.orgid!!,
record.customerid!!,
record.firstname!!,
record.lastname!!,
emptyList(),
record.version?.toLong())
}
return entry.key.into(Account::class.java)!!.copy(customers =
customers.toSet())
}
on java16 sfm raises NPE, while on java15 it works just fine:
java.lang.NullPointerException: Parameter specified as non-null is null:
method com.edb.fs.tac.jfr.srv.model.account.Account.<init>, parameter
accountNumber at
com.edb.fs.tac.jfr.srv.service.account.AccountServiceIntegrationTest.testListAccount(AccountServiceIntegrationTest.kt:43)
registered as: https://github.com/arnaudroger/SimpleFlatMapper/issues/761
apparently sfm isn't quite dead yet,
https://twitter.com/davidkarlsen/status/1389295702438727680 - but there is
not much going on.
tir. 4. mai 2021 kl. 13:32 skrev Lukas Eder <[email protected]>:
> Yes, I figured that's what you're using it for on a very high level, but
> what are you doing *specifically*? (E.g. some example mappings) :)
>
> Because jOOQ 3.15 will ship with quite a few new features, which you may
> like. Maybe, you won't need a third party library anymore.
>
> On Tue, May 4, 2021 at 1:12 PM David Karlsen <[email protected]>
> wrote:
>
>> I use fetchInfo to map from jooq results to my domain objects.
>>
>> tir. 4. mai 2021 kl. 11:29 skrev Lukas Eder <[email protected]>:
>>
>>> Hi David,
>>>
>>> What are you using it for?
>>>
>>> Cheers,
>>> Lukas
>>>
>>> On Tue, May 4, 2021 at 11:16 AM David Karlsen <[email protected]>
>>> wrote:
>>>
>>>> Hi folks.
>>>>
>>>> I've been a happy user of
>>>> https://github.com/arnaudroger/SimpleFlatMapper which fits well with
>>>> jooq, but it might seem that development of this has stalled (last commit
>>>> and release in May last year), and I am experiencing problems with it on
>>>> java 16.
>>>>
>>>> Are there any good alternatives - that run well on java 16?
>>>>
>>>> --
>>>> --
>>>> David J. M. Karlsen - http://www.linkedin.com/in/davidkarlsen
>>>>
>>>> --
>>>> 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].
>>>> To view this discussion on the web visit
>>>> https://groups.google.com/d/msgid/jooq-user/CAGO7Ob3gADNRA7ow8PEuiZPs8B77S9H4szXF%3DSJYUxO%2BOgJhAQ%40mail.gmail.com
>>>> <https://groups.google.com/d/msgid/jooq-user/CAGO7Ob3gADNRA7ow8PEuiZPs8B77S9H4szXF%3DSJYUxO%2BOgJhAQ%40mail.gmail.com?utm_medium=email&utm_source=footer>
>>>> .
>>>>
>>> --
>>> 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].
>>> To view this discussion on the web visit
>>> https://groups.google.com/d/msgid/jooq-user/CAB4ELO5e5Ja-rF1aW22pmKqjrKm1MkaZh%2B7K53E00pMrxZ%3DNZw%40mail.gmail.com
>>> <https://groups.google.com/d/msgid/jooq-user/CAB4ELO5e5Ja-rF1aW22pmKqjrKm1MkaZh%2B7K53E00pMrxZ%3DNZw%40mail.gmail.com?utm_medium=email&utm_source=footer>
>>> .
>>>
>>
>>
>> --
>> --
>> David J. M. Karlsen - http://www.linkedin.com/in/davidkarlsen
>>
>> --
>> 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].
>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/jooq-user/CAGO7Ob1dWwea3ZmWVB6GHfusPE3mGFzPNFS5-cEtF57TC509%3DA%40mail.gmail.com
>> <https://groups.google.com/d/msgid/jooq-user/CAGO7Ob1dWwea3ZmWVB6GHfusPE3mGFzPNFS5-cEtF57TC509%3DA%40mail.gmail.com?utm_medium=email&utm_source=footer>
>> .
>>
> --
> 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].
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/jooq-user/CAB4ELO5_b9tXfpsrChm5S60Aa8XYMejXjyPp5Czr-Q_e4coAgw%40mail.gmail.com
> <https://groups.google.com/d/msgid/jooq-user/CAB4ELO5_b9tXfpsrChm5S60Aa8XYMejXjyPp5Czr-Q_e4coAgw%40mail.gmail.com?utm_medium=email&utm_source=footer>
> .
>
--
--
David J. M. Karlsen - http://www.linkedin.com/in/davidkarlsen
--
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].
To view this discussion on the web visit
https://groups.google.com/d/msgid/jooq-user/CAGO7Ob06ifLxo9qXvC-FUCfnt-5V_VaqF%3Darxb1-217FPbhPdA%40mail.gmail.com.