public interface TopiaDao<E extends TopiaEntity> extends Iterable<E>
| Modifier and Type | Method and Description |
|---|---|
void |
addTopiaEntityListener(TopiaEntityListener listener) |
void |
addTopiaEntityVetoable(TopiaEntityVetoable vetoable) |
long |
count()
Count the number of existing entities.
|
E |
create() |
E |
create(E entity)
Creates an entity not created without the DAO using any of the others
create methods.
|
E |
create(Map<String,Object> properties)
Creates a new instance of the entity managed by the DAO
|
E |
create(String propertyName,
Object propertyValue,
Object... otherPropertyNamesAndValues) |
Iterable<E> |
createAll(Iterable<E> entities) |
void |
delete(E entity)
Deletes the given entity from the storage
|
void |
deleteAll(Iterable<E> entities)
Deletes all given entities from the storage
|
List<E> |
findAll()
Finds all the entities managed by this DAO.
|
List<String> |
findAllIds()
Find all the ids for the entities managed by this DAO.
|
Iterable<E> |
findAllLazy() |
Map<Class<? extends TopiaEntity>,List<? extends TopiaEntity>> |
findAllUsages(E entity)
Find all usages of the given
entity. |
E |
findByTopiaId(String topiaId)
Tries to find the entity with the given topiaId.
|
<R extends TopiaEntity> |
findUsages(Class<R> type,
E entity)
Find usages of the given
entity in the entities of the given
type. |
TopiaQueryBuilderAddCriteriaOrRunQueryStep<E> |
forAll()
Creates a QueryBuilder without restriction
|
TopiaQueryBuilderRunQueryStep<E> |
forContains(String propertyName,
Object propertyValue) |
TopiaQueryBuilderRunQueryStep<E> |
forEquals(String propertyName,
Object propertyValue) |
TopiaQueryBuilderRunQueryStep<E> |
forIn(String propertyName,
Collection<?> propertyValues) |
TopiaQueryBuilderAddCriteriaOrRunQueryStep<E> |
forProperties(Map<String,Object> properties) |
TopiaQueryBuilderAddCriteriaOrRunQueryStep<E> |
forProperties(String propertyName,
Object propertyValue,
Object... otherPropertyNamesAndValues) |
TopiaQueryBuilderRunQueryStep<E> |
forTopiaIdEquals(String topiaId) |
TopiaQueryBuilderRunQueryStep<E> |
forTopiaIdIn(Collection<String> topiaIds) |
List<TopiaEntity> |
getAggregate(E entity) |
int |
getBatchSize()
Obtains the batch size used to load data.
|
List<TopiaEntity> |
getComposite(E entity) |
Class<E> |
getEntityClass()
Return the class of the entity managed by this DAO.
|
E |
newInstance()
Create a new instance of managed entity not persisted.
|
TopiaPagerBean |
newPager(int pageSize)
Creates a new pager initialized for the first page of all data of the dao.
|
TopiaPagerBean |
newPager(String hql,
Map<String,Object> params,
int pageSize)
Creates a new pager initialized for the first page of data of the given
query.
|
TopiaQueryBuilderAddCriteriaStep<E> |
newQueryBuilder() |
void |
removeTopiaEntityListener(TopiaEntityListener listener) |
void |
removeTopiaEntityVetoable(TopiaEntityVetoable vetoable) |
void |
setBatchSize(int batchSize)
Set a new default batch size.
|
com.google.common.base.Optional<E> |
tryFindByTopiaId(String topiaId)
Tries to find the entity with the given topiaId.
|
E |
update(E entity)
Update an entity.
|
Iterable<E> |
updateAll(Iterable<E> entities) |
Class<E> getEntityClass()
int getBatchSize()
void setBatchSize(int batchSize)
batchSize - new batch size to use when iterating.E newInstance()
TopiaPagerBean newPager(int pageSize)
pageSize - size of a pageTopiaPagerBean newPager(String hql, Map<String,Object> params, int pageSize)
hql - queryparams - params of the querypageSize - size of a pageE create(E entity)
entity - the instance to persistE create(String propertyName, Object propertyValue, Object... otherPropertyNamesAndValues)
E create(Map<String,Object> properties)
properties - the key-value list of properties that the created entity will have.IllegalArgumentException - if some property type is not the
expected oneE create()
E update(E entity)
entity - the entity to create or updatevoid delete(E entity)
entity - the entity to removevoid deleteAll(Iterable<E> entities)
entities - entities to deleteList<E> findAll()
List<String> findAllIds()
long count()
TopiaQueryBuilderAddCriteriaOrRunQueryStep<E> forAll()
TopiaQueryBuilderAddCriteriaOrRunQueryStep<E> forProperties(Map<String,Object> properties)
TopiaQueryBuilderAddCriteriaOrRunQueryStep<E> forProperties(String propertyName, Object propertyValue, Object... otherPropertyNamesAndValues)
TopiaQueryBuilderAddCriteriaStep<E> newQueryBuilder()
TopiaQueryBuilderRunQueryStep<E> forContains(String propertyName, Object propertyValue)
TopiaQueryBuilderRunQueryStep<E> forEquals(String propertyName, Object propertyValue)
TopiaQueryBuilderRunQueryStep<E> forIn(String propertyName, Collection<?> propertyValues)
TopiaQueryBuilderRunQueryStep<E> forTopiaIdEquals(String topiaId)
E findByTopiaId(String topiaId) throws TopiaNoResultException
topiaId - the identifier of the entity to look forTopiaNoResultException - if result is found, if you
do not want an exception to be raised, use
tryFindByTopiaId(String)com.google.common.base.Optional<E> tryFindByTopiaId(String topiaId)
false.topiaId - the identifier of the entity to look forTopiaQueryBuilderRunQueryStep<E> forTopiaIdIn(Collection<String> topiaIds)
void addTopiaEntityListener(TopiaEntityListener listener)
void addTopiaEntityVetoable(TopiaEntityVetoable vetoable)
void removeTopiaEntityListener(TopiaEntityListener listener)
void removeTopiaEntityVetoable(TopiaEntityVetoable vetoable)
<R extends TopiaEntity> List<R> findUsages(Class<R> type, E entity)
entity in the entities of the given
type.R - type of entity to searchtype - the type of entity to searchentity - the entity on which search is doneMap<Class<? extends TopiaEntity>,List<? extends TopiaEntity>> findAllUsages(E entity)
entity.entity - the entityList<TopiaEntity> getComposite(E entity)
entity - the entity on which search is doneList<TopiaEntity> getAggregate(E entity)
entity - the entity on which search is doneCopyright © 2004–2014 CodeLutin. All rights reserved.