Package net.morimekta.providence.jdbi.v2
Class MessageInserter.Builder<M extends net.morimekta.providence.PMessage<M,F>,F extends net.morimekta.providence.descriptor.PField>
- java.lang.Object
-
- net.morimekta.providence.jdbi.v2.MessageInserter.Builder<M,F>
-
- Enclosing class:
- MessageInserter<M extends net.morimekta.providence.PMessage<M,F>,F extends net.morimekta.providence.descriptor.PField>
public static class MessageInserter.Builder<M extends net.morimekta.providence.PMessage<M,F>,F extends net.morimekta.providence.descriptor.PField> extends java.lang.Object
-
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description MessageInserter<M,F>build()MessageInserter.Builder<M,F>onDuplicateKeyIgnore()On duplicate keys ignore updates.MessageInserter.Builder<M,F>onDuplicateKeyUpdate(F... fields)On duplicate keys update the given fields.MessageInserter.Builder<M,F>onDuplicateKeyUpdate(java.lang.String... columns)On duplicate keys update the given columns.MessageInserter.Builder<M,F>onDuplicateKeyUpdate(java.util.Collection<F> fields)On duplicate keys update the given fields.MessageInserter.Builder<M,F>onDuplicateKeyUpdateAllExcept(F... fields)On duplicate keys update all except the given fields.MessageInserter.Builder<M,F>onDuplicateKeyUpdateAllExcept(java.lang.String... exceptColumns)On duplicate keys update all except the given fields.MessageInserter.Builder<M,F>onDuplicateKeyUpdateAllExcept(java.util.Collection<F> fields)On duplicate keys update all except the given fields.MessageInserter.Builder<M,F>set(F... fields)Set the specific fields with default name and type.MessageInserter.Builder<M,F>set(F field, int type)Set the specific field with specific type and default name.MessageInserter.Builder<M,F>set(java.lang.String column, F field)Set the specific field with name and default type.MessageInserter.Builder<M,F>set(java.lang.String column, F field, int type)Set the specific field with specific name and type.MessageInserter.Builder<M,F>set(java.util.Collection<F> fields)Set the specific fields with default name and type.MessageInserter.Builder<M,F>setAll()Set all fields with defaults.MessageInserter.Builder<M,F>setAllExcept(F... except)Set all fields with defaults.MessageInserter.Builder<M,F>setAllExcept(java.util.Collection<F> except)Set all fields with defaults.MessageInserter.Builder<M,F>setAllExcept(net.morimekta.providence.descriptor.PMessageDescriptor<M,F> descriptor, F... except)Deprecated.since 1.7.0MessageInserter.Builder<M,F>setAllExcept(net.morimekta.providence.descriptor.PMessageDescriptor<M,F> descriptor, java.util.Collection<F> except)Deprecated.since 1.7.0
-
-
-
Method Detail
-
setAll
public final MessageInserter.Builder<M,F> setAll()
Set all fields with defaults.- Returns:
- The builder.
-
setAllExcept
@SafeVarargs public final MessageInserter.Builder<M,F> setAllExcept(F... except)
Set all fields with defaults.- Parameters:
except- Fields to exclude.- Returns:
- The builder.
-
setAllExcept
public MessageInserter.Builder<M,F> setAllExcept(java.util.Collection<F> except)
Set all fields with defaults.- Parameters:
except- Fields to exclude.- Returns:
- The builder.
-
setAllExcept
@Deprecated @SafeVarargs public final MessageInserter.Builder<M,F> setAllExcept(net.morimekta.providence.descriptor.PMessageDescriptor<M,F> descriptor, F... except)
Deprecated.since 1.7.0Set all fields with defaults.- Parameters:
descriptor- The message descriptor.except- Fields to exclude.- Returns:
- The builder.
-
setAllExcept
@Deprecated public MessageInserter.Builder<M,F> setAllExcept(net.morimekta.providence.descriptor.PMessageDescriptor<M,F> descriptor, java.util.Collection<F> except)
Deprecated.since 1.7.0Set all fields with defaults.- Parameters:
descriptor- The message descriptor.except- Fields to exclude.- Returns:
- The builder.
-
set
@SafeVarargs public final MessageInserter.Builder<M,F> set(F... fields)
Set the specific fields with default name and type.- Parameters:
fields- The fields to be set.- Returns:
- The builder.
-
set
public final MessageInserter.Builder<M,F> set(java.util.Collection<F> fields)
Set the specific fields with default name and type.- Parameters:
fields- The fields to be set.- Returns:
- The builder.
-
set
public final MessageInserter.Builder<M,F> set(java.lang.String column, F field)
Set the specific field with name and default type.- Parameters:
column- The column name to set.field- The field to be set.- Returns:
- The builder.
-
set
public final MessageInserter.Builder<M,F> set(F field, int type)
Set the specific field with specific type and default name.- Parameters:
field- The field to be set.type- The field type to set as.- Returns:
- The builder.
-
set
public final MessageInserter.Builder<M,F> set(java.lang.String column, F field, int type)
Set the specific field with specific name and type.- Parameters:
column- The column name to set.field- The field to be set.type- The field type to set as.- Returns:
- The builder.
-
onDuplicateKeyUpdate
@SafeVarargs public final MessageInserter.Builder<M,F> onDuplicateKeyUpdate(F... fields)
On duplicate keys update the given fields.- Parameters:
fields- The fields to update.- Returns:
- The builder.
-
onDuplicateKeyUpdate
public final MessageInserter.Builder<M,F> onDuplicateKeyUpdate(java.util.Collection<F> fields)
On duplicate keys update the given fields.- Parameters:
fields- The fields to update.- Returns:
- The builder.
-
onDuplicateKeyUpdateAllExcept
@SafeVarargs public final MessageInserter.Builder<M,F> onDuplicateKeyUpdateAllExcept(F... fields)
On duplicate keys update all except the given fields.- Parameters:
fields- The fields to NOT update.- Returns:
- The builder.
-
onDuplicateKeyUpdateAllExcept
public final MessageInserter.Builder<M,F> onDuplicateKeyUpdateAllExcept(java.util.Collection<F> fields)
On duplicate keys update all except the given fields.- Parameters:
fields- The fields to NOT update.- Returns:
- The builder.
-
onDuplicateKeyUpdateAllExcept
public final MessageInserter.Builder<M,F> onDuplicateKeyUpdateAllExcept(java.lang.String... exceptColumns)
On duplicate keys update all except the given fields.- Parameters:
exceptColumns- The column names NOT to update.- Returns:
- The builder.
-
onDuplicateKeyUpdate
public final MessageInserter.Builder<M,F> onDuplicateKeyUpdate(java.lang.String... columns)
On duplicate keys update the given columns.- Parameters:
columns- The column names NOT to update.- Returns:
- The builder.
-
onDuplicateKeyIgnore
public final MessageInserter.Builder<M,F> onDuplicateKeyIgnore()
On duplicate keys ignore updates.- Returns:
- The builder.
-
build
public MessageInserter<M,F> build()
- Returns:
- The final built inserter.
-
-