Package io.inugami.api.dao
Interface Dao
-
- All Superinterfaces:
Serializable
public interface Dao extends Serializable
Dao- Since:
- 9 janv. 2018
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description <E extends Identifiable<PK>,PK extends Serializable>
intcount(Class<? extends E> type)Count.<E extends Identifiable<PK>,PK extends Serializable>
intcount(Map<String,String> filters, Class<? extends E> type)Count.<E extends Identifiable<PK>,PK extends Serializable>
voiddelete(E entity, Class<? extends E> type)Delete.<E extends Identifiable<PK>,PK extends Serializable>
voiddelete(List<E> entity, Class<? extends E> type)Allow to delete entities<E extends Identifiable<PK>,PK extends Serializable>
voiddelete(PK uid, Class<? extends E> type)Delete.<E extends Identifiable<PK>,PK extends Serializable>
voiddeleteByIds(List<PK> uids, Class<? extends E> type)Allow to delete entities by uids<E extends Identifiable<PK>,PK extends Serializable>
List<E>find(Class<? extends E> type, int first, int pageSize, String field, String sortOrder, Map<String,String> filters)Find.<E extends Identifiable<PK>,PK extends Serializable>
List<E>findAll(Class<? extends E> type)Find all.<E extends Identifiable<PK>,PK extends Serializable>
Eget(E entity)Allow to get a entity.<E extends Identifiable<PK>,PK extends Serializable>
EgetByUid(Class<? extends E> type, PK uid)Allow to get a entity from uid .<E extends Identifiable<PK>,PK extends Serializable>
List<E>getByUids(Class<? extends E> type, List<PK> uids)Allow to get entities by uid<E extends Identifiable<PK>,PK extends Serializable>
Emerge(E entity, Class<? extends E> type)Merge.<E extends Identifiable<PK>,PK extends Serializable>
voidmerge(List<E> listEntity, Class<? extends E> type)Merge.<E extends Identifiable<PK>,PK extends Serializable>
voidrefresh(E entity)Refresh.<E extends Identifiable<PK>,PK extends Serializable>
SaveEntitiesResult<E>register(List<E> entities, Class<? extends E> type)Allow to register and save non existing entities or merge existing.<E extends Identifiable<PK>,PK extends Serializable>
voidsave(E entity, Class<? extends E> type)Save.<E extends Identifiable<PK>,PK extends Serializable>
voidsave(List<E> listEntity, Class<? extends E> type)Save.
-
-
-
Method Detail
-
getByUid
<E extends Identifiable<PK>,PK extends Serializable> E getByUid(Class<? extends E> type, PK uid) throws DaoEntityNotFoundException, DaoException
Allow to get a entity from uid .- Type Parameters:
E- Entity typePK- Entity UID type- Parameters:
type- entity type classuid- entity uid- Returns:
- the entity
- Throws:
DaoEntityNotFoundException- if entity isn't found in datasourceDaoException- if exception is occurs.
-
getByUids
<E extends Identifiable<PK>,PK extends Serializable> List<E> getByUids(Class<? extends E> type, List<PK> uids) throws DaoEntityNotFoundException, DaoException
Allow to get entities by uid- Parameters:
type- Entities typeuids- entities uids- Returns:
- empty or list of entities
- Throws:
DaoEntityNotFoundException- if entity isn't found in datasourceDaoException- if exception is occurs.
-
get
<E extends Identifiable<PK>,PK extends Serializable> E get(E entity) throws DaoEntityNotFoundException, DaoException
Allow to get a entity.- Type Parameters:
E- Entity type- Parameters:
entity- reference- Returns:
- the entity
- Throws:
DaoEntityNotFoundException- if entity isn't found in datasourceDaoException- if exception is occur.
-
refresh
<E extends Identifiable<PK>,PK extends Serializable> void refresh(E entity) throws DaoEntityNotFoundException, DaoException
Refresh.- Type Parameters:
E- the element type- Parameters:
entity- the entity- Throws:
DaoException- the dao exceptionDaoEntityNotFoundException
-
save
<E extends Identifiable<PK>,PK extends Serializable> void save(E entity, Class<? extends E> type) throws DaoException
Save.- Type Parameters:
E- the element type- Parameters:
entity- the entity- Throws:
DaoException- the dao exception
-
save
<E extends Identifiable<PK>,PK extends Serializable> void save(List<E> listEntity, Class<? extends E> type) throws DaoException
Save.- Type Parameters:
E- the element type- Parameters:
listEntity- the list entity- Throws:
DaoException- the dao exception
-
merge
<E extends Identifiable<PK>,PK extends Serializable> E merge(E entity, Class<? extends E> type) throws DaoException
Merge.- Type Parameters:
E- the element type- Parameters:
entity- the entity- Returns:
- the e
- Throws:
DaoException- the dao exception
-
merge
<E extends Identifiable<PK>,PK extends Serializable> void merge(List<E> listEntity, Class<? extends E> type) throws DaoException
Merge.- Type Parameters:
E- the element type- Parameters:
listEntity- the list entity- Throws:
DaoException- the dao exception
-
register
<E extends Identifiable<PK>,PK extends Serializable> SaveEntitiesResult<E> register(List<E> entities, Class<? extends E> type) throws DaoException
Allow to register and save non existing entities or merge existing.- Parameters:
entities- all entities to registertype- entity class type- Throws:
DaoException- if excpetion is occur
-
findAll
<E extends Identifiable<PK>,PK extends Serializable> List<E> findAll(Class<? extends E> type) throws DaoException
Find all.- Type Parameters:
E- the element type- Parameters:
type- the type- Returns:
- the list
- Throws:
DaoException- the dao exception
-
find
<E extends Identifiable<PK>,PK extends Serializable> List<E> find(Class<? extends E> type, int first, int pageSize, String field, String sortOrder, Map<String,String> filters) throws DaoException
Find.- Type Parameters:
E- the element type- Parameters:
type- the typefirst- the firstpageSize- the page sizefield- the fieldsortOrder- the sort orderfilters- the filters- Returns:
- the list
- Throws:
DaoException- the dao exception
-
count
<E extends Identifiable<PK>,PK extends Serializable> int count(Class<? extends E> type) throws DaoException
Count.- Parameters:
type- the type- Returns:
- the int
- Throws:
DaoException- the dao exception
-
count
<E extends Identifiable<PK>,PK extends Serializable> int count(Map<String,String> filters, Class<? extends E> type) throws DaoException
Count.- Parameters:
filters- the filterstype- the type- Returns:
- the int
- Throws:
DaoException- the dao exception
-
delete
<E extends Identifiable<PK>,PK extends Serializable> void delete(E entity, Class<? extends E> type) throws DaoEntityNotFoundException, DaoException
Delete.- Type Parameters:
E- the element typePK- the generic type- Parameters:
entity- the entity- Throws:
DaoException- the dao exceptionDaoEntityNotFoundException
-
delete
<E extends Identifiable<PK>,PK extends Serializable> void delete(PK uid, Class<? extends E> type) throws DaoEntityNotFoundException, DaoException
Delete.- Type Parameters:
E- the element typePK- the generic type- Parameters:
uid- the uidtype- the type- Throws:
DaoException- the dao exceptionDaoEntityNotFoundException
-
delete
<E extends Identifiable<PK>,PK extends Serializable> void delete(List<E> entity, Class<? extends E> type) throws DaoEntityNotFoundException, DaoException
Allow to delete entities- Parameters:
entity-type-- Throws:
DaoEntityNotFoundExceptionDaoException
-
deleteByIds
<E extends Identifiable<PK>,PK extends Serializable> void deleteByIds(List<PK> uids, Class<? extends E> type) throws DaoEntityNotFoundException, DaoException
Allow to delete entities by uids- Parameters:
uids-type-- Throws:
DaoEntityNotFoundExceptionDaoException
-
-