Constructor and Description |
---|
MultiRowsBatchInsertCrud(DefaultCrud<T,K> delegate,
BatchQueryExecutor<T> batchInsertQueryPreparer,
BatchQueryExecutor<T> batchUpsertQueryExecutor) |
Modifier and Type | Method and Description |
---|---|
void |
create(Connection connection,
Collection<T> values)
insert values into the db through the specified connection.
|
<RH extends org.simpleflatmapper.util.CheckedConsumer<? super K>> |
create(Connection connection,
Collection<T> values,
RH keyConsumer)
insert values into the db through the specified connection.
|
void |
create(Connection connection,
T value)
insert value into the db through the specified connection.
|
<RH extends org.simpleflatmapper.util.CheckedConsumer<? super K>> |
create(Connection connection,
T value,
RH keyConsumer)
insert value into the db through the specified connection.
|
void |
createOrUpdate(Connection connection,
Collection<T> values)
UPSERT only supported on Mysql
|
<RH extends org.simpleflatmapper.util.CheckedConsumer<? super K>> |
createOrUpdate(Connection connection,
Collection<T> values,
RH keyConsumer)
UPSERT only supported on Mysql and Postgres 9.5.
|
void |
createOrUpdate(Connection connection,
T value)
UPSERT only supported on Mysql
|
<RH extends org.simpleflatmapper.util.CheckedConsumer<? super K>> |
createOrUpdate(Connection connection,
T value,
RH keyConsumer)
UPSERT only supported on Mysql and Postgres 9.5.
|
void |
delete(Connection connection,
Collection<K> keys)
delete the objects with the specified keys.
|
void |
delete(Connection connection,
K key)
delete the object with the specified key.
|
<RH extends org.simpleflatmapper.util.CheckedConsumer<? super T>> |
read(Connection connection,
Collection<K> keys,
RH consumer)
retrieve the objects with the specified keys and pass them to the consumer.
|
T |
read(Connection connection,
K key)
retrieve the object with the specified key.
|
void |
update(Connection connection,
Collection<T> values)
update the objects.
|
void |
update(Connection connection,
T value)
update the object.
|
<P> SelectQuery<T,P> |
where(String whereClause,
Type paramClass) |
public MultiRowsBatchInsertCrud(DefaultCrud<T,K> delegate, BatchQueryExecutor<T> batchInsertQueryPreparer, BatchQueryExecutor<T> batchUpsertQueryExecutor)
public void create(Connection connection, T value) throws SQLException
Crud
create
in interface Crud<T,K>
connection
- the connectionvalue
- the valueSQLException
- if an error occurspublic void create(Connection connection, Collection<T> values) throws SQLException
Crud
create
in interface Crud<T,K>
connection
- the connectionvalues
- the valuesSQLException
- if an error occurspublic <RH extends org.simpleflatmapper.util.CheckedConsumer<? super K>> RH create(Connection connection, T value, RH keyConsumer) throws SQLException
Crud
create
in interface Crud<T,K>
RH
- the type of keyConsumerconnection
- the connectionvalue
- the valuekeyConsumer
- the key consumerSQLException
public <RH extends org.simpleflatmapper.util.CheckedConsumer<? super K>> RH create(Connection connection, Collection<T> values, RH keyConsumer) throws SQLException
Crud
create
in interface Crud<T,K>
RH
- the type of keyConsumerconnection
- the connectionvalues
- the valueskeyConsumer
- the key consumerSQLException
public T read(Connection connection, K key) throws SQLException
Crud
read
in interface Crud<T,K>
connection
- the connectionkey
- the keySQLException
- if an error occurspublic <RH extends org.simpleflatmapper.util.CheckedConsumer<? super T>> RH read(Connection connection, Collection<K> keys, RH consumer) throws SQLException
Crud
read
in interface Crud<T,K>
connection
- the connectionkeys
- the keysconsumer
- the handler that is callback for each rowSQLException
- if an error occurspublic void update(Connection connection, T value) throws SQLException
Crud
update
in interface Crud<T,K>
connection
- the connectionvalue
- the objectSQLException
- if an error occurspublic void update(Connection connection, Collection<T> values) throws SQLException
Crud
update
in interface Crud<T,K>
connection
- the connectionvalues
- the objectsSQLException
- if an error occurspublic void delete(Connection connection, K key) throws SQLException
Crud
delete
in interface Crud<T,K>
connection
- the connectionkey
- the keySQLException
- if an error occurspublic void delete(Connection connection, Collection<K> keys) throws SQLException
Crud
delete
in interface Crud<T,K>
connection
- the connectionkeys
- the keysSQLException
- if an error occurspublic void createOrUpdate(Connection connection, T value) throws SQLException
Crud
createOrUpdate
in interface Crud<T,K>
connection
- the connectionvalue
- the valueSQLException
public void createOrUpdate(Connection connection, Collection<T> values) throws SQLException
Crud
createOrUpdate
in interface Crud<T,K>
connection
- the connectionvalues
- the values to upsertSQLException
public <RH extends org.simpleflatmapper.util.CheckedConsumer<? super K>> RH createOrUpdate(Connection connection, T value, RH keyConsumer) throws SQLException
Crud
createOrUpdate
in interface Crud<T,K>
RH
- the keyConsumer typeconnection
- the connectionvalue
- the value to upsertkeyConsumer
- generated key consumerSQLException
public <RH extends org.simpleflatmapper.util.CheckedConsumer<? super K>> RH createOrUpdate(Connection connection, Collection<T> values, RH keyConsumer) throws SQLException
Crud
createOrUpdate
in interface Crud<T,K>
RH
- the keyConsumer typeconnection
- the connectionvalues
- the values to insertkeyConsumer
- generated key consumerSQLException
Copyright © 2019. All rights reserved.