public class JdbcTemplateCrud<T,K> extends Object
| Constructor and Description |
|---|
JdbcTemplateCrud(org.springframework.jdbc.core.JdbcOperations jdbcOperations,
org.simpleflatmapper.jdbc.Crud<T,K> crud) |
| Modifier and Type | Method and Description |
|---|---|
void |
create(Collection<T> values)
insert values into the db through the specified connection.
|
<RH extends org.simpleflatmapper.util.CheckedConsumer<? super K>> |
create(Collection<T> values,
RH keyConsumer)
insert values into the db through the specified connection.
|
void |
create(T value)
insert value into the db through the specified connection.
|
<RH extends org.simpleflatmapper.util.CheckedConsumer<? super K>> |
create(T value,
RH keyConsumer)
insert value into the db through the specified connection.
|
void |
createOrUpdate(Collection<T> values)
UPSERT only supported on Mysql
|
<RH extends org.simpleflatmapper.util.CheckedConsumer<? super K>> |
createOrUpdate(Collection<T> values,
RH keyConsumer)
UPSERT only supported on Mysql.
|
void |
createOrUpdate(T value)
UPSERT only supported on Mysql
|
<RH extends org.simpleflatmapper.util.CheckedConsumer<? super K>> |
createOrUpdate(T value,
RH keyConsumer)
UPSERT only supported on Mysql.
|
void |
delete(K key)
delete the object with the specified key.
|
void |
delete(List<K> keys)
delete the objects with the specified keys.
|
<RH extends org.simpleflatmapper.util.CheckedConsumer<? super T>> |
read(Collection<K> keys,
RH consumer)
retrieve the objects with the specified keys and pass them to the consumer.
|
T |
read(K key)
retrieve the object with the specified key.
|
void |
update(Collection<T> values)
update the objects.
|
void |
update(T value)
update the object.
|
<P> org.simpleflatmapper.jdbc.ConnectedSelectQuery<T,P> |
where(String whereClause,
Type paramClass) |
public void create(T value) throws org.springframework.dao.DataAccessException
value - the valueorg.springframework.dao.DataAccessException - if an error occurspublic void create(Collection<T> values) throws org.springframework.dao.DataAccessException
values - the valuesorg.springframework.dao.DataAccessException - if an error occurspublic <RH extends org.simpleflatmapper.util.CheckedConsumer<? super K>> RH create(T value, RH keyConsumer) throws org.springframework.dao.DataAccessException
RH - the type of keyConsumervalue - the valuekeyConsumer - the key consumerorg.springframework.dao.DataAccessExceptionpublic <RH extends org.simpleflatmapper.util.CheckedConsumer<? super K>> RH create(Collection<T> values, RH keyConsumer) throws org.springframework.dao.DataAccessException
RH - the type of keyConsumervalues - the valueskeyConsumer - the key consumerorg.springframework.dao.DataAccessExceptionpublic T read(K key) throws org.springframework.dao.DataAccessException
key - the keyorg.springframework.dao.DataAccessException - if an error occurspublic <RH extends org.simpleflatmapper.util.CheckedConsumer<? super T>> RH read(Collection<K> keys, RH consumer) throws org.springframework.dao.DataAccessException
keys - the keysconsumer - the handler that is callback for each roworg.springframework.dao.DataAccessException - if an error occurspublic void update(T value) throws org.springframework.dao.DataAccessException
value - the objectorg.springframework.dao.DataAccessException - if an error occurspublic void update(Collection<T> values) throws org.springframework.dao.DataAccessException
values - the objectsorg.springframework.dao.DataAccessException - if an error occurspublic void delete(K key) throws org.springframework.dao.DataAccessException
key - the keyorg.springframework.dao.DataAccessException - if an error occurspublic void delete(List<K> keys) throws org.springframework.dao.DataAccessException
keys - the keysorg.springframework.dao.DataAccessException - if an error occurspublic void createOrUpdate(T value) throws org.springframework.dao.DataAccessException
value - the valueorg.springframework.dao.DataAccessExceptionUnsupportedOperationExceptionpublic void createOrUpdate(Collection<T> values) throws org.springframework.dao.DataAccessException
values - the values to upsertorg.springframework.dao.DataAccessExceptionUnsupportedOperationExceptionpublic <RH extends org.simpleflatmapper.util.CheckedConsumer<? super K>> RH createOrUpdate(T value, RH keyConsumer) throws org.springframework.dao.DataAccessException
RH - the keyConsumer typevalue - the value to upsertkeyConsumer - generated key consumerorg.springframework.dao.DataAccessExceptionpublic <RH extends org.simpleflatmapper.util.CheckedConsumer<? super K>> RH createOrUpdate(Collection<T> values, RH keyConsumer) throws org.springframework.dao.DataAccessException
RH - the keyConsumer typevalues - the values to insertkeyConsumer - generated key consumerorg.springframework.dao.DataAccessExceptionCopyright © 2018. All rights reserved.