E - the entity type managed by the daopublic interface TopiaDAO<E extends TopiaEntity> extends Iterable<E>
E type :
create, delete, update or find entities.
This interface is implemented by TopiaDAOImpl overridden by generation
from EntityDAOTransformer.
| Modifier and Type | Method and Description |
|---|---|
void |
addTopiaEntityListener(TopiaEntityListener listener) |
void |
addTopiaEntityVetoable(TopiaEntityVetoable vetoable) |
void |
computeAndAddRecordsToPager(String hql,
TopiaPagerBean pager,
Object... propertyNamesAndValues)
Execute the count
hql query and then synch the pager to this
result (says fill the
PagerBean.records field and then adapt
the number of pages available and the current number page). |
long |
count()
Count the number of existing entities.
|
long |
countByQuery(String hql,
Object... propertyNamesAndValues)
Count the number of entities based on a the given HQL query.
|
E |
create(E e)
Creates an entity not created without the DAO.
|
E |
create(Map<String,Object> properties)
Creates a new instance of the entity managed by the DAO
|
E |
create(Object... propertyNamesAndValues)
Creates a new instance of the entity managed by the DAO
|
String |
createSimpleQuery(String alias)
Create the simple HQL query for the entity managed by the dao.
|
void |
delete(E e)
Removes the given entity from the storage
|
void |
deleteAll(Iterable<E> entities)
Permet de supprimer des entités.
|
boolean |
existByProperties(String propertyName,
Object propertyValue,
Object... propertyNamesAndValues)
Check the existence of an entity with
propertyName with propertyValue. |
boolean |
existByTopiaId(String id)
Check the existence of an entity with technical
id. |
boolean |
existsByQuery(String hql,
Object... propertyNamesAndValues)
Check the existence of an entity using the given HQL query.
|
List<E> |
findAll()
Finds all the entities managed by this DAO.
|
List<E> |
findAllByProperties(Map<String,Object> properties)
Finds all entities E matching all the
properties values. |
List<E> |
findAllByProperties(String propertyName,
Object value,
Object... propertyNamesAndValues)
Finds all entities E matching the given
propertyName, value
AND all other properties |
List<E> |
findAllByProperty(String propertyName,
Object value)
Finds all entities E which value for the given
propertyName is
value |
<R> List<R> |
findAllByQuery(Class<R> type,
String hql,
Object... propertyNamesAndValues)
Gets all entities when executing the given select query for the given
type which may not be a entity type (int, long, map,...). |
List<E> |
findAllByQuery(String hql,
Object... propertyNamesAndValues)
Finds all entities E when executing the given HQL query.
|
<R> List<R> |
findAllByQueryAndPager(Class<R> type,
String hql,
TopiaPagerBean pager,
Object... propertyNamesAndValues)
Finds a page of entities R of the given select
hql query using the
pager to obtain the window of entities to return. |
List<E> |
findAllByQueryAndPager(String hql,
TopiaPagerBean pager,
Object... propertyNamesAndValues)
Gets a page of entities E of the given select
hql query using the
pager to obtain the window of entities to return. |
<R> List<R> |
findAllByQueryWithBound(Class<R> type,
String hql,
int startIndex,
int endIndex,
Object... propertyNamesAndValues)
Finds a page of entities R when executing the given select query for the dao
entity type (will only return the window of
startIndex -
endIndex entities). |
List<E> |
findAllByQueryWithBound(String hql,
int startIndex,
int endIndex,
Object... propertyNamesAndValues)
Finds a page of entities E when executing the given select query for the dao
entity type (will only return the window of
startIndex -
endIndex entities). |
List<E> |
findAllContains(String propertyName,
Object value)
Find all the entities E which given collection (propertyName) contains the
given value
|
List<String> |
findAllIds()
Find all the ids for the E entity type
|
<R> Iterable<R> |
findAllLazyByQuery(Class<R> type,
int batchSize,
String hql,
Object... propertyNamesAndValues)
Finds all entities R in lazy mode when executing the given select query
for the given
type which may not be a entity type (int, long, map,...). |
<R> Iterable<R> |
findAllLazyByQuery(Class<R> type,
String hql,
Object... propertyNamesAndValues)
Finds all entities R in lazy mode when executing the given select query
for the given
type which may not be a entity type (int, long, map,...). |
Iterable<E> |
findAllLazyByQuery(int batchSize,
String hql,
Object... propertyNamesAndValues)
Finds all entities E in lazy mode when executing the given select query
for the dao entity type.
|
Iterable<E> |
findAllLazyByQuery(String hql,
Object... propertyNamesAndValues)
Finds all entities E in lazy mode when executing the given select query
for the dao entity type.
|
Map<Class<? extends TopiaEntity>,List<? extends TopiaEntity>> |
findAllUsages(E entity)
Find all usages of the given
entity. |
List<E> |
findAllWithOrder(String... propertyNames)
Finds all entites E managed by this DAO.
|
E |
findByPrimaryKey(Map<String,Object> keys)
Find an entity using the natural ids.
|
E |
findByPrimaryKey(Object... propertyNamesAndValues)
Find an entity using the natural ids.
|
E |
findByProperties(Map<String,Object> properties)
Find an entity matching
properties. |
E |
findByProperties(String propertyName,
Object value,
Object... propertyNamesAndValues)
Find an entity matching a succession of propertyName + value arguments.
|
E |
findByProperty(String propertyName,
Object value)
Find an entity matching
value for the given propertyName. |
<R> R |
findByQuery(Class<R> type,
String hql,
Object... propertyNamesAndValues)
Executes and returns the result (entity R) of the given HQL query string.
|
E |
findByQuery(String hql,
Object... propertyNamesAndValues)
Executes and returns the result (entity E) of the given HQL query string.
|
E |
findByTopiaId(String id)
Find an entity corresponding to the
id. |
E |
findContains(String propertyName,
Object value)
Find the first entity which given collection (propertyName) contains the
given value
|
<R extends TopiaEntity> |
findUsages(Class<R> type,
E entity)
Find usages of the given
entity in the entities of the given
type. |
int |
getBatchSize()
Obtains the batch size used to load data.
|
TopiaContextImplementor |
getContext()
Returns the context used by this DAO.
|
Class<E> |
getEntityClass()
Return the class of the entity managed by this DAO.
|
List<Permission> |
getRequestPermission(String topiaId,
int actions)
Deprecated.
TopiaQuery will be removed in version 3.0 |
TopiaEntityEnum |
getTopiaEntityEnum()
Get the entityEnum of the type of entity managed by this DAO.
|
void |
init(TopiaContextImplementor context,
Class<E> entityClass)
Method to invoke right after instance creation.
|
E |
newInstance()
Create a new instance of managed entity not persisted.
|
void |
removeTopiaEntityListener(TopiaEntityListener listener) |
void |
removeTopiaEntityVetoable(TopiaEntityVetoable vetoable) |
void |
setBatchSize(int batchSize)
Set a new default batch size.
|
E |
update(E e)
Update an entity.
|
E newInstance() throws TopiaException
TopiaException - if any pb while creating the entityE create(Object... propertyNamesAndValues) throws TopiaException
propertyNamesAndValues - the list of properties that the created entity will have. Arguments are key-value
paired : [propertyName;value;propertyName;value;...]TopiaException - if any problem during instantiationIllegalArgumentException - if the arguments count is not correct or
if some property type is not the
expected onecreate(Map)E create(Map<String,Object> properties) throws TopiaException
properties - the key-value list of properties that the created entity will have.TopiaException - if any problem during instantiationIllegalArgumentException - if some property type is not the
expected oneE create(E e) throws TopiaException
create(Object...)
would be to onerous.e - the instance to persistTopiaException - if any problem while creating dataE update(E e) throws TopiaException
e - the entity to create or updateTopiaException - if any problem while updating datasvoid delete(E e) throws TopiaException
e - the entity to removeTopiaException - if any problem while deleting datasvoid deleteAll(Iterable<E> entities) throws TopiaException
entities - les entités à supprimerTopiaException - if any pb while deleting datasE findByTopiaId(String id) throws TopiaException
id. If the id is
null, nothing will be searched.id - topiaId of the entity to foundTopiaException - for Topia errors on queryE findByProperty(String propertyName, Object value) throws TopiaException
value for the given propertyName.propertyName - property name to filtervalue - value of the property to matchTopiaException - if any pb while getting datasE findByProperties(String propertyName, Object value, Object... propertyNamesAndValues) throws TopiaException
propertyName - the first property name to filtervalue - the first value of the property to matchpropertyNamesAndValues - other property names and values. Arguments are key-value paired :
[propertyName;value;propertyName;value;...]TopiaException - if any pb while getting datasE findByProperties(Map<String,Object> properties) throws TopiaException
properties.properties - the properties key + value to matchTopiaException - if any pb while getting datasE findByQuery(String hql, Object... propertyNamesAndValues) throws TopiaException
hql - the HQL querypropertyNamesAndValues - the query parameters. Arguments are key-value paired :
[propertyName;value;propertyName;value;...]TopiaException - if any pb while getting datas<R> R findByQuery(Class<R> type, String hql, Object... propertyNamesAndValues) throws TopiaException
type - the expected result typehql - the HQL querypropertyNamesAndValues - the query parameters. Arguments are key-value paired :
[propertyName;value;propertyName;value;...]TopiaException - if any pb while getting datasClassCastException - if the found type is not the expected oneE findByPrimaryKey(Map<String,Object> keys) throws TopiaException
keys - Map with the natural id property name as Map.key, and value as Map.valueTopiaException - if any pb while getting datasE findByPrimaryKey(Object... propertyNamesAndValues) throws TopiaException
propertyNamesAndValues - the query parameters. Arguments are key-value paired :
[propertyName;value;propertyName;value;...]TopiaException - if any pb while getting datasE findContains(String propertyName, Object value) throws TopiaException
propertyName - the name of the property (must be a collection)value - the value to use for findTopiaException - if any pb while getting datasList<E> findAll() throws TopiaException
TopiaException - if any pb while getting datasList<E> findAllWithOrder(String... propertyNames) throws TopiaException
propertyNames.
You can add on each property ASC or DESC to force the result order
(by default is ASC).propertyNames - property names of order to applyTopiaException - if any pb while getting datasList<String> findAllIds() throws TopiaException
TopiaException - if any pb while getting datasList<E> findAllByProperty(String propertyName, Object value) throws TopiaException
propertyName is
valuepropertyName - property name to usevalue - value to expectTopiaException - if any pb while getting datasList<E> findAllByProperties(String propertyName, Object value, Object... propertyNamesAndValues) throws TopiaException
propertyName, value
AND all other propertiespropertyName - property name to usevalue - value to expectpropertyNamesAndValues - the query parameters. Arguments are key-value paired :
[propertyName;value;propertyName;value;...]TopiaException - if any pb while getting datasList<E> findAllByProperties(Map<String,Object> properties) throws TopiaException
properties values.properties - properties to matchTopiaException - if any pb while getting datasList<E> findAllByQuery(String hql, Object... propertyNamesAndValues) throws TopiaException
hql - the HQL querypropertyNamesAndValues - the query parameters. Arguments are key-value paired :
[propertyName;value;propertyName;value;...]TopiaException - if any pb while getting datas<R> List<R> findAllByQuery(Class<R> type, String hql, Object... propertyNamesAndValues) throws TopiaException
type which may not be a entity type (int, long, map,...).type - the expected result typehql - the HQL querypropertyNamesAndValues - the query parameters. Arguments are key-value paired :
[propertyName;value;propertyName;value;...]TopiaException - if any pb while getting datasIterable<E> findAllLazyByQuery(String hql, Object... propertyNamesAndValues) throws TopiaException
hql - the HQL querypropertyNamesAndValues - the query parameters. Arguments are key-value paired :
[propertyName;value;propertyName;value;...]TopiaException - if any pb while getting datas<R> Iterable<R> findAllLazyByQuery(Class<R> type, String hql, Object... propertyNamesAndValues) throws TopiaException
type which may not be a entity type (int, long, map,...).
Important note: // TODO AThimel 20/07/13 Write the important note...type - the expected result typehql - the HQL querypropertyNamesAndValues - the query parameters. Arguments are key-value paired :
[propertyName;value;propertyName;value;...]TopiaException - if any pb while getting datasIterable<E> findAllLazyByQuery(int batchSize, String hql, Object... propertyNamesAndValues) throws TopiaException
batchSize - batch sizehql - the HQL querypropertyNamesAndValues - the query parameters. Arguments are key-value paired :
[propertyName;value;propertyName;value;...]TopiaException - if any pb while getting datas<R> Iterable<R> findAllLazyByQuery(Class<R> type, int batchSize, String hql, Object... propertyNamesAndValues) throws TopiaException
type which may not be a entity type (int, long, map,...).
Important note: // TODO AThimel 20/07/13 Write the important note...type - the expected result typebatchSize - batch sizehql - the HQL querypropertyNamesAndValues - the query parameters. Arguments are key-value paired :
[propertyName;value;propertyName;value;...]TopiaException - if any pb while getting datasList<E> findAllByQueryWithBound(String hql, int startIndex, int endIndex, Object... propertyNamesAndValues) throws TopiaException
startIndex -
endIndex entities).
// TODO AThimel 20/07/13 Reformulate(?) the "window thing"hql - the HQL querystartIndex - first index of entity to returnendIndex - last index of entity to returnpropertyNamesAndValues - the query parameters. Arguments are key-value paired :
[propertyName;value;propertyName;value;...]TopiaException - if any pb while getting datas<R> List<R> findAllByQueryWithBound(Class<R> type, String hql, int startIndex, int endIndex, Object... propertyNamesAndValues) throws TopiaException
startIndex -
endIndex entities).
// TODO AThimel 20/07/13 Reformulate(?) the "window thing"type - the expected result typehql - the HQL querystartIndex - first index of entity to returnendIndex - last index of entity to returnpropertyNamesAndValues - the query parameters. Arguments are key-value paired :
[propertyName;value;propertyName;value;...]TopiaException - if any pb while getting datasList<E> findAllByQueryAndPager(String hql, TopiaPagerBean pager, Object... propertyNamesAndValues) throws TopiaException
hql query using the
pager to obtain the window of entities to return.hql - the HQL querypager - pager to obtain the correct window of datapropertyNamesAndValues - the query parameters. Arguments are key-value paired :
[propertyName;value;propertyName;value;...]TopiaException - if any pb while getting datasTopiaPagerBean<R> List<R> findAllByQueryAndPager(Class<R> type, String hql, TopiaPagerBean pager, Object... propertyNamesAndValues) throws TopiaException
hql query using the
pager to obtain the window of entities to return.type - the expected result typehql - the HQL querypager - pager to obtain the correct window of datapropertyNamesAndValues - the query parameters. Arguments are key-value paired :
[propertyName;value;propertyName;value;...]TopiaException - if any pb while getting datasTopiaPagerBeanList<E> findAllContains(String propertyName, Object value) throws TopiaException
propertyName - the name of the property (must be a collection)value - the value to use for findTopiaException - if any pb while getting datasboolean existByTopiaId(String id) throws TopiaException
id.id - unique id of the entity to test existence.TopiaException - for any errorboolean existByProperties(String propertyName, Object propertyValue, Object... propertyNamesAndValues) throws TopiaException
propertyName with propertyValue. others properties can be added to test
existence.propertyName - the first property name to test existencepropertyValue - the first property value to test existencepropertyNamesAndValues - the query parameters. Arguments are key-value paired :
[propertyName;value;propertyName;value;...]TopiaException - for Topia errorsboolean existsByQuery(String hql, Object... propertyNamesAndValues) throws TopiaException
hql - the HQL querypropertyNamesAndValues - the query parameters. Arguments are key-value paired :
[propertyName;value;propertyName;value;...]TopiaExceptionlong count()
throws TopiaException
TopiaException - if any pb while getting dataslong countByQuery(String hql, Object... propertyNamesAndValues) throws TopiaException
hql - the HQL query to usepropertyNamesAndValues - the query parameters. Arguments are key-value paired :
[propertyName;value;propertyName;value;...]TopiaException - if any pb while getting datas<R extends TopiaEntity> List<R> findUsages(Class<R> type, E entity) throws TopiaException
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 doneTopiaException - if any problem while getting dataMap<Class<? extends TopiaEntity>,List<? extends TopiaEntity>> findAllUsages(E entity) throws TopiaException
entity.entity - the entityTopiaException - if any pb while getting datavoid computeAndAddRecordsToPager(String hql, TopiaPagerBean pager, Object... propertyNamesAndValues) throws TopiaException
hql query and then synch the pager to this
result (says fill the
PagerBean.records field and then adapt
the number of pages available and the current number page).hql - the HQL query to usepager - pager to obtain the correct window of datapropertyNamesAndValues - the query parameters. Arguments are key-value paired :
[propertyName;value;propertyName;value;...]TopiaException - if any pb while getting datasTopiaPagerBeanClass<E> getEntityClass()
TopiaContextImplementor getContext()
void init(TopiaContextImplementor context, Class<E> entityClass) throws TopiaException
context - contextentityClass - entity classTopiaException - if any pb while initTopiaEntityEnum getTopiaEntityEnum()
int getBatchSize()
void setBatchSize(int batchSize)
batchSize - new batch size to use when iterating.String createSimpleQuery(String alias)
FROM MyEntityImpl myAlias
alias - optional alias to use in queryvoid addTopiaEntityListener(TopiaEntityListener listener)
void addTopiaEntityVetoable(TopiaEntityVetoable vetoable)
void removeTopiaEntityListener(TopiaEntityListener listener)
void removeTopiaEntityVetoable(TopiaEntityVetoable vetoable)
@Deprecated List<Permission> getRequestPermission(String topiaId, int actions) throws TopiaException
TopiaQuery will be removed in version 3.0topiaId - topiaId d'une entiteactions - encoded actionsTopiaException - if any pb while getting datasCopyright © 2004–2013 CodeLutin. All rights reserved.