| Constructor and Description |
|---|
LazyCrud(CrudDSL<T,K> crudDSL,
String table) |
| 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 void create(Connection connection, T value) throws SQLException
Crudcreate in interface Crud<T,K>connection - the connectionvalue - the valueSQLException - if an error occurspublic void create(Connection connection, Collection<T> values) throws SQLException
Crudcreate 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
Crudcreate in interface Crud<T,K>RH - the type of keyConsumerconnection - the connectionvalue - the valuekeyConsumer - the key consumerSQLExceptionpublic <RH extends org.simpleflatmapper.util.CheckedConsumer<? super K>> RH create(Connection connection, Collection<T> values, RH keyConsumer) throws SQLException
Crudcreate in interface Crud<T,K>RH - the type of keyConsumerconnection - the connectionvalues - the valueskeyConsumer - the key consumerSQLExceptionpublic T read(Connection connection, K key) throws SQLException
Crudread 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
Crudread 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
Crudupdate in interface Crud<T,K>connection - the connectionvalue - the objectSQLException - if an error occurspublic void update(Connection connection, Collection<T> values) throws SQLException
Crudupdate in interface Crud<T,K>connection - the connectionvalues - the objectsSQLException - if an error occurspublic void delete(Connection connection, K key) throws SQLException
Cruddelete in interface Crud<T,K>connection - the connectionkey - the keySQLException - if an error occurspublic void delete(Connection connection, Collection<K> keys) throws SQLException
Cruddelete in interface Crud<T,K>connection - the connectionkeys - the keysSQLException - if an error occurspublic void createOrUpdate(Connection connection, T value) throws SQLException
CrudcreateOrUpdate in interface Crud<T,K>connection - the connectionvalue - the valueSQLExceptionpublic void createOrUpdate(Connection connection, Collection<T> values) throws SQLException
CrudcreateOrUpdate in interface Crud<T,K>connection - the connectionvalues - the values to upsertSQLExceptionpublic <RH extends org.simpleflatmapper.util.CheckedConsumer<? super K>> RH createOrUpdate(Connection connection, T value, RH keyConsumer) throws SQLException
CrudcreateOrUpdate in interface Crud<T,K>RH - the keyConsumer typeconnection - the connectionvalue - the value to upsertkeyConsumer - generated key consumerSQLExceptionpublic <RH extends org.simpleflatmapper.util.CheckedConsumer<? super K>> RH createOrUpdate(Connection connection, Collection<T> values, RH keyConsumer) throws SQLException
CrudcreateOrUpdate in interface Crud<T,K>RH - the keyConsumer typeconnection - the connectionvalues - the values to insertkeyConsumer - generated key consumerSQLExceptionCopyright © 2020. All rights reserved.