|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.nuiton.topia.persistence.TopiaDAOImpl<Entity>
Entity - le type de l'entitepublic class TopiaDAOImpl<Entity 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 java.lang.Class<Entity> |
entityClass
|
| Constructor Summary | |
|---|---|
TopiaDAOImpl()
|
|
| Method Summary | |
|---|---|
void |
addTopiaEntityListener(TopiaEntityListener listener)
|
void |
addTopiaEntityVetoable(TopiaEntityVetoable vetoable)
|
void |
commitTransaction()
Callback method when context was commit. |
Entity |
create(java.util.Map<java.lang.String,java.lang.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. |
Entity |
create(java.lang.Object... properties)
Construit une nouvelle instance de l'objet géré par ce DAO |
void |
delete(Entity e)
|
java.util.List<Entity> |
findAll()
|
java.util.List<Entity> |
findAllByProperties(java.util.Map<java.lang.String,java.lang.Object> properties)
|
java.util.List<Entity> |
findAllByProperties(java.lang.String propertyName,
java.lang.Object value,
java.lang.Object... others)
|
java.util.List<Entity> |
findAllByProperty(java.lang.String propertyName,
java.lang.Object value)
|
java.util.List<Entity> |
findAllContainsProperties(java.util.Map<java.lang.String,java.util.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. |
java.util.List<Entity> |
findAllContainsProperties(java.lang.String propertyName,
java.util.Collection values,
java.lang.Object... others)
Cherche et renvoie toutes les entités trouvées dont la propriété propertyName contient values, ainsi de suite avec others. |
java.util.List<java.lang.String> |
findAllIds()
Recuperation de tous les ids en base pour le type d'entite du dao. |
java.util.List<Entity> |
findAllWithOrder(java.lang.String... propertyNames)
|
Entity |
findByPrimaryKey(java.util.Map<java.lang.String,java.lang.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. |
Entity |
findByPrimaryKey(java.lang.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 |
Entity |
findByProperties(java.util.Map<java.lang.String,java.lang.Object> properties)
|
Entity |
findByProperties(java.lang.String propertyName,
java.lang.Object value,
java.lang.Object... others)
|
Entity |
findByProperty(java.lang.String propertyName,
java.lang.Object value)
|
Entity |
findByTopiaId(java.lang.String k)
|
Entity |
findContainsProperties(java.util.Map<java.lang.String,java.util.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. |
Entity |
findContainsProperties(java.lang.String propertyName,
java.util.Collection values,
java.lang.Object... others)
Cherche et renvoie la première entité trouvée dont la propriété propertyName contient values, ainsi de suite avec others. |
TopiaContextImplementor |
getContext()
|
java.lang.Class<Entity> |
getEntityClass()
Return class of entity managed by this DAO |
protected java.io.Serializable |
getId(Entity e)
Retourne l'id de l'entity |
protected java.io.Serializable |
getId(java.util.Map map)
Retourne l'id de l'entity representer comme une map |
java.util.List<java.security.Permission> |
getRequestPermission(java.lang.String topiaId,
int actions)
Retourne les permissions a verifier pour l'acces a l'entite pour le service Taas. |
void |
init(TopiaContextImplementor context,
java.lang.Class<Entity> entityClass)
When TopiaContextImpl create the TopiaDAOHibernate, it must call this method just after |
protected Entity |
instanciateNew()
|
void |
removeTopiaEntityListener(TopiaEntityListener listener)
|
void |
removeTopiaEntityVetoable(TopiaEntityVetoable vetoable)
|
void |
rollbackTransaction()
Callback method when context was rollback. |
long |
size()
Utilisation du count(*) en HQL pour recuperer le nombre d'entites du type lie au DAO |
Entity |
update(Entity 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 java.lang.Class<Entity extends TopiaEntity> entityClass
protected TopiaContextImplementor context
| Constructor Detail |
|---|
public TopiaDAOImpl()
| Method Detail |
|---|
public java.lang.Class<Entity> getEntityClass()
TopiaDAO
getEntityClass in interface TopiaDAO<Entity extends TopiaEntity>
protected java.io.Serializable getId(Entity e)
throws TopiaException
e - l'entity
TopiaException - Si une erreur survient durant la recherche
protected java.io.Serializable getId(java.util.Map map)
throws TopiaException
map - l'entity en representation map
TopiaException - Si une erreur survient durant la recherche
public void init(TopiaContextImplementor context,
java.lang.Class<Entity> entityClass)
throws TopiaException
init in interface TopiaDAO<Entity extends TopiaEntity>entityClass - context - context
TopiaExceptionpublic TopiaContextImplementor getContext()
getContext in interface TopiaDAO<Entity extends TopiaEntity>
protected Entity instanciateNew()
throws TopiaException
TopiaException
public void commitTransaction()
throws TopiaException
commitTransaction in interface TopiaDAO<Entity extends TopiaEntity>TopiaException
public void rollbackTransaction()
throws TopiaException
rollbackTransaction in interface TopiaDAO<Entity extends TopiaEntity>TopiaException
public Entity create(java.lang.Object... properties)
throws TopiaException
TopiaDAO
create in interface TopiaDAO<Entity 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 Entity findByPrimaryKey(java.util.Map<java.lang.String,java.lang.Object> keys)
throws TopiaException
TopiaDAO
findByPrimaryKey in interface TopiaDAO<Entity extends TopiaEntity>keys - la liste des champs de la cle naturelle avec leur valeur
TopiaException
public Entity findByPrimaryKey(java.lang.Object... k)
throws TopiaException
TopiaDAO
findByPrimaryKey in interface TopiaDAO<Entity extends TopiaEntity>k - l'objet cle naturelle de la classe
TopiaException
public Entity findByProperties(java.lang.String propertyName,
java.lang.Object value,
java.lang.Object... others)
throws TopiaException
findByProperties in interface TopiaDAO<Entity extends TopiaEntity>others - les autres proprietes doivent aller par 2 propertyName,
value
TopiaException
public java.util.List<Entity> findAllByProperties(java.lang.String propertyName,
java.lang.Object value,
java.lang.Object... others)
throws TopiaException
findAllByProperties in interface TopiaDAO<Entity extends TopiaEntity>others - les autres proprietes doivent aller par 2 propertyName,
value
TopiaException
public Entity findContainsProperties(java.util.Map<java.lang.String,java.util.Collection> properties)
throws TopiaException
TopiaDAO
findContainsProperties in interface TopiaDAO<Entity extends TopiaEntity>TopiaException
public Entity findContainsProperties(java.lang.String propertyName,
java.util.Collection values,
java.lang.Object... others)
throws TopiaException
TopiaDAO
findContainsProperties in interface TopiaDAO<Entity extends TopiaEntity>TopiaException
public java.util.List<Entity> findAllContainsProperties(java.util.Map<java.lang.String,java.util.Collection> properties)
throws TopiaException
findAllContainsProperties in interface TopiaDAO<Entity extends TopiaEntity>properties -
TopiaException - if any pb
public java.util.List<Entity> findAllContainsProperties(java.lang.String propertyName,
java.util.Collection values,
java.lang.Object... others)
throws TopiaException
TopiaDAO
findAllContainsProperties in interface TopiaDAO<Entity extends TopiaEntity>TopiaException
public java.util.List<Entity> findAllByProperty(java.lang.String propertyName,
java.lang.Object value)
throws TopiaException
findAllByProperty in interface TopiaDAO<Entity extends TopiaEntity>TopiaException
public Entity findByProperty(java.lang.String propertyName,
java.lang.Object value)
throws TopiaException
findByProperty in interface TopiaDAO<Entity extends TopiaEntity>TopiaExceptionpublic void addTopiaEntityListener(TopiaEntityListener listener)
addTopiaEntityListener in interface TopiaDAO<Entity extends TopiaEntity>public void addTopiaEntityVetoable(TopiaEntityVetoable vetoable)
addTopiaEntityVetoable in interface TopiaDAO<Entity extends TopiaEntity>public void removeTopiaEntityListener(TopiaEntityListener listener)
removeTopiaEntityListener in interface TopiaDAO<Entity extends TopiaEntity>public void removeTopiaEntityVetoable(TopiaEntityVetoable vetoable)
removeTopiaEntityVetoable in interface TopiaDAO<Entity extends TopiaEntity>
public Entity create(java.util.Map<java.lang.String,java.lang.Object> properties)
throws TopiaException
create in interface TopiaDAO<Entity 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 Entity update(Entity e)
throws TopiaException
TopiaDAO
update in interface TopiaDAO<Entity extends TopiaEntity>e - l'entite a ajouter ou mettre a jour
TopiaException
public void delete(Entity e)
throws TopiaException
delete in interface TopiaDAO<Entity extends TopiaEntity>TopiaException
public Entity findByTopiaId(java.lang.String k)
throws TopiaException
findByTopiaId in interface TopiaDAO<Entity extends TopiaEntity>TopiaException
public java.util.List<Entity> findAll()
throws TopiaException
findAll in interface TopiaDAO<Entity extends TopiaEntity>TopiaException
public java.util.List<java.lang.String> findAllIds()
throws TopiaException
TopiaDAO
findAllIds in interface TopiaDAO<Entity extends TopiaEntity>TopiaException - si pb en base
public java.util.List<Entity> findAllWithOrder(java.lang.String... propertyNames)
throws TopiaException
findAllWithOrder in interface TopiaDAO<Entity extends TopiaEntity>TopiaException
public long size()
throws TopiaException
size in interface TopiaDAO<Entity extends TopiaEntity>TopiaException
public Entity findByProperties(java.util.Map<java.lang.String,java.lang.Object> properties)
throws TopiaException
findByProperties in interface TopiaDAO<Entity extends TopiaEntity>TopiaException
public java.util.List<Entity> findAllByProperties(java.util.Map<java.lang.String,java.lang.Object> properties)
throws TopiaException
findAllByProperties in interface TopiaDAO<Entity extends TopiaEntity>TopiaException
public java.util.List<java.security.Permission> getRequestPermission(java.lang.String topiaId,
int actions)
throws TopiaException
TopiaDAO
getRequestPermission in interface TopiaDAO<Entity extends TopiaEntity>topiaId - topiaId d'une entite
TopiaException
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||