|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.nuiton.topia.persistence.TopiaDAOImpl<E>
E - le type de l'entitepublic class TopiaDAOImpl<E extends TopiaEntity>
Cette classe permet d'avoir un ensemble de méthode implantée de façon standard et plus spécifiquement pour Hibernate.
Certains accès à Hibernate sont tout de même fait ici, car on a pris le choix de se baser entièrement sur hibernate pour la persistence, et il est ainsi possible d'accèder au meta information hibernate sur les classes lorque l'on en a besoin.
| Field Summary | |
|---|---|
protected TopiaContextImplementor |
context
|
protected Class<E> |
entityClass
|
| Constructor Summary | |
|---|---|
TopiaDAOImpl()
|
|
| Method Summary | ||
|---|---|---|
void |
addTopiaEntityListener(TopiaEntityListener listener)
|
|
void |
addTopiaEntityVetoable(TopiaEntityVetoable vetoable)
|
|
long |
count()
Count the number of existing entities. |
|
int |
countByQuery(TopiaQuery query)
Count the number of entities based on query. |
|
E |
create(E entity)
Permet de sauver un object instancié sans le DAO. |
|
E |
create(Map<String,Object> properties)
Cette methode appelle fireVetoableCreate et fireOnCreated Si vous la surchargé, faites attention a appeler le super ou a appeler vous aussi ces deux methodes. |
|
E |
create(Object... properties)
Construit une nouvelle instance de l'objet géré par ce DAO |
|
TopiaQuery |
createQuery()
Crée une requete basé sur l'entité lié au DAO. |
|
TopiaQuery |
createQuery(String entityAlias)
Crée une requête basé sur l'entité lié au DAO et lui assigne un alias valable dans la requête.. |
|
void |
delete(E e)
Permet de supprimer une entite. |
|
boolean |
existByProperties(String propertyName,
Object propertyValue,
Object... others)
Check the existence of an entity with propertyName with propertyValue. |
|
boolean |
existByQuery(TopiaQuery query)
Check the existence of an entity using a query. |
|
boolean |
existByTopiaId(String id)
Check the existence of an entity with technical id. |
|
List<E> |
findAll()
|
|
List<E> |
findAllByProperties(Map<String,Object> properties)
|
|
List<E> |
findAllByProperties(String propertyName,
Object value,
Object... others)
|
|
List<E> |
findAllByProperty(String propertyName,
Object value)
|
|
List<E> |
findAllByQuery(TopiaQuery query)
Execute une requête basé sur l'entité du DAO. |
|
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. |
|
Map<String,E> |
findAllMappedByQuery(TopiaQuery query)
Execute une requête basé sur l'entité du DAO. |
|
|
findAllMappedByQuery(TopiaQuery query,
String keyName,
Class<K> keyClass)
Execute une requête basé sur l'entité du DAO. |
|
Map<Class<? extends TopiaEntity>,List<? extends TopiaEntity>> |
findAllUsages(E e)
Find all usages of the given entity. |
|
List<E> |
findAllWithOrder(String... 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)
|
|
E |
findByProperties(String propertyName,
Object value,
Object... others)
|
|
E |
findByProperty(String propertyName,
Object value)
|
|
E |
findByQuery(TopiaQuery query)
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. |
|
|
findUsages(Class<U> type,
E e)
Find usages of the given entity in the entities of the given
type. |
|
TopiaContextImplementor |
getContext()
Return context used by this DAO. |
|
Class<E> |
getEntityClass()
Return class of entity managed by this DAO. |
|
protected Serializable |
getId(E e)
Retourne l'id de l'entity |
|
protected Serializable |
getId(Map map)
Retourne l'id de l'entity representer comme une map |
|
List<Permission> |
getRequestPermission(String topiaId,
int actions)
Retourne les permissions a verifier pour l'acces a l'entite pour le service Taas. |
|
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. |
|
void |
removeTopiaEntityListener(TopiaEntityListener listener)
|
|
void |
removeTopiaEntityVetoable(TopiaEntityVetoable vetoable)
|
|
E |
update(E e)
Permet d'ajouter ou de mettre a jour un objet. |
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected Class<E extends TopiaEntity> entityClass
protected TopiaContextImplementor context
| Constructor Detail |
|---|
public TopiaDAOImpl()
| Method Detail |
|---|
public Class<E> getEntityClass()
TopiaDAO
getEntityClass in interface TopiaDAO<E extends TopiaEntity>
protected Serializable getId(E e)
throws TopiaException
e - l'entity
TopiaException - Si une erreur survient durant la recherche
protected Serializable getId(Map map)
throws TopiaException
map - l'entity en representation map
TopiaException - Si une erreur survient durant la recherche
public void init(TopiaContextImplementor context,
Class<E> entityClass)
throws TopiaException
init in interface TopiaDAO<E extends TopiaEntity>entityClass - context - context
TopiaException - if any pb while initpublic TopiaContextImplementor getContext()
TopiaDAO
getContext in interface TopiaDAO<E extends TopiaEntity>
public E newInstance()
throws TopiaException
TopiaDAO
newInstance in interface TopiaDAO<E extends TopiaEntity>TopiaException - if any pb while creating the entity
public <U extends TopiaEntity> List<U> findUsages(Class<U> type,
E e)
throws TopiaException
TopiaDAOentity in the entities of the given
type.
findUsages in interface TopiaDAO<E extends TopiaEntity>U - tthe type of entity to searchtype - the type of entity to searche - the entity
TopiaException - if any problem while getting data
public Map<Class<? extends TopiaEntity>,List<? extends TopiaEntity>> findAllUsages(E e)
throws TopiaException
TopiaDAOentity.
findAllUsages in interface TopiaDAO<E extends TopiaEntity>e - the entity
TopiaException - if any pb while getting data
public List<Permission> getRequestPermission(String topiaId,
int actions)
throws TopiaException
TopiaDAO
getRequestPermission in interface TopiaDAO<E extends TopiaEntity>topiaId - topiaId d'une entiteactions - encoded actions
TopiaException - if any pb while getting dataspublic 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)
throws TopiaException
TopiaDAOTopiaDAO.create(Object...)
serait trop couteux.
create in interface TopiaDAO<E extends TopiaEntity>entity - l'entité instanciée à sauver
TopiaException - if any pb while creating datas
public E create(Object... properties)
throws TopiaException
TopiaDAO
create in interface TopiaDAO<E extends TopiaEntity>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'instanciation
public E create(Map<String,Object> properties)
throws TopiaException
create in interface TopiaDAO<E extends TopiaEntity>properties - la liste des propriétés que doit avoir l'objet créé
TopiaException - si un problème est rencontré durant
l'instanciation
public E update(E e)
throws TopiaException
TopiaDAO
update in interface TopiaDAO<E extends TopiaEntity>e - l'entite a ajouter ou mettre a jour
TopiaException - if any pb while updating datas
public void delete(E e)
throws TopiaException
TopiaDAO
delete in interface TopiaDAO<E extends TopiaEntity>e - l'entite a supprimer
TopiaException - if any pb while deleting dataspublic TopiaQuery createQuery()
TopiaDAO
createQuery in interface TopiaDAO<E extends TopiaEntity>public TopiaQuery createQuery(String entityAlias)
TopiaDAO
createQuery in interface TopiaDAO<E extends TopiaEntity>entityAlias - alias permettant de manipuler l'entité dans la
requête
public E findByTopiaId(String id)
throws TopiaException
TopiaDAOid. If the id is
null, nothing will be search.
findByTopiaId in interface TopiaDAO<E extends TopiaEntity>id - topiaId of the entity to found
TopiaException - for Topia errors on query
public E findByProperty(String propertyName,
Object value)
throws TopiaException
findByProperty in interface TopiaDAO<E extends TopiaEntity>TopiaException
public E findByProperties(String propertyName,
Object value,
Object... others)
throws TopiaException
findByProperties in interface TopiaDAO<E extends TopiaEntity>propertyName - le nom de la propriétévalue - la valeur à testerothers - les autres proprietes doivent aller par 2
propertyName, value
TopiaException - if any pb while getting datas
public E findByProperties(Map<String,Object> properties)
throws TopiaException
findByProperties in interface TopiaDAO<E extends TopiaEntity>TopiaException
public E findByQuery(TopiaQuery query)
throws TopiaException
TopiaDAO
findByQuery in interface TopiaDAO<E extends TopiaEntity>query - la requête
TopiaException - if any pb while getting datasTopiaQuery.executeToEntity(TopiaContext, Class)
public List<E> findAll()
throws TopiaException
findAll in interface TopiaDAO<E extends TopiaEntity>TopiaException
public List<String> findAllIds()
throws TopiaException
TopiaDAO
findAllIds in interface TopiaDAO<E extends TopiaEntity>TopiaException - si pb en base
public List<E> findAllByProperty(String propertyName,
Object value)
throws TopiaException
findAllByProperty in interface TopiaDAO<E extends TopiaEntity>TopiaException
public List<E> findAllByProperties(String propertyName,
Object value,
Object... others)
throws TopiaException
findAllByProperties in interface TopiaDAO<E extends TopiaEntity>propertyName - le nom de la propriétévalue - la valeur à testerothers - les autres proprietes doivent aller par 2
propertyName, value
TopiaException - if any pb while getting datas
public List<E> findAllByProperties(Map<String,Object> properties)
throws TopiaException
findAllByProperties in interface TopiaDAO<E extends TopiaEntity>TopiaException
public List<E> findAllByQuery(TopiaQuery query)
throws TopiaException
TopiaDAO
findAllByQuery in interface TopiaDAO<E extends TopiaEntity>query - la requête
TopiaException - if any pb while getting datasTopiaQuery.executeToEntityList(TopiaContext, Class)
public Map<String,E> findAllMappedByQuery(TopiaQuery query)
throws TopiaException
TopiaDAO
findAllMappedByQuery in interface TopiaDAO<E extends TopiaEntity>query - la requête
TopiaException - if any pb while getting datasTopiaQuery.executeToEntityMap(TopiaContext, Class)
public <K> Map<K,E> findAllMappedByQuery(TopiaQuery query,
String keyName,
Class<K> keyClass)
throws TopiaException
TopiaDAO
findAllMappedByQuery in interface TopiaDAO<E extends TopiaEntity>K - type de la clé de la mapquery - la requêtekeyName - nom de la propriété de l'entité utilisée comme clékeyClass - type de la propriété de l'entité utilisée comme clé
TopiaException - if any pb while getting datasTopiaQuery.executeToEntityMap(TopiaContext, Class)
public List<E> findAllWithOrder(String... propertyNames)
throws TopiaException
findAllWithOrder in interface TopiaDAO<E extends TopiaEntity>TopiaException
public E findContains(String propertyName,
Object property)
throws TopiaException
TopiaDAOpropertyName contient la property
donnée.
findContains in interface TopiaDAO<E extends TopiaEntity>propertyName - le nom de la propriétéproperty - la propriété recherchée
TopiaException - pour tout erreur lors de la recherche
public List<E> findAllContains(String propertyName,
Object property)
throws TopiaException
TopiaDAOpropertyName contient la property
donnée.
findAllContains in interface TopiaDAO<E extends TopiaEntity>propertyName - le nom de la propriétéproperty - la propriété recherchée
TopiaException - pour tout erreur lors de la recherche
public boolean existByTopiaId(String id)
throws TopiaException
TopiaDAOid.
existByTopiaId in interface TopiaDAO<E extends TopiaEntity>id - unique id of the entity to test existence.
TopiaException - for Topia errors
public boolean existByProperties(String propertyName,
Object propertyValue,
Object... others)
throws TopiaException
TopiaDAOpropertyName with propertyValue. others properties can be added to test
existence.
existByProperties in interface TopiaDAO<E extends TopiaEntity>propertyName - first property name to test existencepropertyValue - first property value to test existenceothers - altern propertyName and propertyValue
TopiaException - for Topia errors
public boolean existByQuery(TopiaQuery query)
throws TopiaException
TopiaDAOquery.
existByQuery in interface TopiaDAO<E extends TopiaEntity>query - query used to test existence
TopiaException
public long count()
throws TopiaException
TopiaDAO
count in interface TopiaDAO<E extends TopiaEntity>TopiaException - if any pb while getting datas
public int countByQuery(TopiaQuery query)
throws TopiaException
TopiaDAOquery.
countByQuery in interface TopiaDAO<E extends TopiaEntity>query - query
TopiaException - if any pb while getting datas
public E findByPrimaryKey(Map<String,Object> keys)
throws TopiaException
TopiaDAO
findByPrimaryKey in interface TopiaDAO<E extends TopiaEntity>keys - la liste des champs de la cle naturelle avec leur valeur
TopiaException - if any pb while getting datas
public E findByPrimaryKey(Object... k)
throws TopiaException
TopiaDAO
findByPrimaryKey in interface TopiaDAO<E extends TopiaEntity>k - l'objet cle naturelle de la classe
TopiaException - if any pb while getting datas
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||