[#6884] Emulate SET [ ROW ] = [ ROW ] syntax on all databases

This commit is contained in:
lukaseder 2017-12-13 14:06:51 +01:00
parent 049b081500
commit f03dbdccfe
3 changed files with 174 additions and 103 deletions

View File

@ -68,161 +68,161 @@ public interface UpdateQuery<R extends Record> extends StoreQuery<R>, ConditionP
* Specify a multi-column set clause for the <code>UPDATE</code> statement.
*/
@Generated("This method was generated using jOOQ-tools")
@Support({ H2, HSQLDB, POSTGRES })
@Support
<T1> void addValues(Row1<T1> row, Row1<T1> value);
/**
* Specify a multi-column set clause for the <code>UPDATE</code> statement.
*/
@Generated("This method was generated using jOOQ-tools")
@Support({ H2, HSQLDB, POSTGRES })
@Support
<T1, T2> void addValues(Row2<T1, T2> row, Row2<T1, T2> value);
/**
* Specify a multi-column set clause for the <code>UPDATE</code> statement.
*/
@Generated("This method was generated using jOOQ-tools")
@Support({ H2, HSQLDB, POSTGRES })
@Support
<T1, T2, T3> void addValues(Row3<T1, T2, T3> row, Row3<T1, T2, T3> value);
/**
* Specify a multi-column set clause for the <code>UPDATE</code> statement.
*/
@Generated("This method was generated using jOOQ-tools")
@Support({ H2, HSQLDB, POSTGRES })
@Support
<T1, T2, T3, T4> void addValues(Row4<T1, T2, T3, T4> row, Row4<T1, T2, T3, T4> value);
/**
* Specify a multi-column set clause for the <code>UPDATE</code> statement.
*/
@Generated("This method was generated using jOOQ-tools")
@Support({ H2, HSQLDB, POSTGRES })
@Support
<T1, T2, T3, T4, T5> void addValues(Row5<T1, T2, T3, T4, T5> row, Row5<T1, T2, T3, T4, T5> value);
/**
* Specify a multi-column set clause for the <code>UPDATE</code> statement.
*/
@Generated("This method was generated using jOOQ-tools")
@Support({ H2, HSQLDB, POSTGRES })
@Support
<T1, T2, T3, T4, T5, T6> void addValues(Row6<T1, T2, T3, T4, T5, T6> row, Row6<T1, T2, T3, T4, T5, T6> value);
/**
* Specify a multi-column set clause for the <code>UPDATE</code> statement.
*/
@Generated("This method was generated using jOOQ-tools")
@Support({ H2, HSQLDB, POSTGRES })
@Support
<T1, T2, T3, T4, T5, T6, T7> void addValues(Row7<T1, T2, T3, T4, T5, T6, T7> row, Row7<T1, T2, T3, T4, T5, T6, T7> value);
/**
* Specify a multi-column set clause for the <code>UPDATE</code> statement.
*/
@Generated("This method was generated using jOOQ-tools")
@Support({ H2, HSQLDB, POSTGRES })
@Support
<T1, T2, T3, T4, T5, T6, T7, T8> void addValues(Row8<T1, T2, T3, T4, T5, T6, T7, T8> row, Row8<T1, T2, T3, T4, T5, T6, T7, T8> value);
/**
* Specify a multi-column set clause for the <code>UPDATE</code> statement.
*/
@Generated("This method was generated using jOOQ-tools")
@Support({ H2, HSQLDB, POSTGRES })
@Support
<T1, T2, T3, T4, T5, T6, T7, T8, T9> void addValues(Row9<T1, T2, T3, T4, T5, T6, T7, T8, T9> row, Row9<T1, T2, T3, T4, T5, T6, T7, T8, T9> value);
/**
* Specify a multi-column set clause for the <code>UPDATE</code> statement.
*/
@Generated("This method was generated using jOOQ-tools")
@Support({ H2, HSQLDB, POSTGRES })
@Support
<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10> void addValues(Row10<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10> row, Row10<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10> value);
/**
* Specify a multi-column set clause for the <code>UPDATE</code> statement.
*/
@Generated("This method was generated using jOOQ-tools")
@Support({ H2, HSQLDB, POSTGRES })
@Support
<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11> void addValues(Row11<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11> row, Row11<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11> value);
/**
* Specify a multi-column set clause for the <code>UPDATE</code> statement.
*/
@Generated("This method was generated using jOOQ-tools")
@Support({ H2, HSQLDB, POSTGRES })
@Support
<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12> void addValues(Row12<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12> row, Row12<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12> value);
/**
* Specify a multi-column set clause for the <code>UPDATE</code> statement.
*/
@Generated("This method was generated using jOOQ-tools")
@Support({ H2, HSQLDB, POSTGRES })
@Support
<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13> void addValues(Row13<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13> row, Row13<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13> value);
/**
* Specify a multi-column set clause for the <code>UPDATE</code> statement.
*/
@Generated("This method was generated using jOOQ-tools")
@Support({ H2, HSQLDB, POSTGRES })
@Support
<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14> void addValues(Row14<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14> row, Row14<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14> value);
/**
* Specify a multi-column set clause for the <code>UPDATE</code> statement.
*/
@Generated("This method was generated using jOOQ-tools")
@Support({ H2, HSQLDB, POSTGRES })
@Support
<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15> void addValues(Row15<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15> row, Row15<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15> value);
/**
* Specify a multi-column set clause for the <code>UPDATE</code> statement.
*/
@Generated("This method was generated using jOOQ-tools")
@Support({ H2, HSQLDB, POSTGRES })
@Support
<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16> void addValues(Row16<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16> row, Row16<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16> value);
/**
* Specify a multi-column set clause for the <code>UPDATE</code> statement.
*/
@Generated("This method was generated using jOOQ-tools")
@Support({ H2, HSQLDB, POSTGRES })
@Support
<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17> void addValues(Row17<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17> row, Row17<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17> value);
/**
* Specify a multi-column set clause for the <code>UPDATE</code> statement.
*/
@Generated("This method was generated using jOOQ-tools")
@Support({ H2, HSQLDB, POSTGRES })
@Support
<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18> void addValues(Row18<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18> row, Row18<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18> value);
/**
* Specify a multi-column set clause for the <code>UPDATE</code> statement.
*/
@Generated("This method was generated using jOOQ-tools")
@Support({ H2, HSQLDB, POSTGRES })
@Support
<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19> void addValues(Row19<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19> row, Row19<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19> value);
/**
* Specify a multi-column set clause for the <code>UPDATE</code> statement.
*/
@Generated("This method was generated using jOOQ-tools")
@Support({ H2, HSQLDB, POSTGRES })
@Support
<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20> void addValues(Row20<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20> row, Row20<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20> value);
/**
* Specify a multi-column set clause for the <code>UPDATE</code> statement.
*/
@Generated("This method was generated using jOOQ-tools")
@Support({ H2, HSQLDB, POSTGRES })
@Support
<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, T21> void addValues(Row21<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, T21> row, Row21<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, T21> value);
/**
* Specify a multi-column set clause for the <code>UPDATE</code> statement.
*/
@Generated("This method was generated using jOOQ-tools")
@Support({ H2, HSQLDB, POSTGRES })
@Support
<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22> void addValues(Row22<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22> row, Row22<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22> value);
/**
* Specify a multi-column set clause for the <code>UPDATE</code> statement.
*/
@Generated("This method was generated using jOOQ-tools")
@Support({ H2, HSQLDB, POSTGRES })
@Support
void addValues(RowN row, RowN value);
/**

View File

@ -69,207 +69,253 @@ public interface UpdateSetFirstStep<R extends Record> extends UpdateSetStep<R> {
* Specify a multi-column set clause for the <code>UPDATE</code> statement.
* <p>
* This is emulated using a subquery for the <code>value</code>, where row
* value expressions aren't supported.
* value expressions on the right hand side aren't supported, or with an
* ordinary SET clause, where row value expressions on the left hand side
* aren't supported.
*/
@Support({ H2, HSQLDB, POSTGRES })
@Support
<T1> UpdateFromStep<R> set(Row1<T1> row, Row1<T1> value);
/**
* Specify a multi-column set clause for the <code>UPDATE</code> statement.
* <p>
* This is emulated using a subquery for the <code>value</code>, where row
* value expressions aren't supported.
* value expressions on the right hand side aren't supported, or with an
* ordinary SET clause, where row value expressions on the left hand side
* aren't supported.
*/
@Support({ H2, HSQLDB, POSTGRES })
@Support
<T1, T2> UpdateFromStep<R> set(Row2<T1, T2> row, Row2<T1, T2> value);
/**
* Specify a multi-column set clause for the <code>UPDATE</code> statement.
* <p>
* This is emulated using a subquery for the <code>value</code>, where row
* value expressions aren't supported.
* value expressions on the right hand side aren't supported, or with an
* ordinary SET clause, where row value expressions on the left hand side
* aren't supported.
*/
@Support({ H2, HSQLDB, POSTGRES })
@Support
<T1, T2, T3> UpdateFromStep<R> set(Row3<T1, T2, T3> row, Row3<T1, T2, T3> value);
/**
* Specify a multi-column set clause for the <code>UPDATE</code> statement.
* <p>
* This is emulated using a subquery for the <code>value</code>, where row
* value expressions aren't supported.
* value expressions on the right hand side aren't supported, or with an
* ordinary SET clause, where row value expressions on the left hand side
* aren't supported.
*/
@Support({ H2, HSQLDB, POSTGRES })
@Support
<T1, T2, T3, T4> UpdateFromStep<R> set(Row4<T1, T2, T3, T4> row, Row4<T1, T2, T3, T4> value);
/**
* Specify a multi-column set clause for the <code>UPDATE</code> statement.
* <p>
* This is emulated using a subquery for the <code>value</code>, where row
* value expressions aren't supported.
* value expressions on the right hand side aren't supported, or with an
* ordinary SET clause, where row value expressions on the left hand side
* aren't supported.
*/
@Support({ H2, HSQLDB, POSTGRES })
@Support
<T1, T2, T3, T4, T5> UpdateFromStep<R> set(Row5<T1, T2, T3, T4, T5> row, Row5<T1, T2, T3, T4, T5> value);
/**
* Specify a multi-column set clause for the <code>UPDATE</code> statement.
* <p>
* This is emulated using a subquery for the <code>value</code>, where row
* value expressions aren't supported.
* value expressions on the right hand side aren't supported, or with an
* ordinary SET clause, where row value expressions on the left hand side
* aren't supported.
*/
@Support({ H2, HSQLDB, POSTGRES })
@Support
<T1, T2, T3, T4, T5, T6> UpdateFromStep<R> set(Row6<T1, T2, T3, T4, T5, T6> row, Row6<T1, T2, T3, T4, T5, T6> value);
/**
* Specify a multi-column set clause for the <code>UPDATE</code> statement.
* <p>
* This is emulated using a subquery for the <code>value</code>, where row
* value expressions aren't supported.
* value expressions on the right hand side aren't supported, or with an
* ordinary SET clause, where row value expressions on the left hand side
* aren't supported.
*/
@Support({ H2, HSQLDB, POSTGRES })
@Support
<T1, T2, T3, T4, T5, T6, T7> UpdateFromStep<R> set(Row7<T1, T2, T3, T4, T5, T6, T7> row, Row7<T1, T2, T3, T4, T5, T6, T7> value);
/**
* Specify a multi-column set clause for the <code>UPDATE</code> statement.
* <p>
* This is emulated using a subquery for the <code>value</code>, where row
* value expressions aren't supported.
* value expressions on the right hand side aren't supported, or with an
* ordinary SET clause, where row value expressions on the left hand side
* aren't supported.
*/
@Support({ H2, HSQLDB, POSTGRES })
@Support
<T1, T2, T3, T4, T5, T6, T7, T8> UpdateFromStep<R> set(Row8<T1, T2, T3, T4, T5, T6, T7, T8> row, Row8<T1, T2, T3, T4, T5, T6, T7, T8> value);
/**
* Specify a multi-column set clause for the <code>UPDATE</code> statement.
* <p>
* This is emulated using a subquery for the <code>value</code>, where row
* value expressions aren't supported.
* value expressions on the right hand side aren't supported, or with an
* ordinary SET clause, where row value expressions on the left hand side
* aren't supported.
*/
@Support({ H2, HSQLDB, POSTGRES })
@Support
<T1, T2, T3, T4, T5, T6, T7, T8, T9> UpdateFromStep<R> set(Row9<T1, T2, T3, T4, T5, T6, T7, T8, T9> row, Row9<T1, T2, T3, T4, T5, T6, T7, T8, T9> value);
/**
* Specify a multi-column set clause for the <code>UPDATE</code> statement.
* <p>
* This is emulated using a subquery for the <code>value</code>, where row
* value expressions aren't supported.
* value expressions on the right hand side aren't supported, or with an
* ordinary SET clause, where row value expressions on the left hand side
* aren't supported.
*/
@Support({ H2, HSQLDB, POSTGRES })
@Support
<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10> UpdateFromStep<R> set(Row10<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10> row, Row10<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10> value);
/**
* Specify a multi-column set clause for the <code>UPDATE</code> statement.
* <p>
* This is emulated using a subquery for the <code>value</code>, where row
* value expressions aren't supported.
* value expressions on the right hand side aren't supported, or with an
* ordinary SET clause, where row value expressions on the left hand side
* aren't supported.
*/
@Support({ H2, HSQLDB, POSTGRES })
@Support
<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11> UpdateFromStep<R> set(Row11<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11> row, Row11<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11> value);
/**
* Specify a multi-column set clause for the <code>UPDATE</code> statement.
* <p>
* This is emulated using a subquery for the <code>value</code>, where row
* value expressions aren't supported.
* value expressions on the right hand side aren't supported, or with an
* ordinary SET clause, where row value expressions on the left hand side
* aren't supported.
*/
@Support({ H2, HSQLDB, POSTGRES })
@Support
<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12> UpdateFromStep<R> set(Row12<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12> row, Row12<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12> value);
/**
* Specify a multi-column set clause for the <code>UPDATE</code> statement.
* <p>
* This is emulated using a subquery for the <code>value</code>, where row
* value expressions aren't supported.
* value expressions on the right hand side aren't supported, or with an
* ordinary SET clause, where row value expressions on the left hand side
* aren't supported.
*/
@Support({ H2, HSQLDB, POSTGRES })
@Support
<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13> UpdateFromStep<R> set(Row13<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13> row, Row13<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13> value);
/**
* Specify a multi-column set clause for the <code>UPDATE</code> statement.
* <p>
* This is emulated using a subquery for the <code>value</code>, where row
* value expressions aren't supported.
* value expressions on the right hand side aren't supported, or with an
* ordinary SET clause, where row value expressions on the left hand side
* aren't supported.
*/
@Support({ H2, HSQLDB, POSTGRES })
@Support
<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14> UpdateFromStep<R> set(Row14<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14> row, Row14<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14> value);
/**
* Specify a multi-column set clause for the <code>UPDATE</code> statement.
* <p>
* This is emulated using a subquery for the <code>value</code>, where row
* value expressions aren't supported.
* value expressions on the right hand side aren't supported, or with an
* ordinary SET clause, where row value expressions on the left hand side
* aren't supported.
*/
@Support({ H2, HSQLDB, POSTGRES })
@Support
<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15> UpdateFromStep<R> set(Row15<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15> row, Row15<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15> value);
/**
* Specify a multi-column set clause for the <code>UPDATE</code> statement.
* <p>
* This is emulated using a subquery for the <code>value</code>, where row
* value expressions aren't supported.
* value expressions on the right hand side aren't supported, or with an
* ordinary SET clause, where row value expressions on the left hand side
* aren't supported.
*/
@Support({ H2, HSQLDB, POSTGRES })
@Support
<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16> UpdateFromStep<R> set(Row16<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16> row, Row16<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16> value);
/**
* Specify a multi-column set clause for the <code>UPDATE</code> statement.
* <p>
* This is emulated using a subquery for the <code>value</code>, where row
* value expressions aren't supported.
* value expressions on the right hand side aren't supported, or with an
* ordinary SET clause, where row value expressions on the left hand side
* aren't supported.
*/
@Support({ H2, HSQLDB, POSTGRES })
@Support
<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17> UpdateFromStep<R> set(Row17<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17> row, Row17<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17> value);
/**
* Specify a multi-column set clause for the <code>UPDATE</code> statement.
* <p>
* This is emulated using a subquery for the <code>value</code>, where row
* value expressions aren't supported.
* value expressions on the right hand side aren't supported, or with an
* ordinary SET clause, where row value expressions on the left hand side
* aren't supported.
*/
@Support({ H2, HSQLDB, POSTGRES })
@Support
<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18> UpdateFromStep<R> set(Row18<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18> row, Row18<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18> value);
/**
* Specify a multi-column set clause for the <code>UPDATE</code> statement.
* <p>
* This is emulated using a subquery for the <code>value</code>, where row
* value expressions aren't supported.
* value expressions on the right hand side aren't supported, or with an
* ordinary SET clause, where row value expressions on the left hand side
* aren't supported.
*/
@Support({ H2, HSQLDB, POSTGRES })
@Support
<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19> UpdateFromStep<R> set(Row19<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19> row, Row19<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19> value);
/**
* Specify a multi-column set clause for the <code>UPDATE</code> statement.
* <p>
* This is emulated using a subquery for the <code>value</code>, where row
* value expressions aren't supported.
* value expressions on the right hand side aren't supported, or with an
* ordinary SET clause, where row value expressions on the left hand side
* aren't supported.
*/
@Support({ H2, HSQLDB, POSTGRES })
@Support
<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20> UpdateFromStep<R> set(Row20<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20> row, Row20<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20> value);
/**
* Specify a multi-column set clause for the <code>UPDATE</code> statement.
* <p>
* This is emulated using a subquery for the <code>value</code>, where row
* value expressions aren't supported.
* value expressions on the right hand side aren't supported, or with an
* ordinary SET clause, where row value expressions on the left hand side
* aren't supported.
*/
@Support({ H2, HSQLDB, POSTGRES })
@Support
<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, T21> UpdateFromStep<R> set(Row21<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, T21> row, Row21<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, T21> value);
/**
* Specify a multi-column set clause for the <code>UPDATE</code> statement.
* <p>
* This is emulated using a subquery for the <code>value</code>, where row
* value expressions aren't supported.
* value expressions on the right hand side aren't supported, or with an
* ordinary SET clause, where row value expressions on the left hand side
* aren't supported.
*/
@Support({ H2, HSQLDB, POSTGRES })
@Support
<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22> UpdateFromStep<R> set(Row22<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22> row, Row22<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22> value);
/**
* Specify a multi-column set clause for the <code>UPDATE</code> statement.
* <p>
* This is emulated using a subquery for the <code>value</code>, where row
* value expressions aren't supported.
* value expressions on the right hand side aren't supported, or with an
* ordinary SET clause, where row value expressions on the left hand side
* aren't supported.
*/
@Support({ H2, HSQLDB, POSTGRES })
@Support
UpdateFromStep<R> set(RowN row, RowN value);
/**

View File

@ -46,7 +46,12 @@ import static org.jooq.Clause.UPDATE_SET_ASSIGNMENT;
import static org.jooq.Clause.UPDATE_UPDATE;
import static org.jooq.Clause.UPDATE_WHERE;
// ...
import static org.jooq.SQLDialect.H2;
// ...
import static org.jooq.SQLDialect.HSQLDB;
// ...
// ...
import static org.jooq.SQLDialect.POSTGRES;
import static org.jooq.SQLDialect.POSTGRES_10;
// ...
import static org.jooq.conf.SettingsTools.getExecuteUpdateWithoutWhere;
@ -68,6 +73,7 @@ import org.jooq.Clause;
import org.jooq.Condition;
import org.jooq.Configuration;
import org.jooq.Context;
import org.jooq.Field;
import org.jooq.Operator;
import org.jooq.Record;
import org.jooq.Record1;
@ -132,6 +138,7 @@ final class UpdateQueryImpl<R extends Record> extends AbstractStoreQuery<R> impl
private static final EnumSet<SQLDialect> SUPPORT_RVE_SET = EnumSet.of(H2, HSQLDB, POSTGRES);
private final FieldMapForUpdate updateMap;
private final TableList from;
@ -545,49 +552,67 @@ final class UpdateQueryImpl<R extends Record> extends AbstractStoreQuery<R> impl
// A multi-row update was specified
if (multiRow != null) {
boolean qualify = ctx.qualify();
ctx.start(UPDATE_SET_ASSIGNMENT)
.qualify(false)
.visit(multiRow)
.qualify(qualify)
.sql(" = ");
// [#6884] This syntax can be emulated trivially, if the RHS is not a SELECT subquery
if (multiValue != null && !SUPPORT_RVE_SET.contains(ctx.family())) {
FieldMapForUpdate map = new FieldMapForUpdate(table, UPDATE_SET_ASSIGNMENT);
// Some dialects don't really support row value expressions on the
// right hand side of a SET clause
if (multiValue != null
for (int i = 0; i < multiRow.size(); i++) {
Field<?> k = multiRow.field(i);
Field<?> v = multiValue.field(i);
map.put(k, Tools.field(v, k));
}
) {
// [#6763] Incompatible change in PostgreSQL 10 requires ROW() constructor for
// single-degree rows. Let's just always render it, here.
if (POSTGRES_10.precedes(ctx.dialect()))
ctx.visit(K_ROW).sql(" ");
ctx.visit(multiValue);
ctx.formatIndentLockStart()
.visit(map)
.formatIndentLockEnd();
}
// Subselects or subselect emulations of row value expressions
else {
Select<?> select = multiSelect;
boolean qualify = ctx.qualify();
if (multiValue != null)
select = select(multiValue.fields());
ctx.start(UPDATE_SET_ASSIGNMENT)
.qualify(false)
.visit(multiRow)
.qualify(qualify)
.sql(" = ");
ctx.sql('(')
.formatIndentStart()
.formatNewLine()
.subquery(true)
.visit(select)
.subquery(false)
.formatIndentEnd()
.formatNewLine()
.sql(')');
// Some dialects don't really support row value expressions on the
// right hand side of a SET clause
if (multiValue != null
) {
// [#6763] Incompatible change in PostgreSQL 10 requires ROW() constructor for
// single-degree rows. Let's just always render it, here.
if (POSTGRES_10.precedes(ctx.dialect()))
ctx.visit(K_ROW).sql(" ");
ctx.visit(multiValue);
}
// Subselects or subselect emulations of row value expressions
else {
Select<?> select = multiSelect;
if (multiValue != null)
select = select(multiValue.fields());
ctx.sql('(')
.formatIndentStart()
.formatNewLine()
.subquery(true)
.visit(select)
.subquery(false)
.formatIndentEnd()
.formatNewLine()
.sql(')');
}
ctx.end(UPDATE_SET_ASSIGNMENT);
}
ctx.end(UPDATE_SET_ASSIGNMENT);
}
// A regular (non-multi-row) update was specified