Hello,
> 1. Public.SCHEMANAME.getTables() returns a list of tables generated by jOOQ,
> which is very useful, but the function only returns Table<?> and not
> Table<TableRecord<?>> or even Table<Record<?>> - Why is that?
Good question. Let's have a look at Java generics. A schema contains
tables, so, meaningful return values for getTables() are:
1. List<Table>
2. List<? extends Table>
2. suggests that UpdatableTable and other types are possible, too. But
the List is always heterogeneous, so the added wildcard doesn't add
much value.
Then, Table itself is generic with type <R extends Record>. We know
that all tables in a schema are "physical" tables, hence their <R>
binds to a subtype of TableRecord, which you also mentioned. Some even
bind to UpdatableRecord, or to a generated record. With jOOQ 3.0,
Record1, Record2, Record3, ... come into play as well.
So, meaningful return values for getTables() are:
a) List<Table<?>>
b) List<Table<? extends Record>>
c) List<Table<Record>>
d) List<Table<? extends TableRecord<?>>
e) List<Table<TableRecord<?>>>
c) and e) are wrong, as generated tables (depending on your generator
configuration) look like this:
public class Book extends TableImpl<BookRecord> {}
TableImpl<BookRecord> is not compatible with either Table<Record> or
Table<TableRecord<?>>
a), b) and d) are correct, as the types are compatible, but a) and b)
are the same (because ? can only bind to a subtype of Record anyway),
which leaves us with a) and d).
I chose a) simply because I found it more "friendly" for API users...
> 2. How do I setup a default set of ExecuteListeners across creation of
> Executors?
You will have to wrap Executor creation in your own factory
Cheers
Lukas
--
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/groups/opt_out.