E - le type de l'entitepublic abstract class AbstractTopiaDao<E extends TopiaEntity> extends LegacyTopiaDao<E> implements TopiaDao<E>
| Modifier and Type | Class and Description |
|---|---|
static class |
AbstractTopiaDao.FindAllIterator<E extends TopiaEntity,R> |
static class |
AbstractTopiaDao.TopiaQueryBuilderAddCriteriaStep<E extends TopiaEntity> |
static class |
AbstractTopiaDao.TopiaQueryBuilderRunQueryStep<E extends TopiaEntity> |
| Modifier and Type | Field and Description |
|---|---|
protected int |
batchSize
Default batch size used to iterate on data.
|
protected TopiaDaoSupplier |
topiaDaoSupplier |
protected TopiaFiresSupport |
topiaFiresSupport |
protected TopiaHibernateSupport |
topiaHibernateSupport |
protected TopiaIdFactory |
topiaIdFactory |
protected TopiaJpaSupport |
topiaJpaSupport |
protected TopiaListenableSupport |
topiaListenableSupport |
protected TopiaSqlSupport |
topiaSqlSupport |
| Constructor and Description |
|---|
AbstractTopiaDao() |
| Modifier and Type | Method and Description |
|---|---|
void |
addTopiaEntityListener(TopiaEntityListener listener) |
void |
addTopiaEntityVetoable(TopiaEntityVetoable vetoable) |
long |
count()
Count the number of existing entities.
|
protected long |
count(String hql,
Map<String,Object> hqlParameters) |
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
|
protected boolean |
exists(String hql,
Map<String,Object> hqlParameters) |
List<E> |
findAll()
Finds all the entities managed by this DAO.
|
protected List<E> |
findAll(String hql,
Map<String,Object> hqlParameters) |
protected <R> List<R> |
findAll(String hql,
Map<String,Object> hqlParameters,
Class<R> type) |
protected <R> List<R> |
findAll(String hql,
Map<String,Object> hqlParameters,
Class<R> type,
int startIndex,
int endIndex) |
protected <R> List<R> |
findAll(String hql,
Map<String,Object> hqlParameters,
Class<R> type,
TopiaPagerBean pager) |
protected List<E> |
findAll(String hql,
Map<String,Object> hqlParameters,
int startIndex,
int endIndex) |
protected List<E> |
findAll(String hql,
Map<String,Object> hqlParameters,
TopiaPagerBean pager) |
List<String> |
findAllIds()
Find all the ids for the entities managed by this DAO.
|
Iterable<E> |
findAllLazy() |
protected Iterable<E> |
findAllLazy(String hql,
Map<String,Object> hqlParameters) |
protected <R> Iterable<R> |
findAllLazy(String hql,
Map<String,Object> hqlParameters,
Class<R> type) |
protected E |
findAny(String hql,
Map<String,Object> hqlParameters) |
protected <R> R |
findAny(String hql,
Map<String,Object> hqlParameters,
Class<R> type) |
protected E |
findAnyOrNull(String hql,
Map<String,Object> hqlParameters) |
protected <R> R |
findAnyOrNull(String hql,
Map<String,Object> hqlParameters,
Class<R> type) |
E |
findByTopiaId(String id)
Find an entity corresponding to the
id. |
protected E |
findFirst(String hql,
Map<String,Object> hqlParameters) |
protected <R> R |
findFirst(String hql,
Map<String,Object> hqlParameters,
Class<R> type) |
protected E |
findFirstOrNull(String hql,
Map<String,Object> hqlParameters) |
protected <R> R |
findFirstOrNull(String hql,
Map<String,Object> hqlParameters,
Class<R> type) |
protected E |
findUnique(String hql,
Map<String,Object> hqlParameters) |
protected <R> R |
findUnique(String hql,
Map<String,Object> hqlParameters,
Class<R> type) |
protected E |
findUniqueOrNull(String hql,
Map<String,Object> hqlParameters) |
protected <R> R |
findUniqueOrNull(String hql,
Map<String,Object> hqlParameters,
Class<R> type) |
TopiaQueryBuilderAddCriteriaOrRunQueryStep<E> |
forContains(String propertyName,
Object propertyValue) |
TopiaQueryBuilderAddCriteriaOrRunQueryStep<E> |
forEquals(String propertyName,
Object propertyValue) |
protected AbstractTopiaDao.TopiaQueryBuilderRunQueryStep<E> |
forHql(String hql) |
protected AbstractTopiaDao.TopiaQueryBuilderRunQueryStep<E> |
forHql(String hql,
Map<String,Object> hqlParameters) |
protected AbstractTopiaDao.TopiaQueryBuilderRunQueryStep<E> |
forHql(String hql,
String parameterName,
Object parameterValue,
Object... otherParameterNamesAndValues) |
TopiaQueryBuilderAddCriteriaOrRunQueryStep<E> |
forIn(String propertyName,
Iterable<Object> propertyValues) |
AbstractTopiaDao.TopiaQueryBuilderAddCriteriaStep<E> |
forProperties(Map<String,Object> properties) |
AbstractTopiaDao.TopiaQueryBuilderAddCriteriaStep<E> |
forProperties(String propertyName,
Object propertyValue,
Object... otherPropertyNamesAndValues) |
TopiaQueryBuilderAddCriteriaOrRunQueryStep<E> |
forTopiaIdEquals(String topiaId) |
TopiaQueryBuilderAddCriteriaOrRunQueryStep<E> |
forTopiaIdIn(Iterable<String> topiaIds) |
int |
getBatchSize()
Obtains the batch size used to load data.
|
protected org.hibernate.metadata.ClassMetadata |
getClassMetadata()
package locale method because this is hibernate specific method and
we don't want expose it.
|
abstract Class<E> |
getEntityClass()
Return the class of the entity managed by this DAO.
|
protected HqlAndParametersBuilder<E> |
getHqlForNoConstraint() |
protected HqlAndParametersBuilder<E> |
getHqlForProperties(Map<String,Object> properties) |
protected HqlAndParametersBuilder<E> |
getHqlForProperties(String propertyName,
Object propertyValue,
Object... otherPropertyNamesAndValues) |
abstract TopiaEntityEnum |
getTopiaEntityEnum()
Get the entityEnum of the type of entity managed by this DAO.
|
TopiaFiresSupport |
getTopiaFiresSupport() |
void |
init(TopiaHibernateSupport topiaHibernateSupport,
TopiaJpaSupport topiaJpaSupport,
TopiaSqlSupport topiaSqlSupport,
TopiaListenableSupport topiaListenableSupport,
TopiaIdFactory topiaIdFactory,
TopiaFiresSupport topiaFiresSupport,
TopiaDaoSupplier topiaDaoSupplier)
When AbstractTopiaContext create the TopiaDAOHibernate, it must call this
method just after.
|
Iterator<E> |
iterator() |
protected String |
newFromClause(String alias) |
protected HqlAndParametersBuilder<E> |
newHqlAndParametersBuilder() |
E |
newInstance()
Create a new instance of managed entity not persisted.
|
AbstractTopiaDao.TopiaQueryBuilderAddCriteriaStep<E> |
newQueryBuilder() |
void |
removeTopiaEntityListener(TopiaEntityListener listener) |
void |
removeTopiaEntityVetoable(TopiaEntityVetoable vetoable) |
void |
setBatchSize(int batchSize)
Set a new default batch size.
|
protected com.google.common.base.Optional<E> |
tryFindAny(String hql,
Map<String,Object> hqlParameters) |
protected <R> com.google.common.base.Optional<R> |
tryFindAny(String hql,
Map<String,Object> hqlParameters,
Class<R> type) |
com.google.common.base.Optional<E> |
tryFindByTopiaId(String topiaId)
Tries to find the entity with the given topiaId.
|
protected com.google.common.base.Optional<E> |
tryFindFirst(String hql,
Map<String,Object> hqlParameters) |
protected <R> com.google.common.base.Optional<R> |
tryFindFirst(String hql,
Map<String,Object> hqlParameters,
Class<R> type) |
protected com.google.common.base.Optional<E> |
tryFindUnique(String hql,
Map<String,Object> hqlParameters) |
protected <R> com.google.common.base.Optional<R> |
tryFindUnique(String hql,
Map<String,Object> hqlParameters,
Class<R> type) |
E |
update(E entity)
Update an entity.
|
Iterable<E> |
updateAll(Iterable<E> entities) |
computeAndAddRecordsToPager, countByQuery, create, createSimpleQuery, createSimpleQuery, existByProperties, existByTopiaId, existsByQuery, find, findAll, findAllByProperties, findAllByProperties, findAllByProperty, findAllByQuery, findAllByQuery, findAllByQueryAndPager, findAllByQueryAndPager, findAllByQueryWithBound, findAllByQueryWithBound, findAllContains, findAllLazyByQuery, findAllLazyByQuery, findAllLazyByQuery, findAllLazyByQuery, findAllWithOrder, findByPrimaryKey, findByPrimaryKey, findByProperties, findByProperties, findByProperty, findByQuery, findByQuery, findContains, findUnique, getContext, getRequestPermission, getTopiaContextclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitfindAllUsages, findUsagesprotected int batchSize
protected TopiaHibernateSupport topiaHibernateSupport
protected TopiaJpaSupport topiaJpaSupport
protected TopiaSqlSupport topiaSqlSupport
protected TopiaListenableSupport topiaListenableSupport
protected TopiaIdFactory topiaIdFactory
protected TopiaFiresSupport topiaFiresSupport
protected TopiaDaoSupplier topiaDaoSupplier
public abstract TopiaEntityEnum getTopiaEntityEnum()
TopiaDAOgetTopiaEntityEnum in interface TopiaDAO<E extends TopiaEntity>public abstract Class<E> getEntityClass()
TopiaDaogetEntityClass in interface TopiaDao<E extends TopiaEntity>public void init(TopiaHibernateSupport topiaHibernateSupport, TopiaJpaSupport topiaJpaSupport, TopiaSqlSupport topiaSqlSupport, TopiaListenableSupport topiaListenableSupport, TopiaIdFactory topiaIdFactory, TopiaFiresSupport topiaFiresSupport, TopiaDaoSupplier topiaDaoSupplier)
public TopiaFiresSupport getTopiaFiresSupport()
public int getBatchSize()
TopiaDaogetBatchSize in interface TopiaDao<E extends TopiaEntity>public void setBatchSize(int batchSize)
TopiaDaosetBatchSize in interface TopiaDao<E extends TopiaEntity>batchSize - new batch size to use when iterating.protected String newFromClause(String alias)
newFromClause in class LegacyTopiaDao<E extends TopiaEntity>public E newInstance()
TopiaDaonewInstance in interface TopiaDao<E extends TopiaEntity>public void addTopiaEntityListener(TopiaEntityListener listener)
addTopiaEntityListener in interface TopiaDao<E extends TopiaEntity>public void addTopiaEntityVetoable(TopiaEntityVetoable vetoable)
addTopiaEntityVetoable in interface TopiaDao<E extends TopiaEntity>public void removeTopiaEntityListener(TopiaEntityListener listener)
removeTopiaEntityListener in interface TopiaDao<E extends TopiaEntity>public void removeTopiaEntityVetoable(TopiaEntityVetoable vetoable)
removeTopiaEntityVetoable in interface TopiaDao<E extends TopiaEntity>public E create(E entity)
TopiaDaocreate in interface TopiaDao<E extends TopiaEntity>entity - the instance to persistpublic E create(String propertyName, Object propertyValue, Object... otherPropertyNamesAndValues)
create in interface TopiaDao<E extends TopiaEntity>public E create(Map<String,Object> properties)
TopiaDaocreate in interface TopiaDao<E extends TopiaEntity>properties - the key-value list of properties that the created entity will have.public E create()
create in interface TopiaDao<E extends TopiaEntity>public Iterable<E> createAll(Iterable<E> entities)
createAll in interface TopiaDao<E extends TopiaEntity>public E update(E entity)
TopiaDaoupdate in interface TopiaDao<E extends TopiaEntity>entity - the entity to create or updatepublic Iterable<E> updateAll(Iterable<E> entities)
updateAll in interface TopiaDao<E extends TopiaEntity>public void delete(E entity)
TopiaDaodelete in interface TopiaDao<E extends TopiaEntity>entity - the entity to removepublic void deleteAll(Iterable<E> entities)
TopiaDaodeleteAll in interface TopiaDao<E extends TopiaEntity>entities - entities to deleteprotected HqlAndParametersBuilder<E> newHqlAndParametersBuilder()
protected HqlAndParametersBuilder<E> getHqlForProperties(String propertyName, Object propertyValue, Object... otherPropertyNamesAndValues)
protected HqlAndParametersBuilder<E> getHqlForNoConstraint()
protected HqlAndParametersBuilder<E> getHqlForProperties(Map<String,Object> properties)
protected AbstractTopiaDao.TopiaQueryBuilderRunQueryStep<E> forHql(String hql)
protected AbstractTopiaDao.TopiaQueryBuilderRunQueryStep<E> forHql(String hql, Map<String,Object> hqlParameters)
forHql in class LegacyTopiaDao<E extends TopiaEntity>protected AbstractTopiaDao.TopiaQueryBuilderRunQueryStep<E> forHql(String hql, String parameterName, Object parameterValue, Object... otherParameterNamesAndValues)
public AbstractTopiaDao.TopiaQueryBuilderAddCriteriaStep<E> forProperties(Map<String,Object> properties)
forProperties in interface TopiaDao<E extends TopiaEntity>public AbstractTopiaDao.TopiaQueryBuilderAddCriteriaStep<E> forProperties(String propertyName, Object propertyValue, Object... otherPropertyNamesAndValues)
forProperties in interface TopiaDao<E extends TopiaEntity>public AbstractTopiaDao.TopiaQueryBuilderAddCriteriaStep<E> newQueryBuilder()
newQueryBuilder in interface TopiaDao<E extends TopiaEntity>public TopiaQueryBuilderAddCriteriaOrRunQueryStep<E> forContains(String propertyName, Object propertyValue)
forContains in interface TopiaDao<E extends TopiaEntity>public TopiaQueryBuilderAddCriteriaOrRunQueryStep<E> forEquals(String propertyName, Object propertyValue)
forEquals in interface TopiaDao<E extends TopiaEntity>public TopiaQueryBuilderAddCriteriaOrRunQueryStep<E> forIn(String propertyName, Iterable<Object> propertyValues)
forIn in interface TopiaDao<E extends TopiaEntity>protected boolean exists(String hql, Map<String,Object> hqlParameters)
exists in class LegacyTopiaDao<E extends TopiaEntity>protected com.google.common.base.Optional<E> tryFindUnique(String hql, Map<String,Object> hqlParameters)
protected com.google.common.base.Optional<E> tryFindFirst(String hql, Map<String,Object> hqlParameters)
protected com.google.common.base.Optional<E> tryFindAny(String hql, Map<String,Object> hqlParameters)
protected <R> R findUnique(String hql, Map<String,Object> hqlParameters, Class<R> type)
findUnique in class LegacyTopiaDao<E extends TopiaEntity>protected <R> com.google.common.base.Optional<R> tryFindUnique(String hql, Map<String,Object> hqlParameters, Class<R> type)
protected <R> R findUniqueOrNull(String hql, Map<String,Object> hqlParameters, Class<R> type)
protected <R> com.google.common.base.Optional<R> tryFindFirst(String hql, Map<String,Object> hqlParameters, Class<R> type)
protected <R> R findFirstOrNull(String hql, Map<String,Object> hqlParameters, Class<R> type)
protected <R> R findAny(String hql, Map<String,Object> hqlParameters, Class<R> type)
findAny in class LegacyTopiaDao<E extends TopiaEntity>protected <R> com.google.common.base.Optional<R> tryFindAny(String hql, Map<String,Object> hqlParameters, Class<R> type)
protected <R> R findAnyOrNull(String hql, Map<String,Object> hqlParameters, Class<R> type)
findAnyOrNull in class LegacyTopiaDao<E extends TopiaEntity>protected List<E> findAll(String hql, Map<String,Object> hqlParameters, int startIndex, int endIndex)
protected List<E> findAll(String hql, Map<String,Object> hqlParameters, TopiaPagerBean pager)
protected <R> List<R> findAll(String hql, Map<String,Object> hqlParameters, Class<R> type)
findAll in class LegacyTopiaDao<E extends TopiaEntity>protected <R> List<R> findAll(String hql, Map<String,Object> hqlParameters, Class<R> type, int startIndex, int endIndex)
findAll in class LegacyTopiaDao<E extends TopiaEntity>protected <R> List<R> findAll(String hql, Map<String,Object> hqlParameters, Class<R> type, TopiaPagerBean pager)
protected Iterable<E> findAllLazy(String hql, Map<String,Object> hqlParameters)
findAllLazy in class LegacyTopiaDao<E extends TopiaEntity>protected <R> Iterable<R> findAllLazy(String hql, Map<String,Object> hqlParameters, Class<R> type)
findAllLazy in class LegacyTopiaDao<E extends TopiaEntity>public TopiaQueryBuilderAddCriteriaOrRunQueryStep<E> forTopiaIdEquals(String topiaId)
forTopiaIdEquals in interface TopiaDao<E extends TopiaEntity>public TopiaQueryBuilderAddCriteriaOrRunQueryStep<E> forTopiaIdIn(Iterable<String> topiaIds)
forTopiaIdIn in interface TopiaDao<E extends TopiaEntity>public E findByTopiaId(String id)
TopiaDAOid. If the id is
null, nothing will be searched.findByTopiaId in interface TopiaDao<E extends TopiaEntity>findByTopiaId in interface TopiaDAO<E extends TopiaEntity>findByTopiaId in class LegacyTopiaDao<E extends TopiaEntity>id - topiaId of the entity to foundpublic com.google.common.base.Optional<E> tryFindByTopiaId(String topiaId)
TopiaDaofalse.tryFindByTopiaId in interface TopiaDao<E extends TopiaEntity>topiaId - the identifier of the entity to look forpublic List<String> findAllIds()
TopiaDaofindAllIds in interface TopiaDao<E extends TopiaEntity>public List<E> findAll()
TopiaDaofindAll in interface TopiaDao<E extends TopiaEntity>public Iterable<E> findAllLazy()
findAllLazy in interface TopiaDao<E extends TopiaEntity>public Iterator<E> iterator()
iterator in interface Iterable<E extends TopiaEntity>public long count()
TopiaDaocount in interface TopiaDao<E extends TopiaEntity>protected org.hibernate.metadata.ClassMetadata getClassMetadata()
TopiaException - if any pbCopyright © 2004–2013 CodeLutin. All rights reserved.