|
||||||||||
| 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)
|
|
void |
commitTransaction()
Callback method when context was commit. |
|
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 |
|
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> |
findAllContainsProperties(Map<String,Collection> properties)
Find all entities with a specific rule : When the entity have a Collection type property, you want to find all entites where some values are contained in the collection type property. |
|
List<E> |
findAllContainsProperties(String propertyName,
Collection values,
Object... others)
Cherche et renvoie toutes les entités trouvées dont la propriété propertyName contient values, ainsi de suite avec others. |
|
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 k)
|
|
E |
findContainsProperties(Map<String,Collection> properties)
Cherche et renvoie la première entité trouvée dont les propriétés en clé de Map contiennent toutes les valeurs de la Collection. |
|
E |
findContainsProperties(String propertyName,
Collection values,
Object... others)
Cherche et renvoie la première entité trouvée dont la propriété propertyName contient values, ainsi de suite avec others. |
|
|
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)
|
|
void |
rollbackTransaction()
Callback method when context was rollback. |
|
long |
size()
Count number of existing entities using TopiaQuery.executeCount(TopiaContext)
FIXME-FD20091224 change type to int like in 2.2.2 version |
|
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
public void commitTransaction()
throws TopiaException
commitTransaction in interface TopiaDAO<E extends TopiaEntity>TopiaException
public void rollbackTransaction()
throws TopiaException
rollbackTransaction in interface TopiaDAO<E extends TopiaEntity>TopiaException
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 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
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
public E findByProperties(String propertyName,
Object value,
Object... others)
throws TopiaException
findByProperties in interface TopiaDAO<E extends TopiaEntity>others - les autres proprietes doivent aller par 2 propertyName,
value
TopiaException - if any pb while getting datas
public List<E> findAllByProperties(String propertyName,
Object value,
Object... others)
throws TopiaException
findAllByProperties in interface TopiaDAO<E extends TopiaEntity>others - les autres proprietes doivent aller par 2 propertyName,
value
TopiaException - if any pb while getting datas
public E findContainsProperties(Map<String,Collection> properties)
throws TopiaException
TopiaDAO
findContainsProperties in interface TopiaDAO<E extends TopiaEntity>TopiaException - if any pb while getting datas
public E findContainsProperties(String propertyName,
Collection values,
Object... others)
throws TopiaException
TopiaDAO
findContainsProperties in interface TopiaDAO<E extends TopiaEntity>TopiaException - if any pb while getting datas
public List<E> findAllContainsProperties(Map<String,Collection> properties)
throws TopiaException
findAllContainsProperties in interface TopiaDAO<E extends TopiaEntity>properties -
TopiaException - if any pb
public List<E> findAllContainsProperties(String propertyName,
Collection values,
Object... others)
throws TopiaException
TopiaDAO
findAllContainsProperties in interface TopiaDAO<E extends TopiaEntity>propertyName - the name of the property
TopiaException - if any pb while getting datas
public List<E> findAllByProperty(String propertyName,
Object value)
throws TopiaException
findAllByProperty in interface TopiaDAO<E extends TopiaEntity>TopiaException
public E findByProperty(String propertyName,
Object value)
throws TopiaException
findByProperty in interface TopiaDAO<E extends TopiaEntity>TopiaException
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 datapublic 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
TopiaDAO
create in interface TopiaDAO<E extends TopiaEntity>entity - l'entité instanciée à sauver
TopiaException
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>TopiaException
public E findByTopiaId(String k)
throws TopiaException
findByTopiaId in interface TopiaDAO<E extends TopiaEntity>TopiaException
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 basepublic 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 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> 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 long size()
throws TopiaException
TopiaQuery.executeCount(TopiaContext)
FIXME-FD20091224 change type to int like in 2.2.2 version
size in interface TopiaDAO<E extends TopiaEntity>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 List<E> findAllByProperties(Map<String,Object> properties)
throws TopiaException
findAllByProperties in interface TopiaDAO<E extends TopiaEntity>TopiaException
public List<Permission> getRequestPermission(String topiaId,
int actions)
throws TopiaException
TopiaDAO
getRequestPermission in interface TopiaDAO<E extends TopiaEntity>topiaId - topiaId d'une entite
TopiaException - if any pb while getting datas
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||