T
- The type of the data to be persisted.public interface Dao<T>
Modifier and Type | Method and Description |
---|---|
void |
atomicDelete(T item)
Run a delete statement in the database.
|
long |
atomicInsert(T item)
Insert a record into the database within a transaction that is
managed within the Dao.
|
void |
atomicUpdate(T item)
Run an update statement to change the values in the database associated
with an existing record.
|
void |
delete(T item)
Run a delete statement in the database.
|
long |
insert(T item)
Insert a record into the database.
|
T |
select(long id)
Read a record from the database.
|
List<T> |
selectAll()
Read all the records in the database of type T.
|
T |
selectByColumns(T item,
String... columnNames)
Select a single record from the database by some search criteria.
|
List<T> |
selectMany(List<Long> ids)
Read several records from the database.
|
List<T> |
selectManyByColumns(T item,
String... columnNames)
Select multiple records from the database by some search criteria.
|
void |
update(T item)
Run an update statement to change the values in the database associated
with an existing record.
|
long insert(T item)
item
- The instance to be inserted.void update(T item)
item
- An instance of the class with a populated primary key field
and updated field values.void delete(T item)
item
- An instance of type T with a populated primary key.T select(long id)
id
- The primary key of the record desired.List<T> selectMany(List<Long> ids)
ids
- The primary keys of the records desired.List<T> selectAll()
T selectByColumns(T item, String... columnNames)
item
- An instance of type T with populated values corresponding to the
column names to select by.columnNames
- The names of the database columnsList<T> selectManyByColumns(T item, String... columnNames)
item
- An instance of type T with populated values corresponding to the
column names to select by.columnNames
- The names of the database columnslong atomicInsert(T item)
Connection
when complete.item
- The instance to be inserted.void atomicUpdate(T item)
Connection
when complete.item
- An instance of the class with a populated primary key field
and updated field values.void atomicDelete(T item)
Connection
when complete.item
- An instance of type T with a populated primary key.Copyright © 2018. All rights reserved.