Hi all,

I have a lot of SELECTs in which I only query individual columns of
various tables, sometimes JOINed, sometimes not. In many of those
cases the queries result in types with pretty long generic definitions
of "RecordX<...>", like in the following example:

> SelectConditionStep<Record6<String, Integer, MeterProdCode, String, 
> MeterType, Integer>> select = this.getDbConn().getJooq()
>       .select(REAL_ESTATE.NUMBER,
>               METER.ID, METER.PROD_CODE, METER.READING_SERIAL, METER.TYPE,
>               METER_BCD.ID)
>       .from(FLAT)
> [...]
>       .where(REAL_ESTATE.DELETED.isFalse())
> [...]

I would like to reduce that "Record6"-stuff to some better named
custom type but don't understand how to do that without implementing
all those interfaces defined by "Record", which already have been
implemented by jOOQ. Neither RecordImpl, AbstractRecord or their
counterparts for rows are publicly accessible or can be extended.

Looking at things like "fetchInto" and "Record.into", I additionally
have the feeling that I would be able to reduce "Record6"-stuff only
in combination with actually fetching data. But I sometimes build
queries spanning multiple methods and would like to get that
"Record6"-stuff out of the way in those cases as well.

The nearest thing I found was the following, which reads like fetching
all columns of the tables part of the query in the end:

https://www.jooq.org/doc/latest/manual/sql-execution/fetching/record-vs-tablerecord/

What I would really like to do is simply creating a custom class or
interface with very little boilerplate like a CTOR only or such,
actually extending/implementing "Record6" and somehow reusing all the
already available implementation of jOOQ. Than I would like to tell
"select" that the indidvidual columns are actually of my custom
records type and use that from than on.

> SelectConditionStep<RecMeterLidWithReMbcd> select = this.getDbConn().getJooq()
>       .select(REAL_ESTATE.NUMBER,
>               METER.ID, METER.PROD_CODE, METER.READING_SERIAL, METER.TYPE,
>               METER_BCD.ID)
>       .from(FLAT)
> [...]
>       .where(REAL_ESTATE.DELETED.isFalse())
> [...]

Is something like that possible? Thanks!

Mit freundlichen Grüßen,

Thorsten Schöning

-- 
Thorsten Schöning       E-Mail: [email protected]
AM-SoFT IT-Systeme      http://www.AM-SoFT.de/

Telefon...........05151-  9468- 55
Fax...............05151-  9468- 88
Mobil..............0178-8 9468- 04

AM-SoFT GmbH IT-Systeme, Brandenburger Str. 7c, 31789 Hameln
AG Hannover HRB 207 694 - Geschäftsführer: Andreas Muchow

-- 
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/13710196654.20190918195706%40am-soft.de.

Reply via email to