public interface ICrud<T extends AbsModel>
Modifier and Type | Method and Description |
---|---|
int |
create(T entity)
create a new entity of implement dao
|
int |
delete(int id)
delete a record from dao object
|
java.util.List<T> |
filterByEntity(T entity)
returns all filtered entities.
|
java.util.List<T> |
get()
gives all the records form the dao object
|
T |
getById(int id)
looking for a id from implement dao
|
void |
setDataSource(javax.sql.DataSource dataSource)
used to initialize database resources connection.
|
int |
update(int id,
T newEntity)
update a entity of dao objects
|
void setDataSource(javax.sql.DataSource dataSource)
dataSource
- database connectionint create(T entity)
entity
- new modelT getById(int id)
id
- of dao entityjava.util.List<T> get()
java.util.List<T> filterByEntity(T entity)
entity
- to filterint delete(int id)
id
- of entityint update(int id, T newEntity)
id
- to updatenewEntity
- includes the new values for update a entity