r2529 - in trunk/topia-persistence/src/main/java/org/nuiton/topia: . framework
Author: athimel Date: 2012-05-25 14:40:12 +0200 (Fri, 25 May 2012) New Revision: 2529 Url: http://nuiton.org/repositories/revision/topia/2529 Log: Javadoc and reorganize TopiaContext Modified: trunk/topia-persistence/src/main/java/org/nuiton/topia/TopiaContext.java trunk/topia-persistence/src/main/java/org/nuiton/topia/framework/TopiaContextImpl.java Modified: trunk/topia-persistence/src/main/java/org/nuiton/topia/TopiaContext.java =================================================================== --- trunk/topia-persistence/src/main/java/org/nuiton/topia/TopiaContext.java 2012-05-25 08:18:33 UTC (rev 2528) +++ trunk/topia-persistence/src/main/java/org/nuiton/topia/TopiaContext.java 2012-05-25 12:40:12 UTC (rev 2529) @@ -42,18 +42,27 @@ import java.io.Reader; import java.io.Writer; import java.util.List; +import java.util.Properties; /** - * TODO-FD20100507 : Need javadoc + translate the one on methods. + * The TopiaContext is the most important class of ToPIA. It contains all the + * methods to manipulate data : transaction management, entities querying, event + * firing, schema management, services management, ... * <p/> + * To get an instance of TopiaContext, see {@link + * TopiaContextFactory#getContext(Properties)} + * <p/> * Created: 3 janv. 2006 21:18:34 * * @author poussin <poussin@codelutin.com> * @author tchemit <tchemit@codelutin.com> * @version $Id$ + * @see TopiaContextFactory#getContext(Properties) */ public interface TopiaContext { + /* -------------------- TRANSACTION MANAGEMENT --------------------------*/ + /** * Returns a new context containing its own transaction. * @@ -94,7 +103,9 @@ */ boolean isClosed(); + /* ------------------------ EVENT FIRING --------------------------*/ + /* TopiaEntityListener */ /** @@ -131,7 +142,7 @@ * the context * * @param entityClass the listened TopiaEntity's class - * @param listener the listener instance to unregister + * @param listener the listener instance to unregister */ void removeTopiaEntityListener( Class<? extends TopiaEntity> entityClass, @@ -155,7 +166,7 @@ * operation on the entity. * * @param entityClass the TopiaEntity's class to listen - * @param vetoable the vetoable instance to register + * @param vetoable the vetoable instance to register */ void addTopiaEntityVetoable( Class<? extends TopiaEntity> entityClass, @@ -174,13 +185,32 @@ * the context * * @param entityClass the listened TopiaEntity's class - * @param vetoable the vetoable instance to unregister + * @param vetoable the vetoable instance to unregister */ void removeTopiaEntityVetoable( Class<? extends TopiaEntity> entityClass, TopiaEntityVetoable vetoable); + /* TopiaEntitiesVetoable */ + + /** + * Register to the context a TopiaEntitiesVetoable about any TopiaEntity. + * <code>vetoable</code> instance will be notified BEFORE any entity load + * + * @param vetoable the vetoable instance to register + */ + void addTopiaEntitiesVetoable(TopiaEntitiesVetoable vetoable); + + /** + * Unregister the given TopiaEntitiesVetoable about any TopiaEntity from the + * context + * + * @param vetoable the vetoable instance to unregister + */ + void removeTopiaEntitiesVetoable(TopiaEntitiesVetoable vetoable); + + /* TopiaTransactionListener */ /** @@ -200,6 +230,7 @@ */ void removeTopiaTransactionListener(TopiaTransactionListener listener); + /* TopiaTransactionVetoable */ /** @@ -283,80 +314,9 @@ @Deprecated void removeTopiaContextListener(TopiaContextListener listener); + /* -------------------- GLOBAL OPERATIONS ON ENTITIES --------------------*/ - - - - - - - - - - - - - - - /* TopiaEntitiesVetoable */ - - void addTopiaEntitiesVetoable(TopiaEntitiesVetoable vetoable); - - void removeTopiaEntitiesVetoable(TopiaEntitiesVetoable vetoable); - /** - * Return true if specific service is available. - * - * @param <E> type of service - * @param interfaceService fqn of the service - * @return the service - */ - <E extends TopiaService> boolean serviceEnabled( - Class<E> interfaceService); - - /** - * Return the service. This service must be valid with a public static final - * SERVICE_NAME property. - * - * @param <E> type of service that extends {@link TopiaService} - * @param interfaceService class of the service - * @return the service instance - * @throws TopiaNotFoundException if service can't be retrieved - */ - <E extends TopiaService> E getService(Class<E> interfaceService) - throws TopiaNotFoundException; - - /** - * Detect if the table is created on storage for a given persistent class. - * - * @param clazz the researched class - * @return true if the table exists on storage - * @throws TopiaException if the context is not initialized - */ - boolean isSchemaExist(Class<?> clazz) throws TopiaException; - - /** - * Permet de créer le schema de la base de données. - * - * @throws TopiaException if any exception - */ - void createSchema() throws TopiaException; - - /** - * Permet d'afficher les requêtes SQL de création de base. - * - * @throws TopiaException if any exception - */ - void showCreateSchema() throws TopiaException; - - /** - * Permet de mettre à jour le schema de la base de données. - * - * @throws TopiaException if any exception - */ - void updateSchema() throws TopiaException; - - /** * Retrieve {@link TopiaEntity} using its unique {@code id}. * * @param topiaId unique identifier of the entity in all the application. @@ -379,10 +339,10 @@ List findByQuery(TopiaQuery query) throws TopiaException; /** - * Instantiate a new TopiaQuery. + * Instantiate a new TopiaQuery typed for the given entity's class * - * @param entityClass main entity class for the Query - * @param alias alias of the entity in the Query + * @param entityClass main entity class for the Query + * @param alias alias of the entity in the Query * @return a new TopiaQuery * @see TopiaQuery * @deprecated since TopiaQuery is deprecated in 3.0. @@ -391,77 +351,147 @@ TopiaQuery createQuery(Class<?> entityClass, String alias); /** - * Permet de faire une requete HQL hibernate directement sur la base. - * + * Allow to do some JPA-QL query + * <p/> * WARNING : Depending on the registered service, this method may not * support something else than queries on TopiaEntity * - * @param hql la requete a faire - * @param args les arguments de la requete - * @return La liste des resultats - * @throws TopiaException si une erreur survient durant la requete + * @param jpaql the JPA-QL query to execute + * @param paramNamesAndValues an array of query parameters based on + * [key,value,key,value,...] + * @return The result list + * @throws TopiaException for any error during querying */ - List find(String hql, Object... args) throws TopiaException; + List find(String jpaql, Object... paramNamesAndValues) + throws TopiaException; /** - * Permet de faire une requete HQL hibernate directement sur la base en - * precisant la fenetre des elements a remonter avec les parametres {@code - * startIndex} et {@code endIndex}. - * + * Allow to do some JPA-QL query using the given bounds. + * <p/> + * No lower bound : <code>startIndex</code> = 0.<br/> + * No upper bound : <code>endIndex</code> = -1. + * <p/> * WARNING : Depending on the registered service, this method may not * support something else than queries on TopiaEntity * - * @param hql la requete a faire - * @param startIndex la position du premier element a remonter - * @param endIndex la position du dernier element a remonter - * @param args les arguments de la requete - * @return La liste des resultats - * @throws TopiaException si une erreur survient durant la requete + * @param jpaql the JPA-QL query to execute + * @param startIndex first element position + * @param endIndex last element position + * @param paramNamesAndValues an array of query parameters based on + * [key,value,key,value,...] + * @return The result list + * @throws TopiaException for any error during querying */ - List find(String hql, int startIndex, int endIndex, Object... args) + List find(String jpaql, int startIndex, int endIndex, + Object... paramNamesAndValues) throws TopiaException; /** - * Execute HQL operation on data (Update, Delete). + * Execute JPA-QL operation on data (Update, Delete). * - * @param hql la requete a faire - * @param args les arguments de la requete + * @param jpaql the JPA-QL query to execute + * @param paramNamesAndValues an array of query parameters based on + * [key,value,key,value,...] * @return The number of entities updated or deleted. * @throws TopiaException if any exception */ - int execute(String hql, Object... args) throws TopiaException; + int execute(String jpaql, Object... paramNamesAndValues) throws TopiaException; /** - * Permet d'ajouter dans le TopiaContext une TopiaEntity créé par un autre - * context. + * Add into this TopiaContext an entity created by another TopiaContext * - * @param e l'entity a ajouter + * @param e the entity to add * @throws TopiaException if any exception */ void add(TopiaEntity e) throws TopiaException; /** - * Permet d'importer des données en XML. + * Execute a given sql code inside this transaction. * - * @param xml le flux XML - * @throws TopiaException si une erreur survient durant l'import + * @param sqlScript the sql script to execute + * @throws TopiaException if any problem occurred while executing the sql script. + */ + void executeSQL(String sqlScript) throws TopiaException; + + /* -------------------- SCHEMA MANAGMENT -----------------------------*/ + + /** + * Detect if the table is created on storage for a given persistent class. + * + * @param clazz the researched class + * @return true if the table exists on storage + * @throws TopiaException if the context is not initialized + */ + boolean isSchemaExist(Class<?> clazz) throws TopiaException; + + /** + * Triggers database schema creation + * + * @throws TopiaException if any exception + */ + void createSchema() throws TopiaException; + + /** + * Displays the SQL queries that would be used for a schema creation + * + * @throws TopiaException if any exception + */ + void showCreateSchema() throws TopiaException; + + /** + * Triggers database schema update + * + * @throws TopiaException if any exception + */ + void updateSchema() throws TopiaException; + + /* -------------------- SERVICES MANAGMENT -------------------------------*/ + + /** + * Return the service. This service must be valid with a public static final + * SERVICE_NAME property. + * + * @param <E> type of service that extends {@link TopiaService} + * @param serviceInterface class of the service + * @return the service instance + * @throws TopiaNotFoundException if service can't be retrieved + */ + <E extends TopiaService> E getService(Class<E> serviceInterface) + throws TopiaNotFoundException; + + /** + * Return true if specific service is available. + * + * @param <E> type of service + * @param serviceInterface fqn of the service + * @return the service + */ + <E extends TopiaService> boolean serviceEnabled( + Class<E> serviceInterface); + + /* ------------------ IMPORT / EXPORT / REPLICATION ---------------------*/ + + /** + * Make entities import from an XML stream + * + * @param xml the XML stream + * @throws TopiaException if any problem occurred during import * @deprecated nobody uses it, will be removed in future versions */ @Deprecated void importXML(Reader xml) throws TopiaException; /** - * Permet d'exporter certaines données en XML. + * Export entities to XML * <p/> - * <b>Note:</b> Si le parametre <code>entityAndCondition</code> est vide, - * alors on duplique toutes les entités de la base. + * <b>Note:</b> If the <code>entityAndCondition</code> parameter is empty, + * all the database will be exported * - * @param xml le flux XML dans lequel il faut ecrire - * @param entityAndCondition paramètre qui vont par deux, qui represente la - * classe de l'entity a exporter et la condition - * where que doit respecter l'objet pour etre - * exporter (entityClass, condition) - * @throws TopiaException si une erreur survient durant l'export + * @param xml the XML writer to write into + * @param entityAndCondition [key;value;...] parameter which key is the + * entity class to export, and value the "where" + * condition to use when querying entities + * @throws TopiaException if any problem occurred during export * @deprecated nobody uses it, will be removed in future versions */ @Deprecated @@ -469,68 +499,60 @@ throws TopiaException; /** - * Permet de dupliquer de ce context vers un context d'une autre base des - * données sans modification des entites. + * Makes a replication of some entities from this context to the given + * context without any entity modification. * <p/> - * <b>Note:</b> Si le parametre <code>entityAndCondition</code> est vide, - * alors on duplique toutes les entités de la base. + * <b>Note:</b> If the <code>entityAndCondition</code> parameter is empty, + * all the database will be replicated * <p/> - * <b>Note 2:</b> Il se peut que la replication simple ne soit pas - * suffisante (par example si l'on veut repliquer q'une partie d'une - * entité), on utilisera donc la seconde méthode {@link + * <b>Note 2:</b> The simple replication may not be sufficent. You may want + * to replicate only a part of some entities : use the method {@link * #replicateEntities(TopiaContext, List)}. * - * @param dstCtxt le context de la base destination - * @param entityAndCondition paramètre qui vont par deux, qui represente la - * classe de l'entity a exporter et la condition - * where que doit respecter l'objet pour etre - * exporter (entityClass, condition) - * @throws TopiaException si une erreur pendant la duplication - * @throws IllegalArgumentException si l'un des context n'est pas ouvert, ou - * si on essaye de dupliquer dans la même - * base. + * @param destinationContext the destination context + * @param entityAndCondition [key;value;...] parameter which key is the + * entity class to replicate, and value the + * "where" condition to use when querying entities + * @throws TopiaException if any problem occurred during replicate + * @throws IllegalArgumentException if one of the context is closed or if + * trying to replicate within the same + * database */ - void replicate(TopiaContext dstCtxt, Object... entityAndCondition) + void replicate(TopiaContext destinationContext, Object... entityAndCondition) throws TopiaException, IllegalArgumentException; /** - * Permet de dupliquer une entité du type donné vers un autre context. + * Replicate a given entity from this context to the given context. * - * @param dstCtxt le context de la base destination - * @param entity l'entité à répliquer - * @param <T> le type des entités à répliquer - * @throws TopiaException si une erreur pendant la duplication - * @throws IllegalArgumentException si l'un des context n'est pas ouvert, ou - * si on essaye de dupliquer dans la même - * base. + * @param destinationContext the destination context + * @param entity the entity instance to replicate + * @param <T> type of the entity to replicate + * @throws TopiaException if any problem occurred during replicate + * @throws IllegalArgumentException if one of the context is closed or if + * trying to replicate within the same + * database */ - <T extends TopiaEntity> void replicateEntity(TopiaContext dstCtxt, T entity) + <T extends TopiaEntity> void replicateEntity( + TopiaContext destinationContext, T entity) throws TopiaException, IllegalArgumentException; /** - * Permet de dupliquer les entités du type donné vers un autre context. + * Makes a replication of some entities from this context to the given + * context without any entity modification. * - * @param dstCtxt le context de la base destination - * @param entities les entités à répliquer - * @param <T> le type des entités à répliquer - * @throws TopiaException si une erreur pendant la duplication - * @throws IllegalArgumentException si l'un des context n'est pas ouvert, ou - * si on essaye de dupliquer dans la même - * base. + * @param destinationContext the destination context + * @param entities the list of entities instance to replicate + * @param <T> type of the entities to replicate + * @throws TopiaException if any problem occurred during replicate + * @throws IllegalArgumentException if one of the context is closed or if + * trying to replicate within the same + * database */ - <T extends TopiaEntity> void replicateEntities(TopiaContext dstCtxt, - List<T> entities) + <T extends TopiaEntity> void replicateEntities( + TopiaContext destinationContext, List<T> entities) throws TopiaException, IllegalArgumentException; /** - * Execute a given sql code inside this transaction. - * - * @param sqlScript the sql script to execute - * @throws TopiaException if any problem occurs while executing the sql script. - */ - void executeSQL(String sqlScript) throws TopiaException; - - /** * Sauve la base de données dans un format natif a la base, la * representation n'est pas portable d'une base a l'autre. Cette methode ne * doit être utilisé que pour un stockage temporaire utile à une @@ -539,20 +561,20 @@ * @param file le nom du fichier ou stocker les informations * @param compress si vrai compress le fichier avec gzip * @throws TopiaException if any exception + * @see TopiaH2Util#backup(File, boolean) * @deprecated use database specific class : {@link TopiaH2Util} - * @see TopiaH2Util#backup(File, boolean) */ @Deprecated void backup(File file, boolean compress) throws TopiaException; /** - * l'inverse de la methode {@link #backup(File,boolean)}. + * l'inverse de la methode {@link #backup(File, boolean)}. * * @param file le fichier ou prendre les informations, il peut-etre * compressé avec gzip ou non. * @throws TopiaException if any exception + * @see TopiaH2Util#restore(File) * @deprecated use database specific class : {@link TopiaH2Util} - * @see TopiaH2Util#restore(File) */ @Deprecated void restore(File file) throws TopiaException; @@ -565,8 +587,8 @@ * supprimé (ex: h2) ou sera fait sur la base * (postgresql) * @throws TopiaException if any exception + * @see TopiaH2Util#clear(boolean) * @deprecated use database specific class : {@link TopiaH2Util} - * @see TopiaH2Util#clear(boolean) */ @Deprecated void clear(boolean dropDatabase) throws TopiaException; Modified: trunk/topia-persistence/src/main/java/org/nuiton/topia/framework/TopiaContextImpl.java =================================================================== --- trunk/topia-persistence/src/main/java/org/nuiton/topia/framework/TopiaContextImpl.java 2012-05-25 08:18:33 UTC (rev 2528) +++ trunk/topia-persistence/src/main/java/org/nuiton/topia/framework/TopiaContextImpl.java 2012-05-25 12:40:12 UTC (rev 2529) @@ -708,7 +708,7 @@ return firesSupport; } - /* Listeners adders */ + /* TopiaEntityListener */ @Override public void addTopiaEntityListener(TopiaEntityListener listener) { @@ -723,68 +723,62 @@ } @Override - public void addTopiaEntityVetoable(TopiaEntityVetoable vetoable) { - getFiresSupport().addTopiaEntityVetoable(TopiaEntity.class, vetoable); + public void removeTopiaEntityListener(TopiaEntityListener listener) { + getFiresSupport().removeTopiaEntityListener(TopiaEntity.class, + listener); } @Override - public void addTopiaEntityVetoable( + public void removeTopiaEntityListener( Class<? extends TopiaEntity> entityClass, - TopiaEntityVetoable vetoable) { - getFiresSupport().addTopiaEntityVetoable(entityClass, vetoable); + TopiaEntityListener listener) { + getFiresSupport().removeTopiaEntityListener(entityClass, listener); } - @Override - public void addTopiaTransactionListener(TopiaTransactionListener listener) { - getFiresSupport().addTopiaTransactionListener(listener); - } + /* TopiaEntityVetoable */ @Override - public void addTopiaTransactionVetoable(TopiaTransactionVetoable vetoable) { - getFiresSupport().addTopiaTransactionVetoable(vetoable); + public void addTopiaEntityVetoable(TopiaEntityVetoable vetoable) { + getFiresSupport().addTopiaEntityVetoable(TopiaEntity.class, vetoable); } @Override - public void addPropertyChangeListener(PropertyChangeListener listener) { - getFiresSupport().addPropertyChangeListener(listener); + public void addTopiaEntityVetoable( + Class<? extends TopiaEntity> entityClass, + TopiaEntityVetoable vetoable) { + getFiresSupport().addTopiaEntityVetoable(entityClass, vetoable); } @Override - public void addTopiaSchemaListener(TopiaSchemaListener listener) { - getFiresSupport().addTopiaContextListener(listener); + public void removeTopiaEntityVetoable(TopiaEntityVetoable vetoable) { + getFiresSupport().removeTopiaEntityVetoable(TopiaEntity.class, + vetoable); } @Override - public void addTopiaContextListener(TopiaContextListener listener) { - addTopiaSchemaListener(listener); + public void removeTopiaEntityVetoable( + Class<? extends TopiaEntity> entityClass, + TopiaEntityVetoable vetoable) { + getFiresSupport().removeTopiaEntityVetoable(entityClass, vetoable); } - /* Listeners removers */ + /* TopiaEntitiesVetoable */ @Override - public void removeTopiaEntityListener(TopiaEntityListener listener) { - getFiresSupport().removeTopiaEntityListener(TopiaEntity.class, - listener); + public void addTopiaEntitiesVetoable(TopiaEntitiesVetoable vetoable) { + getFiresSupport().addTopiaEntitiesVetoable(vetoable); } @Override - public void removeTopiaEntityListener( - Class<? extends TopiaEntity> entityClass, - TopiaEntityListener listener) { - getFiresSupport().removeTopiaEntityListener(entityClass, listener); + public void removeTopiaEntitiesVetoable(TopiaEntitiesVetoable vetoable) { + getFiresSupport().removeTopiaEntitiesVetoable(vetoable); } - @Override - public void removeTopiaEntityVetoable(TopiaEntityVetoable vetoable) { - getFiresSupport().removeTopiaEntityVetoable(TopiaEntity.class, - vetoable); - } + /* TopiaTransactionListener */ @Override - public void removeTopiaEntityVetoable( - Class<? extends TopiaEntity> entityClass, - TopiaEntityVetoable vetoable) { - getFiresSupport().removeTopiaEntityVetoable(entityClass, vetoable); + public void addTopiaTransactionListener(TopiaTransactionListener listener) { + getFiresSupport().addTopiaTransactionListener(listener); } @Override @@ -793,20 +787,36 @@ getFiresSupport().removeTopiaTransactionListener(listener); } + /* TopiaTransactionVetoable */ + @Override + public void addTopiaTransactionVetoable(TopiaTransactionVetoable vetoable) { + getFiresSupport().addTopiaTransactionVetoable(vetoable); + } + + @Override public void removeTopiaTransactionVetoable( TopiaTransactionVetoable vetoable) { getFiresSupport().removeTopiaTransactionVetoable(vetoable); } + /* PropertyChangeListener */ + @Override + public void addPropertyChangeListener(PropertyChangeListener listener) { + getFiresSupport().addPropertyChangeListener(listener); + } + + @Override public void removePropertyChangeListener(PropertyChangeListener listener) { getFiresSupport().removePropertyChangeListener(listener); } + /* TopiaSchemaListener */ + @Override - public void removeTopiaContextListener(TopiaContextListener listener) { - removeTopiaSchemaListener(listener); + public void addTopiaSchemaListener(TopiaSchemaListener listener) { + getFiresSupport().addTopiaContextListener(listener); } @Override @@ -814,18 +824,20 @@ getFiresSupport().removeTopiaContextListener(listener); } + /* TopiaContextListener */ + @Override - public void addTopiaEntitiesVetoable(TopiaEntitiesVetoable vetoable) { - getFiresSupport().addTopiaEntitiesVetoable(vetoable); + public void addTopiaContextListener(TopiaContextListener listener) { + addTopiaSchemaListener(listener); } @Override - public void removeTopiaEntitiesVetoable(TopiaEntitiesVetoable vetoable) { - getFiresSupport().removeTopiaEntitiesVetoable(vetoable); + public void removeTopiaContextListener(TopiaContextListener listener) { + removeTopiaSchemaListener(listener); } - /* -------------------- GLOBAL OPERATIONS ON SCHEMA ----------------------*/ + /* -------------------- GLOBAL OPERATIONS ON ENTITIES --------------------*/ @Override public TopiaEntity findByTopiaId(String id) throws TopiaException { @@ -848,8 +860,8 @@ } @Override - public List<?> find(String hql, Object... args) throws TopiaException { - List<?> result = find(hql, 0, -1, args); + public List<?> find(String jpaql, Object... paramNamesAndValues) throws TopiaException { + List<?> result = find(jpaql, 0, -1, paramNamesAndValues); return result; } @@ -862,15 +874,15 @@ } @Override - public List<?> find(String hql, int startIndex, int endIndex, Object... args) + public List<?> find(String jpaql, int startIndex, int endIndex, Object... paramNamesAndValues) throws TopiaException { checkClosed("find"); try { - Query query = getEntityManager().createQuery(hql); - for (int j = 0; j < args.length; j += 2) { - String name = (String) args[j]; - Object value = transformArrayToCollection(args[j + 1]); + Query query = getEntityManager().createQuery(jpaql); + for (int j = 0; j < paramNamesAndValues.length; j += 2) { + String name = (String) paramNamesAndValues[j]; + Object value = transformArrayToCollection(paramNamesAndValues[j + 1]); query.setParameter(name, value); } query.setFirstResult(startIndex); @@ -887,28 +899,20 @@ } catch (PersistenceException eee) { String message = String.format( "An error occurred (%s) during a query operation : %s", - eee.getMessage(), hql); + eee.getMessage(), jpaql); throw new TopiaException(message, eee); } } - /** - * Execute HQL operation on data (Update, Delete) - * - * @param hql HQL query - * @param args arguments for query - * @return The number of entities updated or deleted. - * @throws TopiaException - */ @Override - public int execute(String hql, Object... args) throws TopiaException { + public int execute(String jpaql, Object... paramNamesAndValues) throws TopiaException { checkClosed("execute"); try { - Query query = getEntityManager().createQuery(hql); - for (int j = 0; j < args.length; j += 2) { - String name = (String) args[j]; - Object value = transformArrayToCollection(args[j + 1]); + Query query = getEntityManager().createQuery(jpaql); + for (int j = 0; j < paramNamesAndValues.length; j += 2) { + String name = (String) paramNamesAndValues[j]; + Object value = transformArrayToCollection(paramNamesAndValues[j + 1]); query.setParameter(name, value); } int result = query.executeUpdate(); @@ -916,7 +920,7 @@ } catch (PersistenceException eee) { String message = String.format( "An error occurred (%s) during a query operation : %s", - eee.getMessage(), hql); + eee.getMessage(), jpaql); throw new TopiaException(message, eee); } } @@ -928,6 +932,7 @@ String id = e.getTopiaId(); Class<TopiaEntity> entityClass = TopiaIdUtil.getClassName(id); TopiaDAO<TopiaEntity> dao = getDAO(entityClass); + dao.update(e); } @@ -1140,15 +1145,15 @@ @Override public <E extends TopiaService> boolean serviceEnabled( - Class<E> interfaceService) { + Class<E> serviceInterface) { boolean result = false; try { - String name = getServiceName(interfaceService); + String name = getServiceName(serviceInterface); result = isServiceEnabled(name); } catch (Exception eee) { String message = String.format( "The service named '%s' could not be found for following reason : %s", - interfaceService, getProperExceptionMessage(eee)); + serviceInterface, getProperExceptionMessage(eee)); if (log.isDebugEnabled()) { log.debug(message, eee); } else if (log.isWarnEnabled()) {
participants (1)
-
athimel@users.nuiton.org