Package net.morimekta.providence.jdbi.v2
Class MessageUpserter.Builder<M extends net.morimekta.providence.PMessage<M>>
- java.lang.Object
-
- net.morimekta.providence.jdbi.v2.MessageUpserter.Builder<M>
-
- Enclosing class:
- MessageUpserter<M extends net.morimekta.providence.PMessage<M>>
public static class MessageUpserter.Builder<M extends net.morimekta.providence.PMessage<M>> extends java.lang.Object
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description MessageUpserter<M>build()MessageUpserter.Builder<M>onDuplicateKeyIgnore()On duplicate keys ignore updates.MessageUpserter.Builder<M>onDuplicateKeyUpdate(java.lang.String... columns)On duplicate keys update the given columns.MessageUpserter.Builder<M>onDuplicateKeyUpdate(java.util.Collection<net.morimekta.providence.descriptor.PField<M>> fields)On duplicate keys update the given fields.MessageUpserter.Builder<M>onDuplicateKeyUpdate(net.morimekta.providence.descriptor.PField<M>... fields)On duplicate keys update the given fields.MessageUpserter.Builder<M>onDuplicateKeyUpdateAllExcept(java.lang.String... exceptColumns)On duplicate keys update all except the given fields.MessageUpserter.Builder<M>onDuplicateKeyUpdateAllExcept(java.util.Collection<net.morimekta.providence.descriptor.PField<M>> fields)On duplicate keys update all except the given fields.MessageUpserter.Builder<M>onDuplicateKeyUpdateAllExcept(net.morimekta.providence.descriptor.PField<M>... fields)On duplicate keys update all except the given fields.MessageUpserter.Builder<M>set(java.lang.String column, net.morimekta.providence.descriptor.PField<M> field)Set the specific field with name and default type.MessageUpserter.Builder<M>set(java.lang.String column, net.morimekta.providence.descriptor.PField<M> field, int type)Set the specific field with specific name and type.MessageUpserter.Builder<M>set(java.util.Collection<net.morimekta.providence.descriptor.PField<M>> fields)Set the specific fields with default name and type.MessageUpserter.Builder<M>set(net.morimekta.providence.descriptor.PField<M>... fields)Set the specific fields with default name and type.MessageUpserter.Builder<M>set(net.morimekta.providence.descriptor.PField<M> field, int type)Set the specific field with specific type and default name.MessageUpserter.Builder<M>setAll()Set all fields not already handled with default name and type.MessageUpserter.Builder<M>setAllExcept(java.util.Collection<net.morimekta.providence.descriptor.PField<M>> except)Set all fields with defaults.MessageUpserter.Builder<M>setAllExcept(net.morimekta.providence.descriptor.PField<M>... except)Set all fields with defaults.
-
-
-
Constructor Detail
-
Builder
public Builder(@Nonnull net.morimekta.providence.descriptor.PMessageDescriptor<M> descriptor, @Nonnull java.lang.String intoTable)Create a message inserter builder.- Parameters:
descriptor- The type descriptor.intoTable- The table name to insert info.
-
-
Method Detail
-
setAll
public final MessageUpserter.Builder<M> setAll()
Set all fields not already handled with default name and type.- Returns:
- The builder.
-
setAllExcept
@SafeVarargs public final MessageUpserter.Builder<M> setAllExcept(net.morimekta.providence.descriptor.PField<M>... except)
Set all fields with defaults.- Parameters:
except- Fields to exclude.- Returns:
- The builder.
-
setAllExcept
public MessageUpserter.Builder<M> setAllExcept(java.util.Collection<net.morimekta.providence.descriptor.PField<M>> except)
Set all fields with defaults.- Parameters:
except- Fields to exclude.- Returns:
- The builder.
-
set
@SafeVarargs public final MessageUpserter.Builder<M> set(net.morimekta.providence.descriptor.PField<M>... fields)
Set the specific fields with default name and type.- Parameters:
fields- The fields to be set.- Returns:
- The builder.
-
set
public final MessageUpserter.Builder<M> set(java.util.Collection<net.morimekta.providence.descriptor.PField<M>> fields)
Set the specific fields with default name and type.- Parameters:
fields- The fields to be set.- Returns:
- The builder.
-
set
public final MessageUpserter.Builder<M> set(java.lang.String column, net.morimekta.providence.descriptor.PField<M> 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 MessageUpserter.Builder<M> set(net.morimekta.providence.descriptor.PField<M> 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 MessageUpserter.Builder<M> set(java.lang.String column, net.morimekta.providence.descriptor.PField<M> 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 MessageUpserter.Builder<M> onDuplicateKeyUpdate(net.morimekta.providence.descriptor.PField<M>... fields)
On duplicate keys update the given fields.- Parameters:
fields- The fields to update.- Returns:
- The builder.
-
onDuplicateKeyUpdate
public final MessageUpserter.Builder<M> onDuplicateKeyUpdate(java.util.Collection<net.morimekta.providence.descriptor.PField<M>> fields)
On duplicate keys update the given fields.- Parameters:
fields- The fields to update.- Returns:
- The builder.
-
onDuplicateKeyUpdateAllExcept
@SafeVarargs public final MessageUpserter.Builder<M> onDuplicateKeyUpdateAllExcept(net.morimekta.providence.descriptor.PField<M>... fields)
On duplicate keys update all except the given fields.- Parameters:
fields- The fields to NOT update.- Returns:
- The builder.
-
onDuplicateKeyUpdateAllExcept
public final MessageUpserter.Builder<M> onDuplicateKeyUpdateAllExcept(java.util.Collection<net.morimekta.providence.descriptor.PField<M>> fields)
On duplicate keys update all except the given fields.- Parameters:
fields- The fields to NOT update.- Returns:
- The builder.
-
onDuplicateKeyUpdateAllExcept
public final MessageUpserter.Builder<M> 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 MessageUpserter.Builder<M> 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 MessageUpserter.Builder<M> onDuplicateKeyIgnore()
On duplicate keys ignore updates.- Returns:
- The builder.
-
build
public MessageUpserter<M> build()
- Returns:
- The final built inserter.
-
-