org.jooq
Interface MergeNotMatchedStep<R extends Record>

All Superinterfaces:
Adapter, Attachable, Merge<R>, MergeFinalStep<R>, Query, QueryPart, Serializable
All Known Subinterfaces:
MergeMatchedDeleteStep<R>, MergeMatchedSetMoreStep<R>, MergeMatchedStep<R>, MergeMatchedWhereStep<R>, MergeOnConditionStep<R>

public interface MergeNotMatchedStep<R extends Record>
extends MergeFinalStep<R>

This type is used for the Merge's DSL API.

Example:

 Factory create = new Factory();

 create.mergeInto(table)
       .using(select)
       .on(condition)
       .whenMatchedThenUpdate()
       .set(field1, value1)
       .set(field2, value2)
       .whenNotMatchedThenInsert(field1, field2)
       .values(value1, value2)
       .execute();
 

Author:
Lukas Eder

Method Summary
 MergeNotMatchedSetStep<R> whenNotMatchedThenInsert()
          Add the WHEN NOT MATCHED THEN INSERT clause to the MERGE statement.
 MergeNotMatchedValuesStep<R> whenNotMatchedThenInsert(Collection<? extends Field<?>> fields)
          Add the WHEN MATCHED THEN UPDATE clause to the MERGE statement
 MergeNotMatchedValuesStep<R> whenNotMatchedThenInsert(Field<?>... fields)
          Add the WHEN NOT MATCHED THEN INSERT clause to the MERGE statement
 
Methods inherited from interface org.jooq.Query
bind, bind, execute, getBindValues, getParam, getParams, getSQL, getSQL
 
Methods inherited from interface org.jooq.Attachable
attach
 
Methods inherited from interface org.jooq.Adapter
internalAPI
 

Method Detail

whenNotMatchedThenInsert

MergeNotMatchedSetStep<R> whenNotMatchedThenInsert()
Add the WHEN NOT MATCHED THEN INSERT clause to the MERGE statement.

Unlike the whenNotMatchedThenInsert(Field...) and whenNotMatchedThenInsert(Collection) methods, this will give access to a MySQL-like API allowing for INSERT SET a = x, b = y syntax.


whenNotMatchedThenInsert

MergeNotMatchedValuesStep<R> whenNotMatchedThenInsert(Field<?>... fields)
Add the WHEN NOT MATCHED THEN INSERT clause to the MERGE statement


whenNotMatchedThenInsert

MergeNotMatchedValuesStep<R> whenNotMatchedThenInsert(Collection<? extends Field<?>> fields)
Add the WHEN MATCHED THEN UPDATE clause to the MERGE statement



Copyright © 2012. All Rights Reserved.