E
- the entity type managed by the daopublic interface TopiaDAO<E extends TopiaEntity> extends TopiaDAODeprecated<E>, 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... params)
Execute the count
hql query and then synch the pager to this
result (says fill the
PagerBean.getRecords() 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... params)
Count the number of entities based on a
hql . |
E |
create(E e)
Permet de sauver un object instancié sans le DAO.
|
E |
create(Map<String,Object> properties)
Construit une nouvelle instance de l'objet géré par ce DAO
|
E |
create(Object... properties)
Construit une nouvelle instance de l'objet géré par ce DAO
|
String |
createSimpleQuery(String alias)
Create the simple hql query for the entity managed by the dao.
|
void |
delete(E e)
Permet de supprimer une entite.
|
void |
deleteAll(Iterable<E> entities)
Permet de supprimer des entités.
|
boolean |
existByProperties(String propertyName,
Object propertyValue,
Object... others)
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... params)
Check the existence of an entity using a
hql query. |
List<E> |
findAll()
Gets all entitys of the dao type in db.
|
List<E> |
findAllByProperties(Map<String,Object> properties)
Gets all entities of the dao type matching all the
properties . |
List<E> |
findAllByProperties(String propertyName,
Object value,
Object... others)
Gets all entities of the dao type matching the
value for the
given propertyName and others . |
List<E> |
findAllByProperty(String propertyName,
Object value)
Gets all entities of the dao type matching the
value for the
given propertyName . |
<R> List<R> |
findAllByQuery(Class<R> type,
String hql,
Object... params)
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... params)
Gets all entities when executing the given select query for the dao
entity type.
|
<R> List<R> |
findAllByQueryAndPager(Class<R> type,
String hql,
TopiaPagerBean pager,
Object... params)
Gets a page of entities 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... params)
Gets a page of entities 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... params)
Gets a page of entities 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... params)
Gets a page of entities 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 property)
Récupère toutes les entités (du type géré par ce dao) dont la
collection nommée
propertyName contient la property
donnée. |
List<String> |
findAllIds()
Recuperation de tous les ids en base pour le type d'entite du dao.
|
<R> Iterable<R> |
findAllLazyByQuery(Class<R> type,
int batchSize,
String hql,
Object... params)
Gets all entities 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... params)
Gets all entities 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... params)
Gets all entities in lazy mode when executing the given select query
for the dao entity type.
|
Iterable<E> |
findAllLazyByQuery(String hql,
Object... params)
Gets all entities 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)
Gets all entites for the dao entity type order by given
propertyNames . |
E |
findByPrimaryKey(Map<String,Object> keys)
Recherche la classe en utilisant la cle naturelle, chaque champs de la
cle naturelle est une entre de la map passe en argument.
|
E |
findByPrimaryKey(Object... k)
Recherche la classe en utilisant la cle naturelle, si la cle naturelle
est composé de plusieurs champs alors les arguments passés doivent être
dans l'ordre de declaration dans le fichier de mapping
|
E |
findByProperties(Map<String,Object> properties)
Find an entity matching
properties . |
E |
findByProperties(String propertyName,
Object value,
Object... others) |
E |
findByProperty(String propertyName,
Object value)
Find an entity matching
value for the given propertyName . |
<R> R |
findByQuery(Class<R> type,
String hql,
Object... params)
Execute une requête basé sur le
type donné. |
E |
findByQuery(String hql,
Object... params)
Execute une requête basé sur l'entité du DAO.
|
E |
findByTopiaId(String id)
Find an entity corresponding to the
id . |
E |
findContains(String propertyName,
Object property)
Récupère la première entité (du type géré par ce dao) dont la
collection nommée
propertyName contient la property
donnée. |
<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()
Return context used by this DAO.
|
Class<E> |
getEntityClass()
Get the type of entity managed by this DAO.
|
TopiaEntityEnum |
getTopiaEntityEnum()
Get the entityEnum of the type of entity managed by this DAO.
|
void |
init(TopiaContextImplementor context,
Class<E> entityClass)
When TopiaContextImpl create the TopiaDAOHibernate, it must call this
method just after.
|
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)
Permet d'ajouter ou de mettre a jour un objet.
|
countByQuery, createQuery, createQuery, existByQuery, findAllByQuery, findAllMappedByQuery, findAllMappedByQuery, findByQuery, getRequestPermission
forEach, iterator, spliterator
E newInstance() throws TopiaException
TopiaException
- if any pb while creating the entityE create(Object... properties) throws TopiaException
properties
- la liste des propriétés que doit avoir l'objet créé les
arguments vont par paire (propertyName, value)TopiaException
- si un problème est rencontré durant
l'instanciationIllegalArgumentException
- Si le nombre on le type des arguments
n'est pas bon ou que le type ou le nom
d'une propriété est fausseE create(Map<String,Object> properties) throws TopiaException
properties
- la liste des propriétés que doit avoir l'objet crééTopiaException
- si un problème est rencontré durant
l'instanciationIllegalArgumentException
- Si le nombre on le type des arguments
n'est pas bon ou que le type ou le nom
d'une propriété est fausseE create(E e) throws TopiaException
create(Object...)
serait trop couteux.e
- l'entité instanciée à sauverTopiaException
- if any pb while creating datasE update(E e) throws TopiaException
e
- l'entite a ajouter ou mettre a jourTopiaException
- if any pb while updating datasvoid delete(E e) throws TopiaException
e
- l'entite a supprimerTopiaException
- if any pb 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 mathTopiaException
E findByProperties(String propertyName, Object value, Object... others) throws TopiaException
propertyName
- le nom de la propriétévalue
- la valeur à testerothers
- les autres proprietes doivent aller par 2
propertyName, valueTopiaException
- if any pb while getting datasE findByProperties(Map<String,Object> properties) throws TopiaException
properties
.properties
- les propriétés à matcherTopiaException
- if any pb while getting datasE findByQuery(String hql, Object... params) throws TopiaException
hql
- la requête hql à executerparams
- les paramètres de la requèteTopiaException
- if any pb while getting datas<R> R findByQuery(Class<R> type, String hql, Object... params) throws TopiaException
type
donné.
Permet de récupérer une entité correspondant à la requête.hql
- la requête hql à executerparams
- les paramètres de la requèteTopiaException
- if any pb while getting datasE findByPrimaryKey(Map<String,Object> keys) throws TopiaException
keys
- la liste des champs de la cle naturelle avec leur valeurTopiaException
- if any pb while getting datasE findByPrimaryKey(Object... k) throws TopiaException
k
- l'objet cle naturelle de la classeTopiaException
- if any pb while getting datasE findContains(String propertyName, Object property) throws TopiaException
propertyName
contient la property
donnée.propertyName
- le nom de la propriétéproperty
- la propriété recherchéeTopiaException
- pour tout erreur lors de la rechercheList<E> findAll() throws TopiaException
TopiaException
List<String> findAllIds() throws TopiaException
TopiaException
- si pb en baseList<E> findAllByProperty(String propertyName, Object value) throws TopiaException
value
for the
given propertyName
.propertyName
- property name to filtervalue
- value to matchTopiaException
- if any pb while getting datasList<E> findAllByProperties(String propertyName, Object value, Object... others) throws TopiaException
value
for the
given propertyName
and others
.propertyName
- le nom de la propriétévalue
- la valeur à testerothers
- les autres proprietes doivent aller par 2
propertyName, valueTopiaException
- if any pb while getting datasList<E> findAllByProperties(Map<String,Object> properties) throws TopiaException
properties
.properties
- properties to matchTopiaException
- if any pb while getting datasList<E> findAllByQuery(String hql, Object... params) throws TopiaException
hql
- hql queryparams
- query paramsTopiaException
- if any pb while getting datas<R> List<R> findAllByQuery(Class<R> type, String hql, Object... params) throws TopiaException
type
which may not be a entity type (int, long, map,...).hql
- hql queryparams
- query paramsTopiaException
- if any pb while getting datasIterable<E> findAllLazyByQuery(String hql, Object... params) throws TopiaException
hql
- hql queryparams
- query paramsTopiaException
- if any pb while getting datas<R> Iterable<R> findAllLazyByQuery(Class<R> type, String hql, Object... params) throws TopiaException
type
which may not be a entity type (int, long, map,...).
Important note:type
- type of data to returnhql
- hql queryparams
- query paramsTopiaException
- if any pb while getting datasIterable<E> findAllLazyByQuery(int batchSize, String hql, Object... params) throws TopiaException
batchSize
- batch sizehql
- hql queryparams
- query paramsTopiaException
- if any pb while getting datas<R> Iterable<R> findAllLazyByQuery(Class<R> type, int batchSize, String hql, Object... params) throws TopiaException
type
which may not be a entity type (int, long, map,...).
Important note:type
- type of data to returnbatchSize
- batch sizehql
- hql queryparams
- query paramsTopiaException
- if any pb while getting datas<R> List<R> findAllByQueryWithBound(Class<R> type, String hql, int startIndex, int endIndex, Object... params) throws TopiaException
startIndex -
endIndex
entities).hql
- hql query to executestartIndex
- first index of entity to returnendIndex
- last index of entity to returnparams
- query paramsTopiaException
- if any pb while getting datasList<E> findAllByQueryWithBound(String hql, int startIndex, int endIndex, Object... params) throws TopiaException
startIndex -
endIndex
entities).hql
- hql query to executestartIndex
- first index of entity to returnendIndex
- last index of entity to returnparams
- query paramsTopiaException
- if any pb while getting datas<R> List<R> findAllByQueryAndPager(Class<R> type, String hql, TopiaPagerBean pager, Object... params) throws TopiaException
hql
query using the
pager
to obtain the window of entities to return.type
- type of data to returnhql
- hql query to executepager
- pager to obtan the correct window of dataparams
- params of the queryTopiaException
- if any pb while getting datasTopiaPagerBean
List<E> findAllByQueryAndPager(String hql, TopiaPagerBean pager, Object... params) throws TopiaException
hql
query using the
pager
to obtain the window of entities to return.hql
- hql query to executepager
- pager to obtan the correct window of dataparams
- params of the queryTopiaException
- if any pb while getting datasTopiaPagerBean
List<E> findAllWithOrder(String... propertyNames) throws TopiaException
propertyNames
.
You can add on each property
ASC
ou DESC
to
fix order way (by default is ASC
).propertyNames
- property names of order to applyTopiaException
- if any pb while getting datasList<E> findAllContains(String propertyName, Object property) throws TopiaException
propertyName
contient la property
donnée.propertyName
- le nom de la propriétéproperty
- la propriété recherchéeTopiaException
- pour tout erreur lors de la rechercheboolean existByTopiaId(String id) throws TopiaException
id
.id
- unique id of the entity to test existence.TopiaException
- for Topia errorsboolean existByProperties(String propertyName, Object propertyValue, Object... others) throws TopiaException
propertyName
with propertyValue
. others
properties can be added to test
existence.propertyName
- first property name to test existencepropertyValue
- first property value to test existenceothers
- altern propertyName and propertyValueTopiaException
- for Topia errorsboolean existsByQuery(String hql, Object... params) throws TopiaException
hql
query.hql
- query used to test existenceparams
- params used by the queryTopiaException
long count() throws TopiaException
TopiaException
- if any pb while getting dataslong countByQuery(String hql, Object... params) throws TopiaException
hql
.hql
- hql query to useTopiaException
- 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... params) throws TopiaException
hql
query and then synch the pager to this
result (says fill the
PagerBean.getRecords()
field and then adapt
the number of pages available and the current number page).hql
- the count hql to executepager
- the page to synchparams
- params of the count queryTopiaException
- if any pb while getting datasTopiaPagerBean
TopiaEntityEnum getTopiaEntityEnum()
Class<E> getEntityClass()
int getBatchSize()
void setBatchSize(int batchSize)
batchSize
- new batch size to use when iterating.void init(TopiaContextImplementor context, Class<E> entityClass) throws TopiaException
context
- contextentityClass
- entity classTopiaException
- if any pb while initTopiaContextImplementor getContext()
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)
Copyright © 2004–2022 Code Lutin. All rights reserved.