Author: athimel Date: 2014-01-17 23:38:39 +0100 (Fri, 17 Jan 2014) New Revision: 2982 Url: http://nuiton.org/projects/topia/repository/revisions/2982 Log: refs #552 Clean API - TopiaDao - TopiaDaoSupplier - TopiaEntities - visitors - TopiaEntity - TopiaApplicationContextCache - TopiaTransaction - TopiaIdFactory - TopiaTransaction - ... Added: trunk/topia-persistence/src/main/java/org/nuiton/topia/persistence/TopiaEntityVisitor.java Removed: trunk/topia-persistence/src/main/java/org/nuiton/topia/persistence/EntityVisitor.java Modified: trunk/topia-it/src/main/java/org/nuiton/topia/it/legacy/topiatest/persistence/Entity1Abstract.java trunk/topia-it/src/test/java/org/nuiton/topia/it/legacy/persistence/EntityVisitorExportXmlTest.java trunk/topia-it/src/test/java/org/nuiton/topia/it/legacy/persistence/ExportXMLVisitor.java trunk/topia-persistence/src/main/java/org/nuiton/topia/persistence/DepthEntityVisitor.java trunk/topia-persistence/src/main/java/org/nuiton/topia/persistence/HorizontalEntityVisitor.java trunk/topia-persistence/src/main/java/org/nuiton/topia/persistence/HqlAndParametersBuilder.java trunk/topia-persistence/src/main/java/org/nuiton/topia/persistence/QueryMissingOrderException.java trunk/topia-persistence/src/main/java/org/nuiton/topia/persistence/TopiaApplicationContext.java trunk/topia-persistence/src/main/java/org/nuiton/topia/persistence/TopiaApplicationContextCache.java trunk/topia-persistence/src/main/java/org/nuiton/topia/persistence/TopiaConfigurationConstants.java trunk/topia-persistence/src/main/java/org/nuiton/topia/persistence/TopiaDao.java trunk/topia-persistence/src/main/java/org/nuiton/topia/persistence/TopiaDaoSupplier.java trunk/topia-persistence/src/main/java/org/nuiton/topia/persistence/TopiaEntities.java trunk/topia-persistence/src/main/java/org/nuiton/topia/persistence/TopiaEntity.java trunk/topia-persistence/src/main/java/org/nuiton/topia/persistence/TopiaEntityContextable.java trunk/topia-persistence/src/main/java/org/nuiton/topia/persistence/TopiaException.java trunk/topia-persistence/src/main/java/org/nuiton/topia/persistence/TopiaIdFactory.java trunk/topia-persistence/src/main/java/org/nuiton/topia/persistence/TopiaPersistenceContext.java trunk/topia-persistence/src/main/java/org/nuiton/topia/persistence/TopiaTransaction.java trunk/topia-persistence/src/main/java/org/nuiton/topia/persistence/TopiaTransactionAware.java trunk/topia-persistence/src/main/java/org/nuiton/topia/persistence/internal/AbstractTopiaDao.java trunk/topia-persistence/src/main/java/org/nuiton/topia/persistence/internal/AbstractTopiaEntity.java trunk/topia-persistence/src/main/java/org/nuiton/topia/persistence/internal/DefaultTopiaIdFactory.java trunk/topia-persistence/src/main/java/org/nuiton/topia/persistence/internal/support/TopiaHibernateEventListener.java trunk/topia-persistence/src/main/java/org/nuiton/topia/persistence/package-info.java trunk/topia-persistence/src/test/java/org/nuiton/topia/persistence/DefaultTopiaIdFactoryTest.java trunk/topia-service-csv/src/main/java/org/nuiton/topia/service/csv/out/ExportEntityVisitor.java trunk/topia-templates/src/main/java/org/nuiton/topia/templates/EntityHibernateMappingGenerator.java trunk/topia-templates/src/main/java/org/nuiton/topia/templates/EntityTransformer.java trunk/topia-templates/src/main/java/org/nuiton/topia/templates/TopiaTagValues.java Modified: trunk/topia-it/src/main/java/org/nuiton/topia/it/legacy/topiatest/persistence/Entity1Abstract.java =================================================================== --- trunk/topia-it/src/main/java/org/nuiton/topia/it/legacy/topiatest/persistence/Entity1Abstract.java 2014-01-17 17:38:55 UTC (rev 2981) +++ trunk/topia-it/src/main/java/org/nuiton/topia/it/legacy/topiatest/persistence/Entity1Abstract.java 2014-01-17 22:38:39 UTC (rev 2982) @@ -24,9 +24,9 @@ * #L% */ +import org.nuiton.topia.persistence.TopiaEntityVisitor; import org.nuiton.topia.persistence.internal.AbstractTopiaEntity; import org.nuiton.topia.persistence.TopiaException; -import org.nuiton.topia.persistence.EntityVisitor; /** * Created: 11 mai 2010 @@ -72,7 +72,7 @@ } @Override - public void accept(EntityVisitor visitor) throws TopiaException { + public void accept(TopiaEntityVisitor visitor) throws TopiaException { visitor.start(this); visitor.visit(this, ATTR_1, String.class, attr1); visitor.visit(this, ATTR_2, String.class, attr2); Modified: trunk/topia-it/src/test/java/org/nuiton/topia/it/legacy/persistence/EntityVisitorExportXmlTest.java =================================================================== --- trunk/topia-it/src/test/java/org/nuiton/topia/it/legacy/persistence/EntityVisitorExportXmlTest.java 2014-01-17 17:38:55 UTC (rev 2981) +++ trunk/topia-it/src/test/java/org/nuiton/topia/it/legacy/persistence/EntityVisitorExportXmlTest.java 2014-01-17 22:38:39 UTC (rev 2982) @@ -30,6 +30,7 @@ import org.junit.Rule; import org.junit.Test; import org.nuiton.topia.it.legacy.TopiaDatabase; +import org.nuiton.topia.persistence.TopiaEntityVisitor; import org.nuiton.topia.persistence.TopiaException; import org.nuiton.topia.it.legacy.TopiaTestTopiaPersistenceContext; import org.nuiton.topia.it.legacy.topiatest.Address; @@ -41,7 +42,6 @@ import org.nuiton.topia.it.legacy.topiatest.Employe; import org.nuiton.topia.it.legacy.topiatest.EmployeTopiaDao; import org.nuiton.topia.persistence.DepthEntityVisitor; -import org.nuiton.topia.persistence.EntityVisitor; /** * Test de visitor. @@ -121,8 +121,8 @@ CompanyTopiaDao companyDAO = context.getCompanyDao(); Company clCompany = companyDAO.findByName("CodeLutin"); - EntityVisitor delegateVisitor = new ExportXMLVisitor(); - EntityVisitor visitor = new DepthEntityVisitor(delegateVisitor); + TopiaEntityVisitor delegateVisitor = new ExportXMLVisitor(); + TopiaEntityVisitor visitor = new DepthEntityVisitor(delegateVisitor); clCompany.accept(visitor); if (log.isInfoEnabled()) { Modified: trunk/topia-it/src/test/java/org/nuiton/topia/it/legacy/persistence/ExportXMLVisitor.java =================================================================== --- trunk/topia-it/src/test/java/org/nuiton/topia/it/legacy/persistence/ExportXMLVisitor.java 2014-01-17 17:38:55 UTC (rev 2981) +++ trunk/topia-it/src/test/java/org/nuiton/topia/it/legacy/persistence/ExportXMLVisitor.java 2014-01-17 22:38:39 UTC (rev 2982) @@ -28,7 +28,7 @@ import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.junit.Ignore; -import org.nuiton.topia.persistence.EntityVisitor; +import org.nuiton.topia.persistence.TopiaEntityVisitor; import org.nuiton.topia.persistence.TopiaEntity; /** @@ -41,7 +41,7 @@ * By : $Author$ */ @Ignore -public class ExportXMLVisitor implements EntityVisitor { +public class ExportXMLVisitor implements TopiaEntityVisitor { /** log. */ private static Log log = LogFactory.getLog(ExportXMLVisitor.class); Modified: trunk/topia-persistence/src/main/java/org/nuiton/topia/persistence/DepthEntityVisitor.java =================================================================== --- trunk/topia-persistence/src/main/java/org/nuiton/topia/persistence/DepthEntityVisitor.java 2014-01-17 17:38:55 UTC (rev 2981) +++ trunk/topia-persistence/src/main/java/org/nuiton/topia/persistence/DepthEntityVisitor.java 2014-01-17 22:38:39 UTC (rev 2982) @@ -1,3 +1,5 @@ +package org.nuiton.topia.persistence; + /* * #%L * ToPIA :: Persistence @@ -22,39 +24,37 @@ * #L% */ -package org.nuiton.topia.persistence; +import java.util.ArrayList; +import java.util.Collection; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; -import java.util.ArrayList; -import java.util.Collection; - /** - * Parcourt du graphe d'entité en profondeur. + * Visitor to run through the entity graph by depth. * * @author echatellier <chatellier@codelutin.com> * @author tchemit <tchemit@codelutin.com> - * @version $Id$ */ -public class DepthEntityVisitor implements EntityVisitor { +public class DepthEntityVisitor implements TopiaEntityVisitor { - /** Class logger. */ private static Log log = LogFactory.getLog(DepthEntityVisitor.class); - /** Cache of already explored entities. */ + /** + * Cache of already explored entities. + */ protected Collection<TopiaEntity> alreadyExplored; /** - * Le visiteur metier (optionel). + * The business visitor (optional) */ - protected EntityVisitor delegateVisitor; + protected TopiaEntityVisitor delegateVisitor; public DepthEntityVisitor() { this(null); } - public DepthEntityVisitor(EntityVisitor delegateVisitor) { + public DepthEntityVisitor(TopiaEntityVisitor delegateVisitor) { alreadyExplored = new ArrayList<TopiaEntity>(); @@ -95,7 +95,7 @@ @Override public void visit(TopiaEntity e, String propertyName, - Class<?> collectionType, Class<?> type,Object value) { + Class<?> collectionType, Class<?> type, Object value) { Collection<?> cValue = (Collection<?>) value; if (cValue != null && !cValue.isEmpty()) { Deleted: trunk/topia-persistence/src/main/java/org/nuiton/topia/persistence/EntityVisitor.java =================================================================== --- trunk/topia-persistence/src/main/java/org/nuiton/topia/persistence/EntityVisitor.java 2014-01-17 17:38:55 UTC (rev 2981) +++ trunk/topia-persistence/src/main/java/org/nuiton/topia/persistence/EntityVisitor.java 2014-01-17 22:38:39 UTC (rev 2982) @@ -1,113 +0,0 @@ -/* - * #%L - * ToPIA :: Persistence - * $Id$ - * $HeadURL$ - * %% - * Copyright (C) 2004 - 2014 CodeLutin - * %% - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as - * published by the Free Software Foundation, either version 3 of the - * License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Lesser Public License for more details. - * - * You should have received a copy of the GNU General Lesser Public - * License along with this program. If not, see - * <http://www.gnu.org/licenses/lgpl-3.0.html>. - * #L% - */ - -package org.nuiton.topia.persistence; - -/** - * The contract of a visitor of any {@link TopiaEntity}. - * <p/> - * Created: 28 janv. 2009 18:10:34 - * - * @author bpoussin <poussin@codelutin.com> - * @author tchemit <chemit@codelutin.com> - * @version $Id$ - */ -public interface EntityVisitor { - - /** - * Start the visit of the given entity. - * - * @param entity the visited entity - */ - void start(TopiaEntity entity); - - /** - * Ends the visit of the given entity. - * - * @param entity the visited entity - */ - void end(TopiaEntity entity); - - /** - * Visit a none indexed property for the given entity. - * <p/> - * The property visited is defined by the other parameters. - * - * @param entity the visited entity - * @param propertyName the name of the visited property - * @param type the type of the visited property - * @param value the value of the visited property - */ - void visit(TopiaEntity entity, - String propertyName, - Class<?> type, - Object value); - - /** - * Visit a collection property for the given entity. - * <p/> - * The property visited is defined by the other parameters. - * - * @param entity the visited entity - * @param propertyName the name of the visited property - * @param collectionType the type of the visited collection - * @param type the type of the visited property - * @param value the value of the visited property - */ - void visit(TopiaEntity entity, - String propertyName, - Class<?> collectionType, - Class<?> type, - Object value); - - /** - * Visit a indexed value from a collection property for the given entity. - * <p/> - * The property visited is defined by the other parameters. - * - * @param entity the visited entity - * @param propertyName the name of the visited property - * @param collectionType the type of the container of the visited property - * @param type the type of the visited property - * @param index the index of the visited property in his container - * @param value the value of the visited property - */ - void visit(TopiaEntity entity, - String propertyName, - Class<?> collectionType, - Class<?> type, - int index, - Object value); - - /** - * Reset all states of the visitor. - * <p/> - * If you use internal states inside the visitor, this method should clean - * all of them. - * <p/> - * This method should be invoked after usage of the visitor. - */ - void clear(); - -} Modified: trunk/topia-persistence/src/main/java/org/nuiton/topia/persistence/HorizontalEntityVisitor.java =================================================================== --- trunk/topia-persistence/src/main/java/org/nuiton/topia/persistence/HorizontalEntityVisitor.java 2014-01-17 17:38:55 UTC (rev 2981) +++ trunk/topia-persistence/src/main/java/org/nuiton/topia/persistence/HorizontalEntityVisitor.java 2014-01-17 22:38:39 UTC (rev 2982) @@ -1,3 +1,5 @@ +package org.nuiton.topia.persistence; + /* * #%L * ToPIA :: Persistence @@ -22,42 +24,44 @@ * #L% */ -package org.nuiton.topia.persistence; +import java.util.ArrayList; +import java.util.Collection; +import java.util.List; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; -import java.util.ArrayList; -import java.util.Collection; -import java.util.List; - /** - * Parcourt en largeur du modele et délegation à un autre visiteur. - * + * Visitor to run through entities horizontally, then delegate visiting to another visitor. + * * @author echatellier <chatellier@codelutin.com> * @author tchemit <tchemit@codelutin.com> - * @version $Id$ */ -public class HorizontalEntityVisitor implements EntityVisitor { +public class HorizontalEntityVisitor implements TopiaEntityVisitor { - /** Class logger. */ private static Log log = LogFactory.getLog(HorizontalEntityVisitor.class); - /** Delegate visitor. */ - protected EntityVisitor delegateVisitor; + /** + * Delegate visitor. + */ + protected TopiaEntityVisitor delegateVisitor; - /** Cache used to remember entity during exploration. */ + /** + * Cache used to remember entity during exploration. + */ protected List<TopiaEntity> alreadyExplored; - /** Entity to be visited later. */ + /** + * Entity to be visited later. + */ protected List<TopiaEntity> toVisitEntities; /** * Constructor. - * - * @param delegateVisitor delegate visitor + * + * @param delegateVisitor visitor to delegate visiting */ - public HorizontalEntityVisitor(EntityVisitor delegateVisitor) { + public HorizontalEntityVisitor(TopiaEntityVisitor delegateVisitor) { this.delegateVisitor = delegateVisitor; alreadyExplored = new ArrayList<TopiaEntity>(); toVisitEntities = new ArrayList<TopiaEntity>(); @@ -85,7 +89,7 @@ @Override public void visit(TopiaEntity entity, String propertyName, - Class<?> collectionType,Class<?> type, Object value) { + Class<?> collectionType, Class<?> type, Object value) { Collection<?> values = (Collection<?>) value; if (values != null && !values.isEmpty()) { int i = 0; @@ -113,7 +117,7 @@ @Override public void end(TopiaEntity entity) { delegateVisitor.end(entity); - + // here, must revisit all remembered entities List<TopiaEntity> currentEntities = new ArrayList<TopiaEntity>(toVisitEntities); Modified: trunk/topia-persistence/src/main/java/org/nuiton/topia/persistence/HqlAndParametersBuilder.java =================================================================== --- trunk/topia-persistence/src/main/java/org/nuiton/topia/persistence/HqlAndParametersBuilder.java 2014-01-17 17:38:55 UTC (rev 2981) +++ trunk/topia-persistence/src/main/java/org/nuiton/topia/persistence/HqlAndParametersBuilder.java 2014-01-17 22:38:39 UTC (rev 2982) @@ -37,13 +37,12 @@ import java.util.Set; /** - * A builder to create syntactically correct hql and associated parameters - * given properties or after various constraint adds. + * A builder to create syntactically correct hql and associated parameters given properties or after various constraint + * adds. * - * It may be used in a dao to ease dynamic construction of queries. + * <p>It may be used in a Dao to ease dynamic construction of queries.</p> * * @since 3.0 - * @param <E> */ public class HqlAndParametersBuilder<E extends TopiaEntity> { Modified: trunk/topia-persistence/src/main/java/org/nuiton/topia/persistence/QueryMissingOrderException.java =================================================================== --- trunk/topia-persistence/src/main/java/org/nuiton/topia/persistence/QueryMissingOrderException.java 2014-01-17 17:38:55 UTC (rev 2981) +++ trunk/topia-persistence/src/main/java/org/nuiton/topia/persistence/QueryMissingOrderException.java 2014-01-17 22:38:39 UTC (rev 2982) @@ -27,22 +27,21 @@ import java.util.Map; /** - * If you get this exception, it means that you asked topia - * to make an operation that need a deterministic way to sort the - * result but you didn't defined such query. + * <p>If you get this exception, it means that you asked ToPIA to make an operation that needs a deterministic way to sort + * the result but you didn't defined such query.</p> * - * To fix you issue, you may use another API call (maybe user findAny instead - * of findFirst) or change your query by adding an order by clause. A quick and - * easy fix would be to just use "order by topiaId". + * <p>To fix you issue, you may use another API call (maybe user findAny instead of findFirst) or change your query by + * adding an order by clause. A quick and easy fix would be to just use "order by topiaId".</p> * * @since 3.0 */ public class QueryMissingOrderException extends TopiaQueryException { - protected static final String MESSAGE = "given query needs an order by clause since the API call you use need the results sorting to be deterministic"; - private static final long serialVersionUID = 8154110639594660107L; + protected static final String MESSAGE = "Given query needs an ORDER BY clause since the API call you're using " + + "needs the results sorting to be deterministic"; + public QueryMissingOrderException(String hql, Map<String, Object> hqlParameters) { super(MESSAGE, hql, hqlParameters); } Modified: trunk/topia-persistence/src/main/java/org/nuiton/topia/persistence/TopiaApplicationContext.java =================================================================== --- trunk/topia-persistence/src/main/java/org/nuiton/topia/persistence/TopiaApplicationContext.java 2014-01-17 17:38:55 UTC (rev 2981) +++ trunk/topia-persistence/src/main/java/org/nuiton/topia/persistence/TopiaApplicationContext.java 2014-01-17 22:38:39 UTC (rev 2982) @@ -32,7 +32,7 @@ import com.google.common.collect.ImmutableMap; /** - * This is the main entry point for ToPIA. This interface represents the root context of an application. + * <p>This is the main entry point for ToPIA. This interface represents the root context of an application.</p> * * <p>Most of the time, there is only one instance of this context during the entire lifecycle of a application.</p> * Modified: trunk/topia-persistence/src/main/java/org/nuiton/topia/persistence/TopiaApplicationContextCache.java =================================================================== --- trunk/topia-persistence/src/main/java/org/nuiton/topia/persistence/TopiaApplicationContextCache.java 2014-01-17 17:38:55 UTC (rev 2981) +++ trunk/topia-persistence/src/main/java/org/nuiton/topia/persistence/TopiaApplicationContextCache.java 2014-01-17 22:38:39 UTC (rev 2982) @@ -38,11 +38,11 @@ import com.google.common.collect.Lists; /** - * This class will provide a TopiaApplicationContext cache. Its usage is not necessary, contexts can be directly created - * outside of this cache, then the cache will not contain any reference to the created ApplicationContexts. - * <p/> - * This class is 'inspired' from the TopiaContextFactory of ToPIA 2.x + * <p>This class will provide a TopiaApplicationContext cache. Its usage is not necessary, contexts can be directly + * created outside of this cache, then the cache will not contain any reference to the created ApplicationContexts.</p> * + * <p>This class is 'inspired' from the TopiaContextFactory of ToPIA 2.x</p> + * * @author Arnaud Thimel : thimel@codelutin.com * @since 3.0 */ Modified: trunk/topia-persistence/src/main/java/org/nuiton/topia/persistence/TopiaConfigurationConstants.java =================================================================== --- trunk/topia-persistence/src/main/java/org/nuiton/topia/persistence/TopiaConfigurationConstants.java 2014-01-17 17:38:55 UTC (rev 2981) +++ trunk/topia-persistence/src/main/java/org/nuiton/topia/persistence/TopiaConfigurationConstants.java 2014-01-17 22:38:39 UTC (rev 2982) @@ -27,6 +27,8 @@ import org.hibernate.cfg.Environment; /** + * This class lists the configuration variables that ToPIA expects + * <p/> * Created on 12/20/13. * * @author Tony Chemit <chemit@codelutin.com> @@ -63,20 +65,16 @@ String CONFIG_URL = Environment.URL; @Deprecated - String CONFIG_PERSISTENCE_DIRECTORIES = - "topia.persistence.directories"; + String CONFIG_PERSISTENCE_DIRECTORIES = "topia.persistence.directories"; - String CONFIG_PERSISTENCE_CLASSES = - "topia.persistence.classes"; + String CONFIG_PERSISTENCE_CLASSES = "topia.persistence.classes"; - String CONFIG_PERSISTENCE_PROPERTIES_FILE = - "topia.persistence.properties.file"; + String CONFIG_PERSISTENCE_PROPERTIES_FILE = "topia.persistence.properties.file"; /** * Configuration directive to change topia Ids generation strategy. * <p/> - * Expected value is an fqn to a class which implements - * {@link TopiaIdFactory} + * Expected value is an FQN to a class which implements {@link org.nuiton.topia.persistence.TopiaIdFactory} * * @since 3.0 */ Modified: trunk/topia-persistence/src/main/java/org/nuiton/topia/persistence/TopiaDao.java =================================================================== --- trunk/topia-persistence/src/main/java/org/nuiton/topia/persistence/TopiaDao.java 2014-01-17 17:38:55 UTC (rev 2981) +++ trunk/topia-persistence/src/main/java/org/nuiton/topia/persistence/TopiaDao.java 2014-01-17 22:38:39 UTC (rev 2982) @@ -24,17 +24,17 @@ * #L% */ -import com.google.common.base.Optional; +import java.util.List; +import java.util.Map; + import org.nuiton.topia.persistence.event.TopiaEntityListener; import org.nuiton.topia.persistence.event.TopiaEntityVetoable; import org.nuiton.topia.persistence.pager.TopiaPagerBean; -import java.util.List; -import java.util.Map; +import com.google.common.base.Optional; /** - * This contract represents the common operation any DAO should - * be able to provide as API. + * This contract represents the common operations any Dao should be able to provide as API. * * @author bleny * @since 3.0 @@ -75,7 +75,7 @@ /** * Creates a new pager initialized for the first page of all data of the dao. - * + * <p/> * <strong>Note:</strong> This method will execute a count query to init * the pager. * @@ -88,12 +88,12 @@ /** * Creates a new pager initialized for the first page of data of the given * query. - * + * <p/> * <strong>Note:</strong> This method will execute a count query to init * the pager. * - * @param hql query - * @param params params of the query + * @param hql query + * @param params params of the query * @param pageSize size of a page * @return the initialized pager. * @since 3.0 @@ -157,7 +157,7 @@ * Finds all the entities managed by this DAO. * * @return the full list of entities in no particular - * (non-determinisic) order + * (non-determinisic) order */ List<E> findAll(); @@ -236,9 +236,9 @@ * * @param topiaId the identifier of the entity to look for * @return The entity found - * @throws TopiaNoResultException if result is found, if you - * do not want an exception to be raised, use - * {@link #tryFindByTopiaId(String)} + * @throws TopiaNoResultException if result is found, if you + * do not want an exception to be raised, use + * {@link #tryFindByTopiaId(String)} */ E findByTopiaId(String topiaId) throws TopiaNoResultException; @@ -282,8 +282,8 @@ * * @param entity the entity * @return the dictionnary of usages of the given entities (keys are entity - * usage container, values are the list of this type of entity to - * use the given entity). + * usage container, values are the list of this type of entity to + * use the given entity). * @since 2.3.0 */ Map<Class<? extends TopiaEntity>, List<? extends TopiaEntity>> findAllUsages(E entity); Modified: trunk/topia-persistence/src/main/java/org/nuiton/topia/persistence/TopiaDaoSupplier.java =================================================================== --- trunk/topia-persistence/src/main/java/org/nuiton/topia/persistence/TopiaDaoSupplier.java 2014-01-17 17:38:55 UTC (rev 2981) +++ trunk/topia-persistence/src/main/java/org/nuiton/topia/persistence/TopiaDaoSupplier.java 2014-01-17 22:38:39 UTC (rev 2982) @@ -24,17 +24,17 @@ * #L% */ -import org.nuiton.topia.persistence.TopiaDao; -import org.nuiton.topia.persistence.TopiaEntity; - /** + * Contract that provides any Dao instance from a given entity class. + * * @author bleny + * @since 3.0 */ public interface TopiaDaoSupplier { /** - * Get Dao for specified class. If the specialized Dao exists then it is - * returned otherwise a TopiaException will be thrown + * Get Dao for specified class. If the specialized Dao exists then it is returned otherwise a TopiaException will + * be thrown. * * @param entityClass type of entity * @return the expected dao @@ -42,8 +42,8 @@ <E extends TopiaEntity> TopiaDao<E> getDao(Class<E> entityClass); /** - * Get Dao for specified class. If the specialized Dao exists then it is - * returned otherwise a TopiaException will be thrown + * Get Dao for specified class. If the specialized Dao exists then it is returned otherwise a TopiaException will be + * thrown. * * @param entityClass type of entity * @param daoClass the concrete dao class to use Modified: trunk/topia-persistence/src/main/java/org/nuiton/topia/persistence/TopiaEntities.java =================================================================== --- trunk/topia-persistence/src/main/java/org/nuiton/topia/persistence/TopiaEntities.java 2014-01-17 17:38:55 UTC (rev 2981) +++ trunk/topia-persistence/src/main/java/org/nuiton/topia/persistence/TopiaEntities.java 2014-01-17 22:38:39 UTC (rev 2982) @@ -30,20 +30,48 @@ import com.google.common.base.Predicates; import com.google.common.collect.Iterables; +/** + * Utility class that provides useful methods for {@link org.nuiton.topia.persistence.TopiaEntity} manipulation. + * + * @author Brendan Le Ny : leny@codelutin.com + * @author Arnaud Thimel : thimel@codelutin.com + * @since 3.0 + */ public class TopiaEntities { + /** + * Guava's {@link com.google.common.base.Function} to get a topiaId from any + * {@link org.nuiton.topia.persistence.TopiaEntity} + */ protected static final Function<TopiaEntity, String> GET_TOPIA_ID = new Function<TopiaEntity, String>() { - @Override public String apply(TopiaEntity input) { return input == null ? null : input.getTopiaId(); } }; + /** + * Creates a Guava's {@link com.google.common.base.Predicate} which tests if a + * {@link org.nuiton.topia.persistence.TopiaEntity} has the given {@code topiaId} + * + * @param id the expected topiaId + * @return the created Predicate + */ protected static Predicate<TopiaEntity> entityHasId(String id) { - return Predicates.compose(Predicates.equalTo(id), GET_TOPIA_ID); + Predicate<String> equalsPredicate = Predicates.equalTo(id); + Predicate<TopiaEntity> result = Predicates.compose(equalsPredicate, GET_TOPIA_ID); + return result; } + /** + * Iterate over the given {@link java.lang.Iterable} looking for a {@link org.nuiton.topia.persistence.TopiaEntity} + * having the given {@code topiaId}. + * + * @param entities the {@link java.lang.Iterable} instance to iterate through + * @param id the expected {@code topiaId} + * @param <E> the type of {@link org.nuiton.topia.persistence.TopiaEntity} of the given Iterable + * @return the found {@link org.nuiton.topia.persistence.TopiaEntity} or null + */ public static <E extends TopiaEntity> E findByTopiaId(Iterable<E> entities, String id) { E result; if (entities == null) { @@ -56,7 +84,7 @@ } /** - * Function to obtain {@link TopiaEntity#getTopiaId()} from any entity. + * Function to obtain {@link org.nuiton.topia.persistence.TopiaEntity#getTopiaId()} from any entity. * * @since 2.6.12 */ Modified: trunk/topia-persistence/src/main/java/org/nuiton/topia/persistence/TopiaEntity.java =================================================================== --- trunk/topia-persistence/src/main/java/org/nuiton/topia/persistence/TopiaEntity.java 2014-01-17 17:38:55 UTC (rev 2981) +++ trunk/topia-persistence/src/main/java/org/nuiton/topia/persistence/TopiaEntity.java 2014-01-17 22:38:39 UTC (rev 2982) @@ -31,15 +31,13 @@ import java.util.List; /** - * The TopiaEntity is the main interface for each entity generated. + * The TopiaEntity is the main interface for each generated entity. + * <p/> + * An entity is just a persistent bean mapped with Hibernate. The manipulation on entities (create, update, delete, + * find) is made by the associated {@link org.nuiton.topia.persistence.TopiaDao}. + * <p/> + * Setter methods have to be used only in internal. They are in the interface to make easier their usages in internal. * - * <p>An entity is simply a persistent bean mapped with - * Hibernate. The manipulation on entities (create, update, delete, find) is made by the DAO associated. The - * corresponding Dao interface is {@link org.nuiton.topia.persistence.TopiaDao}.</p> - * - * <p>Setter methods have to be used only in internal. They are in the interface to make easier their usages in - * internal.</p> - * * @author poussin <poussin@codelutin.com> * @author fdesbois <fdesbois@codelutin.com> */ @@ -82,62 +80,56 @@ String AGGREGATE = "aggregate"; /** - * Unique technical Id of the entity. This id contains the full qualified - * name of the entity interface. This id has also an index and is used to - * identify uniquely the entity in the database. + * Unique technical Id of the entity. This id contains the fully qualified name of the entity interface. This id + * also has an index and is used to uniquely identify the entity in the database. * * @return the technical Id of the entity */ String getTopiaId(); /** - * Set the technical {@code id} of the entity. Careful, use this method only - * for copy. The technical id is generated by ToPIA when entity is created - * using {@link org.nuiton.topia.persistence.TopiaDao#create()}. + * Set the technical {@code id} of the entity. Make sure to use this method only for copy. The technical id is + * generated by ToPIA when the entity is persisted using the {@link org.nuiton.topia.persistence.TopiaDao#create()} + * methods. * * @param id technical id to set */ void setTopiaId(String id); /** - * Technical property to keep versionning of the entity. The version is - * incremented on each change of the entity. + * Technical property to keep versionning of the entity. The version is incremented on each change of the entity. * * @return the current version of the entity */ long getTopiaVersion(); /** - * Set the technical {@code version} of the entity. Careful, use this method - * only for copy. The version is automatically incremented on entity - * changes. + * Set the technical {@code version} of the entity. Make sure to use this method only for copy. The version is + * automatically incremented on entity changes. * * @param version technical version to set */ void setTopiaVersion(long version); /** - * Technical date creation of the entity. This date doesn't change through - * time and was initialized on entity creation when using {@link - * org.nuiton.topia.persistence.TopiaDao#create()}. + * Technical date creation of the entity. This date doesn't change through time and was initialized on entity + * creation when using the {@link org.nuiton.topia.persistence.TopiaDao#create()} methods. * * @return the creation date of the entity */ Date getTopiaCreateDate(); /** - * Set the technical creation {@code date} of the entity. Careful, use this - * method only for copy. This date is immutable and was created on entity - * creation. + * Set the technical creation {@code date} of the entity. Make sure to use this method only for copy. This date is + * immutable and was created on entity creation. * * @param date technical create date to set */ void setTopiaCreateDate(Date date); /** - * This method must be used to know if the current entity is present on the - * persistent support. If the entity is not yet persisted or if the entity - * has been removed, this method will return false. + * This method must be used to know if the current entity is present on the persistent support. If the entity is not + * yet persisted or if the entity has been removed, this method will return false. * * @return true if the entity is persisted and not yet deleted * @since 3.0 @@ -145,130 +137,183 @@ boolean isPersisted(); /** - * Notifies the current entity instance than it has been removed from the - * persistent support. + * Notifies the current entity instance than it has been removed from the persistent support. * * @since 3.0 */ void notifyDeleted(); /** - * @return all object that must be deleted if this object is deleted - * @throws TopiaException if any pb - * @deprecated from 3.0, method will be moved to entity's generated DAO (cf http://nuiton.org/issues/2776) + * @return all objects that must be deleted if this object is deleted + * @deprecated from 3.0, method will be moved to entity's generated Dao(cf http://nuiton.org/issues/2776) */ @Deprecated - List<TopiaEntity> getComposite() throws TopiaException; + List<TopiaEntity> getComposite(); /** - * @return all object that are aggregate with this instance, aggregate object - * are not removed automatically - * @throws TopiaException if any pb - * @deprecated from 3.0, method will be moved to entity's generated DAO (cf http://nuiton.org/issues/2776) + * @return all objects that are aggregate with this instance, aggregate object are not removed automatically + * @deprecated from 3.0, method will be moved to entity's generated Dao (cf http://nuiton.org/issues/2776) */ @Deprecated - List<TopiaEntity> getAggregate() throws TopiaException; + List<TopiaEntity> getAggregate(); /** * Route the entity using a {@code visitor}. * * @param visitor to used - * @throws TopiaException for all type of error */ - void accept(EntityVisitor visitor) throws TopiaException; + void accept(TopiaEntityVisitor visitor); //------------------------------------------------------------------------// //-- PropertyListener (read) methods -------------------------------------// //------------------------------------------------------------------------// /** - * Add listener for property reading. + * Adds a {@link java.beans.PropertyChangeListener} on any property reading. * * @param listener the listener to register + * @see java.beans.PropertyChangeSupport */ - // TODO AThimel 20/07/13 Javadoc void addPropertyListener(PropertyChangeListener listener); /** - * Add listener for property reading. + * Adds a {@link java.beans.PropertyChangeListener} on the given property reading. * * @param propertyName the property name to listen * @param listener the listener to register + * @see java.beans.PropertyChangeSupport */ - // TODO AThimel 20/07/13 Javadoc - void addPropertyListener(String propertyName, - PropertyChangeListener listener); + void addPropertyListener(String propertyName, PropertyChangeListener listener); - // TODO AThimel 20/07/13 Javadoc + /** + * Remove the given {@link java.beans.PropertyChangeListener} registered for any property reading. + * + * @param listener the listener to unregister + * @see java.beans.PropertyChangeSupport + */ void removePropertyListener(PropertyChangeListener listener); - // TODO AThimel 20/07/13 Javadoc - void removePropertyListener(String propertyName, - PropertyChangeListener listener); + /** + * Remove the given {@link java.beans.PropertyChangeListener} registered the given property reading. + * + * @param propertyName the property name to unregister reading + * @param listener the listener to unregister + * @see java.beans.PropertyChangeSupport + */ + void removePropertyListener(String propertyName, PropertyChangeListener listener); //------------------------------------------------------------------------// //-- PropertyChangeListener (write) methods ------------------------------// //------------------------------------------------------------------------// /** - * Add listener for property writing. + * Adds a {@link java.beans.PropertyChangeListener} on any property writing. * * @param listener the listener to register + * @see java.beans.PropertyChangeSupport */ - // TODO AThimel 20/07/13 Javadoc void addPropertyChangeListener(PropertyChangeListener listener); /** - * Add listener for property writing. + * Adds a {@link java.beans.PropertyChangeListener} on the given property writing. * - * @param propertyName name of property to listen + * @param propertyName the property name to listen * @param listener the listener to register + * @see java.beans.PropertyChangeSupport */ - // TODO AThimel 20/07/13 Javadoc - void addPropertyChangeListener(String propertyName, - PropertyChangeListener listener); + void addPropertyChangeListener(String propertyName, PropertyChangeListener listener); - // TODO AThimel 20/07/13 Javadoc + /** + * Remove the given {@link java.beans.PropertyChangeListener} registered for any property writing. + * + * @param listener the listener to unregister + * @see java.beans.PropertyChangeSupport + */ void removePropertyChangeListener(PropertyChangeListener listener); - // TODO AThimel 20/07/13 Javadoc - void removePropertyChangeListener(String propertyName, - PropertyChangeListener listener); + /** + * Remove the given {@link java.beans.PropertyChangeListener} registered the given property writing. + * + * @param propertyName the property name to unregister writing + * @param listener the listener to unregister + * @see java.beans.PropertyChangeSupport + */ + void removePropertyChangeListener(String propertyName, PropertyChangeListener listener); //------------------------------------------------------------------------// //-- VetoableListener (read) methods -------------------------------------// //------------------------------------------------------------------------// - // TODO AThimel 20/07/13 Javadoc + /** + * Adds a {@link java.beans.VetoableChangeListener} on any property reading. + * + * @param vetoable the listener to register + * @see java.beans.VetoableChangeSupport + */ void addVetoableListener(VetoableChangeListener vetoable); - // TODO AThimel 20/07/13 Javadoc - void addVetoableListener(String propertyName, - VetoableChangeListener vetoable); + /** + * Adds a {@link java.beans.VetoableChangeListener} on the given property reading. + * + * @param propertyName the property name to listen + * @param vetoable the listener to register + * @see java.beans.VetoableChangeSupport + */ + void addVetoableListener(String propertyName, VetoableChangeListener vetoable); - // TODO AThimel 20/07/13 Javadoc + /** + * Remove the given {@link java.beans.VetoableChangeListener} registered for any property reading. + * + * @param vetoable the listener to unregister + * @see java.beans.VetoableChangeSupport + */ void removeVetoableListener(VetoableChangeListener vetoable); - // TODO AThimel 20/07/13 Javadoc - void removeVetoableListener(String propertyName, - VetoableChangeListener vetoable); + /** + * Remove the given {@link java.beans.VetoableChangeListener} registered the given property reading. + * + * @param propertyName the property name to unregister reading + * @param vetoable the listener to unregister + * @see java.beans.VetoableChangeSupport + */ + void removeVetoableListener(String propertyName, VetoableChangeListener vetoable); //------------------------------------------------------------------------// //-- VetoableChangeListener (write) methods ------------------------------// //------------------------------------------------------------------------// - // TODO AThimel 20/07/13 Javadoc + /** + * Adds a {@link java.beans.VetoableChangeListener} on any property writing. + * + * @param vetoable the listener to register + * @see java.beans.VetoableChangeSupport + */ void addVetoableChangeListener(VetoableChangeListener vetoable); - // TODO AThimel 20/07/13 Javadoc - void addVetoableChangeListener(String propertyName, - VetoableChangeListener vetoable); + /** + * Adds a {@link java.beans.VetoableChangeListener} on the given property writing. + * + * @param propertyName the property name to listen + * @param vetoable the listener to register + * @see java.beans.VetoableChangeSupport + */ + void addVetoableChangeListener(String propertyName, VetoableChangeListener vetoable); - // TODO AThimel 20/07/13 Javadoc + /** + * Remove the given {@link java.beans.VetoableChangeListener} registered for any property writing. + * + * @param vetoable the listener to unregister + * @see java.beans.VetoableChangeSupport + */ void removeVetoableChangeListener(VetoableChangeListener vetoable); - // TODO AThimel 20/07/13 Javadoc - void removeVetoableChangeListener(String propertyName, - VetoableChangeListener vetoable); + /** + * Remove the given {@link java.beans.VetoableChangeListener} registered the given property writing. + * + * @param propertyName the property name to unregister writing + * @param vetoable the listener to unregister + * @see java.beans.VetoableChangeSupport + */ + void removeVetoableChangeListener(String propertyName, VetoableChangeListener vetoable); -} //TopiaEntity +} Modified: trunk/topia-persistence/src/main/java/org/nuiton/topia/persistence/TopiaEntityContextable.java =================================================================== --- trunk/topia-persistence/src/main/java/org/nuiton/topia/persistence/TopiaEntityContextable.java 2014-01-17 17:38:55 UTC (rev 2981) +++ trunk/topia-persistence/src/main/java/org/nuiton/topia/persistence/TopiaEntityContextable.java 2014-01-17 22:38:39 UTC (rev 2982) @@ -27,6 +27,8 @@ /** * {@link TopiaEntity} with {@link org.nuiton.topia.persistence.TopiaDaoSupplier} support (injected by * {@link org.nuiton.topia.persistence.internal.AbstractTopiaDao} into entities). + * <p/> + * WARNING, it is not recommended to use this mechanism as it breaks the POJO's Hibernate approach. * * @author chatellier */ @@ -42,8 +44,17 @@ */ void delete(); - void setTopiaDAOSupplier(TopiaDaoSupplier topiaDAO); + /** + * Injects into this entity the given {@link org.nuiton.topia.persistence.TopiaDaoSupplier}, which can be used to + * get any Dao instance. This is used to make {@link #update()} and {@link #delete()} implementation possible. + * + * @param topiaDaoSupplier an initialized {@link org.nuiton.topia.persistence.TopiaDaoSupplier} instance + */ + void setTopiaDaoSupplier(TopiaDaoSupplier topiaDaoSupplier); - TopiaDaoSupplier getTopiaDAOSupplier(); + /** + * @return the currently injected {@link org.nuiton.topia.persistence.TopiaDaoSupplier} + */ + TopiaDaoSupplier getTopiaDaoSupplier(); } Copied: trunk/topia-persistence/src/main/java/org/nuiton/topia/persistence/TopiaEntityVisitor.java (from rev 2981, trunk/topia-persistence/src/main/java/org/nuiton/topia/persistence/EntityVisitor.java) =================================================================== --- trunk/topia-persistence/src/main/java/org/nuiton/topia/persistence/TopiaEntityVisitor.java (rev 0) +++ trunk/topia-persistence/src/main/java/org/nuiton/topia/persistence/TopiaEntityVisitor.java 2014-01-17 22:38:39 UTC (rev 2982) @@ -0,0 +1,112 @@ +package org.nuiton.topia.persistence; + +/* + * #%L + * ToPIA :: Persistence + * $Id$ + * $HeadURL$ + * %% + * Copyright (C) 2004 - 2014 CodeLutin + * %% + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as + * published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Lesser Public License for more details. + * + * You should have received a copy of the GNU General Lesser Public + * License along with this program. If not, see + * <http://www.gnu.org/licenses/lgpl-3.0.html>. + * #L% + */ + +/** + * Visitor contract for any {@link TopiaEntity}. + * <p/> + * Created: 28 janv. 2009 18:10:34 + * + * @author bpoussin <poussin@codelutin.com> + * @author tchemit <chemit@codelutin.com> + */ +public interface TopiaEntityVisitor { + + /** + * Start the visit of the given entity. + * + * @param entity the visited entity + */ + void start(TopiaEntity entity); + + /** + * Ends the visit of the given entity. + * + * @param entity the visited entity + */ + void end(TopiaEntity entity); + + /** + * Visit a none indexed property for the given entity. + * <p/> + * The property visited is defined by the other parameters. + * + * @param entity the visited entity + * @param propertyName the name of the visited property + * @param type the type of the visited property + * @param value the value of the visited property + */ + void visit(TopiaEntity entity, + String propertyName, + Class<?> type, + Object value); + + /** + * Visit a collection property for the given entity. + * <p/> + * The property visited is defined by the other parameters. + * + * @param entity the visited entity + * @param propertyName the name of the visited property + * @param collectionType the type of the visited collection + * @param type the type of the visited property + * @param value the value of the visited property + */ + void visit(TopiaEntity entity, + String propertyName, + Class<?> collectionType, + Class<?> type, + Object value); + + /** + * Visit a indexed value from a collection property for the given entity. + * <p/> + * The property visited is defined by the other parameters. + * + * @param entity the visited entity + * @param propertyName the name of the visited property + * @param collectionType the type of the container of the visited property + * @param type the type of the visited property + * @param index the index of the visited property in his container + * @param value the value of the visited property + */ + void visit(TopiaEntity entity, + String propertyName, + Class<?> collectionType, + Class<?> type, + int index, + Object value); + + /** + * Reset all states of the visitor. + * <p/> + * If you use internal states inside the visitor, this method should clean + * all of them. + * <p/> + * This method should be invoked after usage of the visitor. + */ + void clear(); + +} Modified: trunk/topia-persistence/src/main/java/org/nuiton/topia/persistence/TopiaException.java =================================================================== --- trunk/topia-persistence/src/main/java/org/nuiton/topia/persistence/TopiaException.java 2014-01-17 17:38:55 UTC (rev 2981) +++ trunk/topia-persistence/src/main/java/org/nuiton/topia/persistence/TopiaException.java 2014-01-17 22:38:39 UTC (rev 2982) @@ -34,7 +34,6 @@ */ public class TopiaException extends RuntimeException { - /** Version UID */ private static final long serialVersionUID = -1251439453383121393L; /** Modified: trunk/topia-persistence/src/main/java/org/nuiton/topia/persistence/TopiaIdFactory.java =================================================================== --- trunk/topia-persistence/src/main/java/org/nuiton/topia/persistence/TopiaIdFactory.java 2014-01-17 17:38:55 UTC (rev 2981) +++ trunk/topia-persistence/src/main/java/org/nuiton/topia/persistence/TopiaIdFactory.java 2014-01-17 22:38:39 UTC (rev 2982) @@ -25,9 +25,13 @@ */ /** - * This API represents an ID generation strategy + * This contract represents a topiaId generation strategy. * <p/> - * // TODO AThimel 20/07/13 Javadoc (finish this javadoc) + * It can be used in both ways : + * <ul> + * <li>generate a new topiaId from a given class;</li> + * <li>retrieves a class or random part from a given topiaId.</li> + * </ul> * * @author bleny <leny@codelutin.com/> * @author tchemit <chemit@codelutin.com/> @@ -36,30 +40,31 @@ public interface TopiaIdFactory { /** - * Generates a new topia id for the given entity type and the given entity. + * Generates a new topiaId for the given entity type and the given entity. * * @param entityClass type of entity (must be a not null interface) * @param topiaEntity the entity on which we want to generate the id (must be not null) * @param <E> type of entity - * @return the new topia id for the given entity + * @return the new topiaId for the given entity */ <E extends TopiaEntity> String newTopiaId(Class<E> entityClass, TopiaEntity topiaEntity); /** - * @param topiaId the topia id to inspect + * @param topiaId the topiaId to inspect * @param <E> type of the entity - * @return the fqn part of the topia id + * @return the FQN part of the topiaId */ <E extends TopiaEntity> Class<E> getClassName(String topiaId); /** - * @param topiaId the topia id to inspect - * @return the random poart of the topia id. + * @param topiaId the topiaId to inspect + * @return the random part of the topiaId. */ String getRandomPart(String topiaId); /** - * @return the separator between the fqn and the random part of any topia id. + * @return the separator between the FQN and the random part of any topiaId. */ String getSeparator(); + } Modified: trunk/topia-persistence/src/main/java/org/nuiton/topia/persistence/TopiaPersistenceContext.java =================================================================== --- trunk/topia-persistence/src/main/java/org/nuiton/topia/persistence/TopiaPersistenceContext.java 2014-01-17 17:38:55 UTC (rev 2981) +++ trunk/topia-persistence/src/main/java/org/nuiton/topia/persistence/TopiaPersistenceContext.java 2014-01-17 22:38:39 UTC (rev 2982) @@ -80,9 +80,8 @@ * * @param entities the entities to delete */ - <E extends TopiaEntity> void deleteAll(Iterable<E> entities); + <E extends TopiaEntity> void deleteAll(Iterable<E> entities); - /** * Get the currently configured {@link TopiaIdFactory}. * Modified: trunk/topia-persistence/src/main/java/org/nuiton/topia/persistence/TopiaTransaction.java =================================================================== --- trunk/topia-persistence/src/main/java/org/nuiton/topia/persistence/TopiaTransaction.java 2014-01-17 17:38:55 UTC (rev 2981) +++ trunk/topia-persistence/src/main/java/org/nuiton/topia/persistence/TopiaTransaction.java 2014-01-17 22:38:39 UTC (rev 2982) @@ -25,7 +25,7 @@ */ /** - * This API provides methods to manipulate transaction + * This contract provides methods to manipulate transaction * * @author Arnaud Thimel : thimel@codelutin.com * @since 3.0 @@ -33,15 +33,20 @@ public interface TopiaTransaction { /** - * Applies all the modifications made to this context on the persistence - * device. Once commit is done, a new transaction is started. + * Applies all the modifications made to this context on the persistence device. + * <p/> + * Once commit is done, a new internal transaction is started, but you do not have to get a new instance of + * {@link TopiaTransaction}. */ void commit(); /** - * Cancels all the modifications made to this context, coming back to the - * state on the last beginTransaction. Once rollback is done, a new - * transaction is started. + * Cancels all the modifications made to this context, coming back to the state when this transaction has been + * created (using {@link TopiaApplicationContext#newPersistenceContext()}) or previously rollbacked (using the + * current method). + * <p/> + * Once rollback is done, a new internal transaction is started, but you do not have to get a new instance of + * {@link TopiaTransaction}. */ void rollback(); Modified: trunk/topia-persistence/src/main/java/org/nuiton/topia/persistence/TopiaTransactionAware.java =================================================================== --- trunk/topia-persistence/src/main/java/org/nuiton/topia/persistence/TopiaTransactionAware.java 2014-01-17 17:38:55 UTC (rev 2981) +++ trunk/topia-persistence/src/main/java/org/nuiton/topia/persistence/TopiaTransactionAware.java 2014-01-17 22:38:39 UTC (rev 2982) @@ -34,6 +34,7 @@ * * @author tchemit <chemit@codelutin.com> * @since 2.6.1 + * @deprecated This is probably not useful anymore. */ public interface TopiaTransactionAware { Modified: trunk/topia-persistence/src/main/java/org/nuiton/topia/persistence/internal/AbstractTopiaDao.java =================================================================== --- trunk/topia-persistence/src/main/java/org/nuiton/topia/persistence/internal/AbstractTopiaDao.java 2014-01-17 17:38:55 UTC (rev 2981) +++ trunk/topia-persistence/src/main/java/org/nuiton/topia/persistence/internal/AbstractTopiaDao.java 2014-01-17 22:38:39 UTC (rev 2982) @@ -228,7 +228,7 @@ if (entity instanceof TopiaEntityContextable) { TopiaEntityContextable contextable = (TopiaEntityContextable) entity; - contextable.setTopiaDAOSupplier(this.topiaDaoSupplier); + contextable.setTopiaDaoSupplier(this.topiaDaoSupplier); } // save entity Modified: trunk/topia-persistence/src/main/java/org/nuiton/topia/persistence/internal/AbstractTopiaEntity.java =================================================================== --- trunk/topia-persistence/src/main/java/org/nuiton/topia/persistence/internal/AbstractTopiaEntity.java 2014-01-17 17:38:55 UTC (rev 2981) +++ trunk/topia-persistence/src/main/java/org/nuiton/topia/persistence/internal/AbstractTopiaEntity.java 2014-01-17 22:38:39 UTC (rev 2982) @@ -58,15 +58,39 @@ transient protected TopiaFiresSupport fireSupport; + transient protected PropertyChangeSupport readListeners; + + transient protected PropertyChangeSupport writeListeners; + transient protected VetoableChangeSupport readVetoables; - transient protected PropertyChangeSupport readListeners; - transient protected VetoableChangeSupport writeVetoables; - transient protected PropertyChangeSupport writeListeners; + /** + * Initialize {@link #readListeners} at first use or after deserialisation. + * + * @return readListeners + */ + protected PropertyChangeSupport getReadPropertyChangeSupport() { + if (readListeners == null) { + readListeners = new PropertyChangeSupport(this); + } + return readListeners; + } /** + * Initialize {@link #writeListeners} at first use or after deserialisation. + * + * @return writeListeners + */ + protected PropertyChangeSupport getWritePropertyChangeSupport() { + if (writeListeners == null) { + writeListeners = new PropertyChangeSupport(this); + } + return writeListeners; + } + + /** * Initialize {@link #readVetoables} at first use or after deserialisation. * * @return readVetoables @@ -79,18 +103,6 @@ } /** - * Initialize {@link #readListeners} at first use or after deserialisation. - * - * @return readListeners - */ - protected PropertyChangeSupport getReadPropertyChangeSupport() { - if (readListeners == null) { - readListeners = new PropertyChangeSupport(this); - } - return readListeners; - } - - /** * Initialize {@link #writeVetoables} at first use or after deserialisation. * * @return writeVetoables @@ -102,18 +114,6 @@ return writeVetoables; } - /** - * Initialize {@link #writeListeners} at first use or after deserialisation. - * - * @return writeListeners - */ - protected PropertyChangeSupport getWritePropertyChangeSupport() { - if (writeListeners == null) { - writeListeners = new PropertyChangeSupport(this); - } - return writeListeners; - } - @Override public String getTopiaId() { return topiaId; @@ -208,7 +208,7 @@ if (fireSupport == null) { if (this instanceof TopiaEntityContextable) { TopiaEntityContextable contextable = (TopiaEntityContextable) this; - AbstractTopiaDao topiaDAO = (AbstractTopiaDao)contextable.getTopiaDAOSupplier().getDao(getClass()); + AbstractTopiaDao topiaDAO = (AbstractTopiaDao)contextable.getTopiaDaoSupplier().getDao(getClass()); fireSupport = topiaDAO.getTopiaFiresSupport(); } } Modified: trunk/topia-persistence/src/main/java/org/nuiton/topia/persistence/internal/DefaultTopiaIdFactory.java =================================================================== --- trunk/topia-persistence/src/main/java/org/nuiton/topia/persistence/internal/DefaultTopiaIdFactory.java 2014-01-17 17:38:55 UTC (rev 2981) +++ trunk/topia-persistence/src/main/java/org/nuiton/topia/persistence/internal/DefaultTopiaIdFactory.java 2014-01-17 22:38:39 UTC (rev 2982) @@ -24,16 +24,15 @@ * #L% */ +import java.util.UUID; + import org.apache.commons.lang3.StringUtils; import org.nuiton.topia.persistence.TopiaEntity; import org.nuiton.topia.persistence.TopiaException; import org.nuiton.topia.persistence.TopiaIdFactory; -import java.util.UUID; - /** - * Default implementation of {@link TopiaIdFactory}. Generates an FQN followed - * by an random UUID. + * Default implementation of {@link TopiaIdFactory}. Generates a FQN followed by a random UUID. * * @author Brendan Le Ny <leny@codelutin.com> * @since 3.0 @@ -52,7 +51,6 @@ @Override public <E extends TopiaEntity> Class<E> getClassName(String topiaId) { -// String className = Iterables.get(Splitter.on(getSeparator()).split(topiaId), 0); String className = StringUtils.substringBefore(topiaId, getSeparator()); try { Class<E> entityClass = (Class<E>) Class.forName(className); Modified: trunk/topia-persistence/src/main/java/org/nuiton/topia/persistence/internal/support/TopiaHibernateEventListener.java =================================================================== --- trunk/topia-persistence/src/main/java/org/nuiton/topia/persistence/internal/support/TopiaHibernateEventListener.java 2014-01-17 17:38:55 UTC (rev 2981) +++ trunk/topia-persistence/src/main/java/org/nuiton/topia/persistence/internal/support/TopiaHibernateEventListener.java 2014-01-17 22:38:39 UTC (rev 2982) @@ -91,9 +91,9 @@ TopiaDaoSupplier daoSupplier) { if (entity instanceof TopiaEntityContextable) { TopiaEntityContextable topiaEntityContextable = (TopiaEntityContextable) entity; - if (topiaEntityContextable.getTopiaDAOSupplier() == null) { + if (topiaEntityContextable.getTopiaDaoSupplier() == null) { try { - topiaEntityContextable.setTopiaDAOSupplier(daoSupplier); + topiaEntityContextable.setTopiaDaoSupplier(daoSupplier); } catch (TopiaException eee) { if (log.isWarnEnabled()) { log.warn("Impossible d'initialiser le TopiaContext" Modified: trunk/topia-persistence/src/main/java/org/nuiton/topia/persistence/package-info.java =================================================================== --- trunk/topia-persistence/src/main/java/org/nuiton/topia/persistence/package-info.java 2014-01-17 17:38:55 UTC (rev 2981) +++ trunk/topia-persistence/src/main/java/org/nuiton/topia/persistence/package-info.java 2014-01-17 22:38:39 UTC (rev 2982) @@ -23,7 +23,7 @@ */ /** - * This package contains most of the needed contracts when using ToPIA. + * <p>This package contains most of the needed contracts when using ToPIA.</p> * * <p>To manipulate ToPIA you need to understand the role of both interfaces * {@link org.nuiton.topia.persistence.TopiaApplicationContext} and Modified: trunk/topia-persistence/src/test/java/org/nuiton/topia/persistence/DefaultTopiaIdFactoryTest.java =================================================================== --- trunk/topia-persistence/src/test/java/org/nuiton/topia/persistence/DefaultTopiaIdFactoryTest.java 2014-01-17 17:38:55 UTC (rev 2981) +++ trunk/topia-persistence/src/test/java/org/nuiton/topia/persistence/DefaultTopiaIdFactoryTest.java 2014-01-17 22:38:39 UTC (rev 2982) @@ -39,7 +39,7 @@ class EntityAImpl extends AbstractTopiaEntity implements EntityA { @Override - public void accept(EntityVisitor visitor) throws TopiaException { + public void accept(TopiaEntityVisitor visitor) throws TopiaException { } } @@ -49,7 +49,7 @@ class EntityBImpl extends AbstractTopiaEntity implements EntityB { @Override - public void accept(EntityVisitor visitor) throws TopiaException { + public void accept(TopiaEntityVisitor visitor) throws TopiaException { } } Modified: trunk/topia-service-csv/src/main/java/org/nuiton/topia/service/csv/out/ExportEntityVisitor.java =================================================================== --- trunk/topia-service-csv/src/main/java/org/nuiton/topia/service/csv/out/ExportEntityVisitor.java 2014-01-17 17:38:55 UTC (rev 2981) +++ trunk/topia-service-csv/src/main/java/org/nuiton/topia/service/csv/out/ExportEntityVisitor.java 2014-01-17 22:38:39 UTC (rev 2982) @@ -28,8 +28,8 @@ import org.apache.commons.collections.CollectionUtils; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; +import org.nuiton.topia.persistence.TopiaEntityVisitor; import org.nuiton.topia.persistence.TopiaException; -import org.nuiton.topia.persistence.EntityVisitor; import org.nuiton.topia.persistence.TopiaEntity; import org.nuiton.topia.persistence.TopiaEntityEnum; import org.nuiton.topia.persistence.TopiaPersistenceHelper; @@ -46,7 +46,7 @@ * @author tchemit <chemit@codelutin.com> * @since 2.6.12 */ -public class ExportEntityVisitor<T extends TopiaEntityEnum> implements EntityVisitor, Closeable { +public class ExportEntityVisitor<T extends TopiaEntityEnum> implements TopiaEntityVisitor, Closeable { /** Logger. */ private static final Log log = LogFactory.getLog(ExportEntityVisitor.class); Modified: trunk/topia-templates/src/main/java/org/nuiton/topia/templates/EntityHibernateMappingGenerator.java =================================================================== --- trunk/topia-templates/src/main/java/org/nuiton/topia/templates/EntityHibernateMappingGenerator.java 2014-01-17 17:38:55 UTC (rev 2981) +++ trunk/topia-templates/src/main/java/org/nuiton/topia/templates/EntityHibernateMappingGenerator.java 2014-01-17 22:38:39 UTC (rev 2982) @@ -615,10 +615,6 @@ /** * Generate hibernate xml attribute with a final space. - * @param attributeName - * @param tagValue - * @param defaultValue - * @return */ private String generateFromTagValue(String attributeName, String tagValue, String defaultValue) { String result = ""; Modified: trunk/topia-templates/src/main/java/org/nuiton/topia/templates/EntityTransformer.java =================================================================== --- trunk/topia-templates/src/main/java/org/nuiton/topia/templates/EntityTransformer.java 2014-01-17 17:38:55 UTC (rev 2981) +++ trunk/topia-templates/src/main/java/org/nuiton/topia/templates/EntityTransformer.java 2014-01-17 22:38:39 UTC (rev 2982) @@ -39,10 +39,10 @@ import org.nuiton.eugene.models.object.ObjectModelModifier; import org.nuiton.eugene.models.object.ObjectModelOperation; import org.nuiton.eugene.models.object.ObjectModelParameter; +import org.nuiton.topia.persistence.TopiaEntityVisitor; import org.nuiton.topia.persistence.internal.AbstractTopiaEntity; import org.nuiton.topia.persistence.TopiaDaoSupplier; import org.nuiton.topia.persistence.TopiaException; -import org.nuiton.topia.persistence.EntityVisitor; import org.nuiton.topia.persistence.TopiaEntity; import org.nuiton.topia.persistence.TopiaEntityContextable; import org.nuiton.topia.persistence.util.TopiaEntityHelper; @@ -352,7 +352,7 @@ "instance. For internal usage only"); ObjectModelOperation op = addOperation(outputAbstract, - "getTopiaDAOSupplier", TopiaDaoSupplier.class, + "getTopiaDaoSupplier", TopiaDaoSupplier.class, ObjectModelJavaModifier.PUBLIC); setDocumentation(op,"@since 3.0"); addAnnotation(outputAbstract, op, Override.class); @@ -363,7 +363,7 @@ ); op = addOperation(outputAbstract, - "setTopiaDAOSupplier", "void", + "setTopiaDaoSupplier", "void", ObjectModelJavaModifier.PUBLIC); addException(op, TopiaException.class); addParameter(op, TopiaDaoSupplier.class, "topiaDaoSupplier"); @@ -389,7 +389,7 @@ addAnnotation(outputAbstract, op, Override.class); setOperationBody(op, "" /*{ - getTopiaDAOSupplier().getDao(<%=input.getName()%>.class).update(this); + getTopiaDaoSupplier().getDao(<%=input.getName()%>.class).update(this); }*/ ); @@ -399,7 +399,7 @@ addAnnotation(outputAbstract, op, Override.class); setOperationBody(op, "" /*{ - getTopiaDAOSupplier().getDao(<%=input.getName()%>.class).delete(this); + getTopiaDaoSupplier().getDao(<%=input.getName()%>.class).delete(this); }*/ ); } @@ -1293,7 +1293,7 @@ acceptOperation = addOperation(outputAbstract, "accept", void.class); addAnnotation(outputAbstract, acceptOperation , Override.class); ObjectModelParameter param = - addParameter(acceptOperation, EntityVisitor.class, "visitor"); + addParameter(acceptOperation, TopiaEntityVisitor.class, "visitor"); addException(acceptOperation, TopiaException.class); Modified: trunk/topia-templates/src/main/java/org/nuiton/topia/templates/TopiaTagValues.java =================================================================== --- trunk/topia-templates/src/main/java/org/nuiton/topia/templates/TopiaTagValues.java 2014-01-17 17:38:55 UTC (rev 2981) +++ trunk/topia-templates/src/main/java/org/nuiton/topia/templates/TopiaTagValues.java 2014-01-17 22:38:39 UTC (rev 2982) @@ -30,12 +30,7 @@ import org.nuiton.eugene.models.object.ObjectModelClass; import org.nuiton.eugene.models.object.ObjectModelClassifier; import org.nuiton.eugene.models.object.ObjectModelElement; -import org.nuiton.topia.persistence.internal.AbstractTopiaApplicationContext; -import org.nuiton.topia.persistence.internal.AbstractTopiaPersistenceContext; import org.nuiton.topia.persistence.TopiaDaoSupplier; -import org.nuiton.topia.persistence.internal.AbstractTopiaDao; -import org.nuiton.topia.persistence.TopiaDao; -import org.nuiton.topia.persistence.TopiaEntity; import org.nuiton.topia.persistence.TopiaEntityContextable; import static org.nuiton.eugene.ModelPropertiesUtil.TagValueDefinition; @@ -56,7 +51,7 @@ * @since 2.5 */ @TagValueDefinition(target = {ObjectModelClassifier.class}, - documentation = "") + documentation = "") String TAG_PERSISTENCE_TYPE = "persistenceType"; /** @@ -77,7 +72,7 @@ * @see TopiaGeneratorUtil#getReverseDbName(ObjectModelAttribute) */ @TagValueDefinition(target = {ObjectModelElement.class}, - documentation = "Sets the database name of an element of the model (a table or a column)") + documentation = "Sets the database name of an element of the model (a table or a column)") String TAG_DB_NAME = "dbName"; /** @@ -88,7 +83,7 @@ * @since 2.5 */ @TagValueDefinition(target = {ObjectModel.class, ObjectModelClassifier.class, ObjectModelAttribute.class}, - documentation = "Sets the database schema name") + documentation = "Sets the database schema name") String TAG_SCHEMA_NAME = "dbSchema"; /** @@ -98,7 +93,7 @@ * @since 2.5 */ @TagValueDefinition(target = {ObjectModelAttribute.class}, - documentation = "Sets the length of an attribute in database") + documentation = "Sets the length of an attribute in database") String TAG_LENGTH = "length"; /** @@ -108,7 +103,7 @@ * @since 2.5 */ @TagValueDefinition(target = {ObjectModelAttribute.class}, - documentation = "Sets an annotation of an attribute") + documentation = "Sets an annotation of an attribute") String TAG_ANNOTATION = "annotation"; /** @@ -118,7 +113,7 @@ * @since 2.5 */ @TagValueDefinition(target = {ObjectModelAttribute.class}, - documentation = "Sets the access type of an attribute (Hibernate mapping)") + documentation = "Sets the access type of an attribute (Hibernate mapping)") String TAG_ACCESS = "access"; /** @@ -129,7 +124,7 @@ * @since 2.5 */ @TagValueDefinition(target = {ObjectModelAttribute.class}, - documentation = "Sets an attribute as part of a natural id (Hibernate Mapping)") + documentation = "Sets an attribute as part of a natural id (Hibernate Mapping)") String TAG_NATURAL_ID = "naturalId"; /** @@ -140,7 +135,7 @@ * @since 2.5 */ @TagValueDefinition(target = {ObjectModelClassifier.class}, - documentation = "Sets if natural id of a entity is mutable (hibernate mapping)") + documentation = "Sets if natural id of a entity is mutable (hibernate mapping)") String TAG_NATURAL_ID_MUTABLE = "naturalIdMutable"; /** @@ -154,7 +149,7 @@ * @since 2.5 */ @TagValueDefinition(target = {ObjectModelAttribute.class}, - documentation = "Sets which part of a N-N relation is master (inverse=true) and slave (inverse=false) (must be put on each side on a such relation) (Hibernate mapping)") + documentation = "Sets which part of a N-N relation is master (inverse=true) and slave (inverse=false) (must be put on each side on a such relation) (Hibernate mapping)") String TAG_INVERSE = "inverse"; /** @@ -164,7 +159,7 @@ * @since 2.5 */ @TagValueDefinition(target = {ObjectModelAttribute.class}, - documentation = "Sets if an association should be lazy (Hibernate mapping)") + documentation = "Sets if an association should be lazy (Hibernate mapping)") String TAG_LAZY = "lazy"; /** @@ -174,7 +169,7 @@ * @since 2.5 */ @TagValueDefinition(target = {ObjectModelAttribute.class}, - documentation = "Sets the fetch caracteristic of an attribute (Hibernate mapping)") + documentation = "Sets the fetch caracteristic of an attribute (Hibernate mapping)") String TAG_FETCH = "fetch"; /** @@ -184,7 +179,7 @@ * @since 2.5 */ @TagValueDefinition(target = {ObjectModelAttribute.class}, - documentation = "Sets the order by propertie of an multiple association (Hibernate mapping)") + documentation = "Sets the order by propertie of an multiple association (Hibernate mapping)") String TAG_ORDER_BY = "orderBy"; /** @@ -194,7 +189,7 @@ * @since 2.5 */ @TagValueDefinition(target = {ObjectModelAttribute.class}, - documentation = "Sets if an attribute must be not null (Hibernate mapping)") + documentation = "Sets if an attribute must be not null (Hibernate mapping)") String TAG_NOT_NULL = "notNull"; /** @@ -204,7 +199,7 @@ * base */ @TagValueDefinition(target = {ObjectModelAttribute.class}, - documentation = "'true' if the value of this attribute of type Enumeration should be stored with its name (instead of using ordinal)") + documentation = "'true' if the value of this attribute of type Enumeration should be stored with its name (instead of using ordinal)") String TAG_USE_ENUMERATION_NAME = "useEnumerationName"; /** @@ -219,7 +214,7 @@ * @since 2.5 */ @TagValueDefinition(target = {ObjectModel.class, ObjectModelClassifier.class}, - documentation = "Configure the proxy interface on something else than the default implementation (null to use our default implementation, none to let hibernate deal it) (Hibernate mapping)") + documentation = "Configure the proxy interface on something else than the default implementation (null to use our default implementation, none to let hibernate deal it) (Hibernate mapping)") String TAG_PROXY_INTERFACE = "hibernateProxyInterface"; /** @@ -234,7 +229,7 @@ * @since 3.0 */ @TagValueDefinition(target = {ObjectModel.class, ObjectModelClassifier.class}, - documentation = "Configure the proxy interface on something else than the default implementation (null to use our default implementation, none to let hibernate deal it) (Hibernate mapping)") + documentation = "Configure the proxy interface on something else than the default implementation (null to use our default implementation, none to let hibernate deal it) (Hibernate mapping)") String TAG_INHERITANCE_STRATEGY = "inheritanceStrategy"; /** @@ -245,7 +240,7 @@ * @since 2.5 */ @TagValueDefinition(target = {ObjectModel.class, ObjectModelClassifier.class}, - documentation = "To not generate the toString method on entities") + documentation = "To not generate the toString method on entities") String TAG_NOT_GENERATE_TO_STRING = "notGenerateToString"; /** @@ -256,7 +251,7 @@ * @since 2.5 */ @TagValueDefinition(target = {ObjectModel.class, ObjectModelClassifier.class}, - documentation = "To sort attribute while generation") + documentation = "To sort attribute while generation") String TAG_SORT_ATTRIBUTE = "sortAttribute"; /** @@ -267,7 +262,7 @@ * @since 2.5 */ @TagValueDefinition(target = {ObjectModel.class}, - documentation = "To generate EntityOperation on generated DAOHelper") + documentation = "To generate EntityOperation on generated DAOHelper") String TAG_GENERATE_OPERATOR_FOR_DAO_HELPER = "generateOperatorForDAOHelper"; /** @@ -277,7 +272,7 @@ * @since 2.5 */ @TagValueDefinition(target = {ObjectModelAttribute.class}, - documentation = "Sets the hibernate type of an attribute (Hibernate mapping)") + documentation = "Sets the hibernate type of an attribute (Hibernate mapping)") String TAG_TYPE = "type"; /** @@ -287,7 +282,7 @@ * @since 2.5 */ @TagValueDefinition(target = {ObjectModelAttribute.class}, - documentation = "Sets the sql type of an attribute (Hibernate mapping)") + documentation = "Sets the sql type of an attribute (Hibernate mapping)") String TAG_SQL_TYPE = "sqlType"; /** @@ -301,7 +296,7 @@ * @since 2.5 */ @TagValueDefinition(target = {ObjectModel.class}, - documentation = "Sets the fully qualified name of the DAO implementation to use in generated DAO (default is DAOImpl (base on TopiaQuery))") + documentation = "Sets the fully qualified name of the DAO implementation to use in generated DAO (default is DAOImpl (base on TopiaQuery))") String TAG_DAO_IMPLEMENTATION = "daoImplementation"; /** @@ -311,7 +306,7 @@ * @since 2.6.5 */ @TagValueDefinition(target = {ObjectModel.class, ObjectModelAttribute.class}, - documentation = "Specifies if an nm-multiplicity attribute (or all nm-multiplicity attributes of a given model) needs an index in db (Hibernate mapping)") + documentation = "Specifies if an nm-multiplicity attribute (or all nm-multiplicity attributes of a given model) needs an index in db (Hibernate mapping)") String TAG_INDEX_FOREIGN_KEYS = "indexForeignKeys"; /** @@ -324,59 +319,63 @@ * @since 2.6.7 */ @TagValueDefinition(target = {ObjectModel.class, ObjectModelClassifier.class}, - documentation = "Add a \"id\" property with its getter/setter on a DTO.") + documentation = "Add a \"id\" property with its getter/setter on a DTO.") String TAG_GENERATE_TOPIA_ID_IN_DTO = "generateDTOTopiaId"; /** - * Tag to specify a super class to use instead of {@link AbstractTopiaPersistenceContext}. + * Tag to specify a super class to use instead of + * {@link org.nuiton.topia.persistence.internal.AbstractTopiaPersistenceContext}. * <p/> - * <strong>Note:</strong> the class must implements {@link AbstractTopiaPersistenceContext}. + * <strong>Note:</strong> the class must implements + * {@link org.nuiton.topia.persistence.internal.AbstractTopiaPersistenceContext}. * - * @see AbstractTopiaPersistenceContext - * @see TopiaGeneratorUtil#getPersistenceContextSuperClassTagValue(ObjectModel)} + * @see org.nuiton.topia.persistence.internal.AbstractTopiaPersistenceContext + * @see TopiaGeneratorUtil#getPersistenceContextSuperClassTagValue(org.nuiton.eugene.models.object.ObjectModel) * @since 3.0 */ @TagValueDefinition(target = {ObjectModel.class}, - documentation = "Change the super class to use when generating PersistenceContext.") + documentation = "Change the super class to use when generating PersistenceContext.") String TAG_PERSISTENCE_CONTEXT_SUPER_CLASS = "persistenceContextSuperClass"; /** - * Tag to specify a super class to use instead of {@link AbstractTopiaApplicationContext}. + * Tag to specify a super class to use instead of + * {@link org.nuiton.topia.persistence.internal.AbstractTopiaApplicationContext}. * <p/> - * <strong>Note:</strong> the class must implements {@link AbstractTopiaApplicationContext}. + * <strong>Note:</strong> the class must implement + * {@link org.nuiton.topia.persistence.internal.AbstractTopiaApplicationContext}. * - * @see AbstractTopiaApplicationContext - * @see TopiaGeneratorUtil#getApplicationContextSuperClassTagValue(ObjectModel)} + * @see org.nuiton.topia.persistence.internal.AbstractTopiaApplicationContext + * @see TopiaGeneratorUtil#getApplicationContextSuperClassTagValue(org.nuiton.eugene.models.object.ObjectModel) * @since 3.0 */ @TagValueDefinition(target = {ObjectModel.class}, - documentation = "Change the super class to use when generating ApplicationContext.") + documentation = "Change the super class to use when generating ApplicationContext.") String TAG_APPLICATION_CONTEXT_SUPER_CLASS = "applicationContextSuperClass"; /** - * Tag to specify a super class to use instead of {@link AbstractTopiaDao}. + * Tag to specify a super class to use instead of {@link org.nuiton.topia.persistence.internal.AbstractTopiaDao}. * <p/> - * <strong>Note:</strong> the class must implements {@link TopiaDao}. + * <strong>Note:</strong> the class must implements {@link org.nuiton.topia.persistence.TopiaDao}. * - * @see AbstractTopiaDao - * @see TopiaGeneratorUtil#getDaoSuperClassTagValue(ObjectModelClassifier, ObjectModel)} + * @see org.nuiton.topia.persistence.internal.AbstractTopiaDao + * @see TopiaGeneratorUtil#getDaoSuperClassTagValue(org.nuiton.eugene.models.object.ObjectModelClassifier, org.nuiton.eugene.models.object.ObjectModel) * @since 3.0 */ @TagValueDefinition(target = {ObjectModelClassifier.class, ObjectModel.class}, - documentation = "Change the super class to use when generating dao.") - String TAG_DAO_SUPER_CLASS= "daoSuperClass"; + documentation = "Change the super class to use when generating dao.") + String TAG_DAO_SUPER_CLASS = "daoSuperClass"; /** * Tag to specify a super class to use instead of {@link org.nuiton.topia.persistence.internal.AbstractTopiaEntity}. * <p/> - * <strong>Note:</strong> the class must implements {@link TopiaEntity}. + * <strong>Note:</strong> the class must implements {@link org.nuiton.topia.persistence.TopiaEntity}. * - * @see TopiaEntity - * @see TopiaGeneratorUtil#getEntitySuperClassTagValue(ObjectModelClassifier, ObjectModel)} + * @see org.nuiton.topia.persistence.TopiaEntity + * @see TopiaGeneratorUtil#getEntitySuperClassTagValue(org.nuiton.eugene.models.object.ObjectModelClassifier, org.nuiton.eugene.models.object.ObjectModel) * @since 3.0 */ @TagValueDefinition(target = {ObjectModelClassifier.class, ObjectModel.class}, - documentation = "Change the super class to use when generating Entity.") - String TAG_ENTITY_SUPER_CLASS= "entitySuperClass"; + documentation = "Change the super class to use when generating Entity.") + String TAG_ENTITY_SUPER_CLASS = "entitySuperClass"; }