Hello,

In the past, we had been thinking about a potential implementation of such
a feature:
http://stackoverflow.com/q/5500738/521799

Unfortunately, there is no reliable way to know that a view is indeed:

- updatable at all
- updatable through a given primary / unique key

If, by database schema design, you know that foo_tab and foo are exact
equivalents of each other (same columns) then you can use jOOQ's runtime
table mapping feature to either

- rewrite reads from foo to be reads from foo_tab
- rewrite writes to foo_tab to be writes to foo

See the manual for details:
http://www.jooq.org/doc/latest/manual/sql-building/dsl-context/runtime-schema-mapping/

Let me know if this helps or if you had something else in mind

Regards,
Lukas


2014-03-21 15:36 GMT+01:00 Trygve Laugstøl <[email protected]>:

> Hi
>
> I was wondering if it is possible to get JOOQ to support insertable views?
> We're going to have to use insertable/updatable views to be able to do more
> running upgrades of our application, so for most tables we will be
> following the pattern of having a Java entity "Foo", a table "foo_tab" and
> a view called "foo".
>
> Our database is Oracle, but several other databases (even open source
> ones) support insertable/updatable views and it would be nice if JOOQ could
> make the Records extends UpdatableRecordImpl instead of
> just TableRecordImpl. In other words, I would like this to still work:
>
>         PersonRecord r = new PersonRecord();
>         r.setId(id);
>         r.setName(person.name);
>         dsl.attach(r);
>         r.insert();
>
> instead of having to do this:
>
>         PersonRecord r = dsl.insertInto(PERSON).
>                 set(PERSON.ID, id).
>                 set(PERSON.NAME, person.name).
>                 returning().
>                 fetchOne();
>
> --
> Trygve
>
>  --
> 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.
>

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