Hi Trygve,

2014-03-25 14:00 GMT+01:00 Trygve Laugstøl <[email protected]>:

> Hm, I could try to hack a bit on this but I would need some more info on
> where to start.
>

Essentially, you will need to override / reimplement your
org.jooq.util.oracle.OracleDatabase.loadPrimaryKeys() implementation to add
additional primary keys to jOOQ-Meta's model.

I will send you some details in a separate message, later this afternoon.


> Right now I'm thinking that I want to tell jOOQ that I have a primary key
> for the views, not tables as your issues seems to suggest.
>

Yes, that's the intention of this new issue #3154:
https://github.com/jOOQ/jOOQ/issues/3154


> Would one feasible way be to get jOOQ to treat the views as tables and
> then use the synthetic primary key feature on those tables? I can say that
> "for each view named FOO with a table named FOO_TAB is a 'updateable
> view'". In our case we always have a "id NUMBER(18,0)" column as primary
> key.
>

jOOQ doesn't really distinguish views from tables right now.

The idea of synthetic primary keys would allow to implement the feature you
have in mind, although not in a formal way. The FOO -> FOO_TAB
"association" is quite specific to your use-case. There are lots of other
possible configurations where one might "automatically" want to associate a
view with a single underlying table. I don't think there is an easy, formal
way to automate that, much like there isn't any easy (and reliable) way to
derive an underlying table column from a view.

If regular expressions for column name pattern matching are too tedious, I
think that implementing your own jOOQ-Meta extension might be the only way
forward.

-- 
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