r2979 - in trunk: topia-it/src/main/java/org/nuiton/topia/it/legacy topia-it/src/main/java/org/nuiton/topia/it/legacy/topiatest/persistence topia-it/src/test/java/org/nuiton/topia/it/legacy topia-it/src/test/java/org/nuiton/topia/it/legacy/topiatest topia-persistence/src/main/java/org/nuiton/topia topia-persistence/src/main/java/org/nuiton/topia/persistence topia-persistence/src/main/java/org/nuiton/topia/persistence/event topia-persistence/src/main/java/org/nuiton/topia/persistence/internal
Author: athimel Date: 2014-01-17 18:01:06 +0100 (Fri, 17 Jan 2014) New Revision: 2979 Url: http://nuiton.org/projects/topia/repository/revisions/2979 Log: refs #552 Clean API : - package-info for org.nuiton.topia.persistence - TopiaApplicationContext - TopiaPersistenceContext - several javadoc warnings Added: trunk/topia-it/src/main/java/org/nuiton/topia/it/legacy/AbstractEmployeeTopiaDao.java trunk/topia-it/src/main/java/org/nuiton/topia/it/legacy/EmployeeTopiaDao.java trunk/topia-persistence/src/main/java/org/nuiton/topia/persistence/internal/AbstractTopiaEntity.java Removed: trunk/topia-it/src/main/java/org/nuiton/topia/it/legacy/AbstractEmployeTopiaDao.java trunk/topia-it/src/main/java/org/nuiton/topia/it/legacy/EmployeTopiaDao.java trunk/topia-persistence/src/main/java/org/nuiton/topia/persistence/TopiaEntityAbstract.java Modified: trunk/topia-it/src/main/java/org/nuiton/topia/it/legacy/AbstractPersonneTopiaDao.java trunk/topia-it/src/main/java/org/nuiton/topia/it/legacy/AbstractTopiaTestApplicationContext.java trunk/topia-it/src/main/java/org/nuiton/topia/it/legacy/AbstractTopiaTestEntity.java trunk/topia-it/src/main/java/org/nuiton/topia/it/legacy/EmployeeDao.java trunk/topia-it/src/main/java/org/nuiton/topia/it/legacy/GeneratedEmployeeTopiaDao.java trunk/topia-it/src/main/java/org/nuiton/topia/it/legacy/GeneratedPersonneTopiaDao.java trunk/topia-it/src/main/java/org/nuiton/topia/it/legacy/PersonneDao.java trunk/topia-it/src/main/java/org/nuiton/topia/it/legacy/PersonneTopiaDao.java 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/TopiaJpaSupportTest.java trunk/topia-it/src/test/java/org/nuiton/topia/it/legacy/topiatest/CascadeSaveTest.java trunk/topia-persistence/src/main/java/org/nuiton/topia/package-info.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/TopiaEntity.java trunk/topia-persistence/src/main/java/org/nuiton/topia/persistence/TopiaEntityContextable.java trunk/topia-persistence/src/main/java/org/nuiton/topia/persistence/TopiaPersistenceContext.java trunk/topia-persistence/src/main/java/org/nuiton/topia/persistence/TopiaPersistenceHelper.java trunk/topia-persistence/src/main/java/org/nuiton/topia/persistence/TopiaTransaction.java trunk/topia-persistence/src/main/java/org/nuiton/topia/persistence/event/TopiaSchemaListener.java trunk/topia-persistence/src/main/java/org/nuiton/topia/persistence/event/TopiaTransactionListener.java trunk/topia-persistence/src/main/java/org/nuiton/topia/persistence/event/package-info.java trunk/topia-persistence/src/main/java/org/nuiton/topia/persistence/internal/AbstractTopiaApplicationContext.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/AbstractTopiaPersistenceContext.java trunk/topia-persistence/src/main/java/org/nuiton/topia/persistence/internal/HibernateProvider.java trunk/topia-persistence/src/main/java/org/nuiton/topia/persistence/internal/TopiaHibernateSessionRegistry.java trunk/topia-persistence/src/main/java/org/nuiton/topia/persistence/internal/support/HibernateTopiaJpaSupport.java trunk/topia-persistence/src/main/java/org/nuiton/topia/persistence/internal/support/HibernateTopiaSqlSupport.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/internal/support/TopiaServiceSupportImpl.java trunk/topia-persistence/src/main/java/org/nuiton/topia/persistence/metadata/package-info.java trunk/topia-persistence/src/main/java/org/nuiton/topia/persistence/package-info.java trunk/topia-persistence/src/main/java/org/nuiton/topia/persistence/support/TopiaHibernateSupport.java trunk/topia-persistence/src/main/java/org/nuiton/topia/persistence/support/TopiaJpaSupport.java trunk/topia-persistence/src/main/java/org/nuiton/topia/persistence/support/TopiaListenableSupport.java trunk/topia-persistence/src/main/java/org/nuiton/topia/persistence/support/TopiaReplicationSupport.java trunk/topia-persistence/src/main/java/org/nuiton/topia/persistence/support/TopiaServiceSupport.java trunk/topia-persistence/src/main/java/org/nuiton/topia/persistence/support/TopiaSqlSupport.java trunk/topia-persistence/src/main/java/org/nuiton/topia/persistence/support/TopiaSqlWork.java trunk/topia-persistence/src/main/java/org/nuiton/topia/persistence/util/TopiaH2Util.java trunk/topia-persistence/src/main/java/org/nuiton/topia/persistence/util/TopiaUtil.java trunk/topia-persistence/src/test/java/org/nuiton/topia/persistence/DefaultTopiaIdFactoryTest.java trunk/topia-templates/src/main/java/org/nuiton/topia/templates/EntityEnumTransformer.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/TopiaGeneratorUtil.java trunk/topia-templates/src/main/java/org/nuiton/topia/templates/TopiaRelationValidator.java trunk/topia-templates/src/main/java/org/nuiton/topia/templates/TopiaTagValues.java trunk/topia-templates/src/main/java/org/nuiton/topia/templates/package-info.java Deleted: trunk/topia-it/src/main/java/org/nuiton/topia/it/legacy/AbstractEmployeTopiaDao.java =================================================================== --- trunk/topia-it/src/main/java/org/nuiton/topia/it/legacy/AbstractEmployeTopiaDao.java 2014-01-15 11:27:43 UTC (rev 2978) +++ trunk/topia-it/src/main/java/org/nuiton/topia/it/legacy/AbstractEmployeTopiaDao.java 2014-01-17 17:01:06 UTC (rev 2979) @@ -1,33 +0,0 @@ -package org.nuiton.topia.it.legacy; - -/* - * #%L - * ToPIA :: Persistence - * $Id$ - * $HeadURL$ - * %% - * Copyright (C) 2004 - 2013 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% - */ - -import org.nuiton.topia.it.legacy.topiatest.Employe; - -/** - * @author Arnaud Thimel <thimel@codelutin.com> - */ -public abstract class AbstractEmployeTopiaDao<E extends Employe> extends GeneratedEmployeeTopiaDao<E> { -} Copied: trunk/topia-it/src/main/java/org/nuiton/topia/it/legacy/AbstractEmployeeTopiaDao.java (from rev 2978, trunk/topia-it/src/main/java/org/nuiton/topia/it/legacy/AbstractEmployeTopiaDao.java) =================================================================== --- trunk/topia-it/src/main/java/org/nuiton/topia/it/legacy/AbstractEmployeeTopiaDao.java (rev 0) +++ trunk/topia-it/src/main/java/org/nuiton/topia/it/legacy/AbstractEmployeeTopiaDao.java 2014-01-17 17:01:06 UTC (rev 2979) @@ -0,0 +1,33 @@ +package org.nuiton.topia.it.legacy; + +/* + * #%L + * ToPIA :: Persistence + * $Id$ + * $HeadURL$ + * %% + * Copyright (C) 2004 - 2013 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% + */ + +import org.nuiton.topia.it.legacy.topiatest.Employe; + +/** + * @author Arnaud Thimel : thimel@codelutin.com + */ +public abstract class AbstractEmployeeTopiaDao<E extends Employe> extends GeneratedEmployeeTopiaDao<E> { +} Modified: trunk/topia-it/src/main/java/org/nuiton/topia/it/legacy/AbstractPersonneTopiaDao.java =================================================================== --- trunk/topia-it/src/main/java/org/nuiton/topia/it/legacy/AbstractPersonneTopiaDao.java 2014-01-15 11:27:43 UTC (rev 2978) +++ trunk/topia-it/src/main/java/org/nuiton/topia/it/legacy/AbstractPersonneTopiaDao.java 2014-01-17 17:01:06 UTC (rev 2979) @@ -27,7 +27,7 @@ import org.nuiton.topia.it.legacy.topiatest.Personne; /** - * @author Arnaud Thimel <thimel@codelutin.com> + * @author Arnaud Thimel : thimel@codelutin.com */ public abstract class AbstractPersonneTopiaDao<E extends Personne> extends GeneratedPersonneTopiaDao<E> { Modified: trunk/topia-it/src/main/java/org/nuiton/topia/it/legacy/AbstractTopiaTestApplicationContext.java =================================================================== --- trunk/topia-it/src/main/java/org/nuiton/topia/it/legacy/AbstractTopiaTestApplicationContext.java 2014-01-15 11:27:43 UTC (rev 2978) +++ trunk/topia-it/src/main/java/org/nuiton/topia/it/legacy/AbstractTopiaTestApplicationContext.java 2014-01-17 17:01:06 UTC (rev 2979) @@ -35,7 +35,9 @@ * @author Tony Chemit <chemit@codelutin.com> * @since 3.0 */ -public abstract class AbstractTopiaTestApplicationContext<E extends AbstractTopiaTestPersistenceContext> extends AbstractTopiaApplicationContext<E> { +public abstract class AbstractTopiaTestApplicationContext<E extends AbstractTopiaTestPersistenceContext> + extends AbstractTopiaApplicationContext<E> { + protected AbstractTopiaTestApplicationContext(Properties properties) { super(properties); } Modified: trunk/topia-it/src/main/java/org/nuiton/topia/it/legacy/AbstractTopiaTestEntity.java =================================================================== --- trunk/topia-it/src/main/java/org/nuiton/topia/it/legacy/AbstractTopiaTestEntity.java 2014-01-15 11:27:43 UTC (rev 2978) +++ trunk/topia-it/src/main/java/org/nuiton/topia/it/legacy/AbstractTopiaTestEntity.java 2014-01-17 17:01:06 UTC (rev 2979) @@ -24,14 +24,15 @@ * #L% */ -import org.nuiton.topia.persistence.TopiaEntityAbstract; +import org.nuiton.topia.persistence.internal.AbstractTopiaEntity; + /** * Created on 12/19/13. * * @author Tony Chemit <chemit@codelutin.com> * @since 3.0 */ -public abstract class AbstractTopiaTestEntity extends TopiaEntityAbstract { +public abstract class AbstractTopiaTestEntity extends AbstractTopiaEntity { private static final long serialVersionUID = 1L; } Deleted: trunk/topia-it/src/main/java/org/nuiton/topia/it/legacy/EmployeTopiaDao.java =================================================================== --- trunk/topia-it/src/main/java/org/nuiton/topia/it/legacy/EmployeTopiaDao.java 2014-01-15 11:27:43 UTC (rev 2978) +++ trunk/topia-it/src/main/java/org/nuiton/topia/it/legacy/EmployeTopiaDao.java 2014-01-17 17:01:06 UTC (rev 2979) @@ -1,42 +0,0 @@ -package org.nuiton.topia.it.legacy; - -/* - * #%L - * ToPIA :: Persistence - * $Id$ - * $HeadURL$ - * %% - * Copyright (C) 2004 - 2013 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% - */ - -import java.util.List; - -import org.nuiton.topia.it.legacy.topiatest.Employe; -import org.nuiton.topia.it.legacy.topiatest.Personne; - -/** - * @author Arnaud Thimel <thimel@codelutin.com> - */ -public class EmployeTopiaDao extends AbstractEmployeTopiaDao<Employe> { - - @Override - public List<Personne> findAllPersonnesByXAndY(int x, int y) { - return null; - } - -} Modified: trunk/topia-it/src/main/java/org/nuiton/topia/it/legacy/EmployeeDao.java =================================================================== --- trunk/topia-it/src/main/java/org/nuiton/topia/it/legacy/EmployeeDao.java 2014-01-15 11:27:43 UTC (rev 2978) +++ trunk/topia-it/src/main/java/org/nuiton/topia/it/legacy/EmployeeDao.java 2014-01-17 17:01:06 UTC (rev 2979) @@ -25,7 +25,7 @@ */ /** - * @author Arnaud Thimel <thimel@codelutin.com> + * @author Arnaud Thimel : thimel@codelutin.com */ public interface EmployeeDao { } Copied: trunk/topia-it/src/main/java/org/nuiton/topia/it/legacy/EmployeeTopiaDao.java (from rev 2978, trunk/topia-it/src/main/java/org/nuiton/topia/it/legacy/EmployeTopiaDao.java) =================================================================== --- trunk/topia-it/src/main/java/org/nuiton/topia/it/legacy/EmployeeTopiaDao.java (rev 0) +++ trunk/topia-it/src/main/java/org/nuiton/topia/it/legacy/EmployeeTopiaDao.java 2014-01-17 17:01:06 UTC (rev 2979) @@ -0,0 +1,42 @@ +package org.nuiton.topia.it.legacy; + +/* + * #%L + * ToPIA :: Persistence + * $Id$ + * $HeadURL$ + * %% + * Copyright (C) 2004 - 2013 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% + */ + +import java.util.List; + +import org.nuiton.topia.it.legacy.topiatest.Employe; +import org.nuiton.topia.it.legacy.topiatest.Personne; + +/** + * @author Arnaud Thimel : thimel@codelutin.com + */ +public class EmployeeTopiaDao extends AbstractEmployeeTopiaDao<Employe> { + + @Override + public List<Personne> findAllPersonnesByXAndY(int x, int y) { + return null; + } + +} Modified: trunk/topia-it/src/main/java/org/nuiton/topia/it/legacy/GeneratedEmployeeTopiaDao.java =================================================================== --- trunk/topia-it/src/main/java/org/nuiton/topia/it/legacy/GeneratedEmployeeTopiaDao.java 2014-01-15 11:27:43 UTC (rev 2978) +++ trunk/topia-it/src/main/java/org/nuiton/topia/it/legacy/GeneratedEmployeeTopiaDao.java 2014-01-17 17:01:06 UTC (rev 2979) @@ -27,7 +27,7 @@ import org.nuiton.topia.it.legacy.topiatest.Employe; /** - * @author Arnaud Thimel <thimel@codelutin.com> + * @author Arnaud Thimel : thimel@codelutin.com */ public abstract class GeneratedEmployeeTopiaDao<E extends Employe> extends AbstractPersonneTopiaDao<E> { } Modified: trunk/topia-it/src/main/java/org/nuiton/topia/it/legacy/GeneratedPersonneTopiaDao.java =================================================================== --- trunk/topia-it/src/main/java/org/nuiton/topia/it/legacy/GeneratedPersonneTopiaDao.java 2014-01-15 11:27:43 UTC (rev 2978) +++ trunk/topia-it/src/main/java/org/nuiton/topia/it/legacy/GeneratedPersonneTopiaDao.java 2014-01-17 17:01:06 UTC (rev 2979) @@ -34,7 +34,7 @@ import org.nuiton.topia.it.legacy.topiatest.Personne; /** - * @author Arnaud Thimel <thimel@codelutin.com> + * @author Arnaud Thimel : thimel@codelutin.com */ public abstract class GeneratedPersonneTopiaDao<E extends Personne> extends AbstractTopiaDao<E> implements PersonneDao { Modified: trunk/topia-it/src/main/java/org/nuiton/topia/it/legacy/PersonneDao.java =================================================================== --- trunk/topia-it/src/main/java/org/nuiton/topia/it/legacy/PersonneDao.java 2014-01-15 11:27:43 UTC (rev 2978) +++ trunk/topia-it/src/main/java/org/nuiton/topia/it/legacy/PersonneDao.java 2014-01-17 17:01:06 UTC (rev 2979) @@ -29,7 +29,7 @@ import org.nuiton.topia.it.legacy.topiatest.Personne; /** - * @author Arnaud Thimel <thimel@codelutin.com> + * @author Arnaud Thimel : thimel@codelutin.com */ public interface PersonneDao { Modified: trunk/topia-it/src/main/java/org/nuiton/topia/it/legacy/PersonneTopiaDao.java =================================================================== --- trunk/topia-it/src/main/java/org/nuiton/topia/it/legacy/PersonneTopiaDao.java 2014-01-15 11:27:43 UTC (rev 2978) +++ trunk/topia-it/src/main/java/org/nuiton/topia/it/legacy/PersonneTopiaDao.java 2014-01-17 17:01:06 UTC (rev 2979) @@ -29,7 +29,7 @@ import org.nuiton.topia.it.legacy.topiatest.Personne; /** - * @author Arnaud Thimel <thimel@codelutin.com> + * @author Arnaud Thimel : thimel@codelutin.com */ public class PersonneTopiaDao extends AbstractPersonneTopiaDao<Personne> { 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-15 11:27:43 UTC (rev 2978) +++ trunk/topia-it/src/main/java/org/nuiton/topia/it/legacy/topiatest/persistence/Entity1Abstract.java 2014-01-17 17:01:06 UTC (rev 2979) @@ -1,3 +1,5 @@ +package org.nuiton.topia.it.legacy.topiatest.persistence; + /* * #%L * ToPIA :: Persistence @@ -22,20 +24,17 @@ * <http://www.gnu.org/licenses/lgpl-3.0.html>. * #L% */ -package org.nuiton.topia.it.legacy.topiatest.persistence; +import org.nuiton.topia.persistence.internal.AbstractTopiaEntity; import org.nuiton.topia.persistence.TopiaException; import org.nuiton.topia.persistence.EntityVisitor; -import org.nuiton.topia.persistence.TopiaEntityAbstract; /** * Created: 11 mai 2010 * * @author fdesbois <fdesbois@codelutin.com> - * @version $Id$ */ -public abstract class Entity1Abstract extends TopiaEntityAbstract - implements Entity1 { +public abstract class Entity1Abstract extends AbstractTopiaEntity implements Entity1 { protected String attr1; Modified: trunk/topia-it/src/test/java/org/nuiton/topia/it/legacy/TopiaJpaSupportTest.java =================================================================== --- trunk/topia-it/src/test/java/org/nuiton/topia/it/legacy/TopiaJpaSupportTest.java 2014-01-15 11:27:43 UTC (rev 2978) +++ trunk/topia-it/src/test/java/org/nuiton/topia/it/legacy/TopiaJpaSupportTest.java 2014-01-17 17:01:06 UTC (rev 2979) @@ -1,3 +1,5 @@ +package org.nuiton.topia.it.legacy; + /* * #%L * ToPIA :: Persistence :: Test Compatibility Kit @@ -21,7 +23,6 @@ * <http://www.gnu.org/licenses/lgpl-3.0.html>. * #L% */ -package org.nuiton.topia.it.legacy; import org.apache.commons.lang3.reflect.FieldUtils; import org.junit.Assert; @@ -47,7 +48,7 @@ /** * Tests the TopiaContext#find|findAll|findUnique methods * - * @author Arnaud Thimel <thimel@codelutin.com> + * @author Arnaud Thimel : thimel@codelutin.com */ public class TopiaJpaSupportTest { Modified: trunk/topia-it/src/test/java/org/nuiton/topia/it/legacy/topiatest/CascadeSaveTest.java =================================================================== --- trunk/topia-it/src/test/java/org/nuiton/topia/it/legacy/topiatest/CascadeSaveTest.java 2014-01-15 11:27:43 UTC (rev 2978) +++ trunk/topia-it/src/test/java/org/nuiton/topia/it/legacy/topiatest/CascadeSaveTest.java 2014-01-17 17:01:06 UTC (rev 2979) @@ -31,7 +31,7 @@ import org.nuiton.topia.it.legacy.TopiaTestTopiaPersistenceContext; /** - * @author Arnaud Thimel <thimel@codelutin.com> + * @author Arnaud Thimel : thimel@codelutin.com */ public class CascadeSaveTest { Modified: trunk/topia-persistence/src/main/java/org/nuiton/topia/package-info.java =================================================================== --- trunk/topia-persistence/src/main/java/org/nuiton/topia/package-info.java 2014-01-15 11:27:43 UTC (rev 2978) +++ trunk/topia-persistence/src/main/java/org/nuiton/topia/package-info.java 2014-01-17 17:01:06 UTC (rev 2979) @@ -22,6 +22,7 @@ * <http://www.gnu.org/licenses/lgpl-3.0.html>. * #L% */ + /** * TODO-FD20100507 : Need update this javadoc for ToPIA 2.4 * @@ -134,4 +135,4 @@ * topia.dao.flatfile.mapping.fr.ifremer.isisfish.entities.Script.body=script * </pre> */ -package org.nuiton.topia; \ No newline at end of file +package org.nuiton.topia; 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-15 11:27:43 UTC (rev 2978) +++ trunk/topia-persistence/src/main/java/org/nuiton/topia/persistence/TopiaApplicationContext.java 2014-01-17 17:01:06 UTC (rev 2979) @@ -24,20 +24,57 @@ * #L% */ -import com.google.common.collect.ImmutableMap; +import java.util.List; + import org.nuiton.topia.persistence.support.TopiaListenableSupport; import org.nuiton.topia.persistence.support.TopiaServiceSupport; -import java.util.List; +import com.google.common.collect.ImmutableMap; /** - * Created on 12/20/13. + * This is the main entry point for ToPIA. This interface represents the root context of an application. * - * @author Tony Chemit <chemit@codelutin.com> + * <p>Most of the time, there is only one instance of this context during the entire lifecycle of a application.</p> + * + * <p>This contract provides facility to : + * <ul> + * <li>create a new {@link org.nuiton.topia.persistence.TopiaPersistenceContext};</li> + * <li>get meta information about the application (model name, version);</li> + * <li>get meta information about the entities;</li> + * <li>do schema related operations;</li> + * <li>shutdown the application</li> + * </ul> + * </p> + * + * <p>This contract has an abstract implementation + * ({@link org.nuiton.topia.persistence.internal.AbstractTopiaApplicationContext}) which is itself extended by a + * generated <code>AbstractXxxTopiaApplicationContext</code> (where <code>Xxx</code> is the project name), itself + * extended by <code>XxxTopiaApplicationContext</code>.</p> + * + * <p>The full hierarchy is : <pre> + * TopiaApplicationContext (this contract) + * \--AbstractTopiaApplicationContext + * \--AbstractXxxTopiaApplicationContext (generated) + * \--XxxTopiaApplicationContext (generated) + * </pre> + * (where <code>Xxx</code> is the project name)</p> + * + * <p>Created on 12/20/13.</p> + * + * @author Tony Chemit : chemit@codelutin.com * @since 3.0 */ -public interface TopiaApplicationContext<K extends TopiaPersistenceContext> extends TopiaListenableSupport, TopiaServiceSupport { +public interface TopiaApplicationContext<K extends TopiaPersistenceContext> + extends TopiaListenableSupport, TopiaServiceSupport { + /** + * Creates a new instance of XxxTopiaPersistenceContext (where <code>Xxx</code> is the project name). This is the + * method to use in order to start a new transaction. + * + * @return a newly created instance of your project's specific + * {@link org.nuiton.topia.persistence.TopiaPersistenceContext} + * @see org.nuiton.topia.persistence.TopiaPersistenceContext + */ K newPersistenceContext(); String getModelVersion(); @@ -68,7 +105,17 @@ void dropSchema(); + /** + * Method to call when the application is going for shutdown. It will trigger the shutdown of all the opened + * children {@link org.nuiton.topia.persistence.TopiaPersistenceContext} + * + * @throws TopiaException + */ void closeContext() throws TopiaException; + /** + * @return true is the application context is already closed, false otherwise + */ boolean isClosed(); + } 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-15 11:27:43 UTC (rev 2978) +++ trunk/topia-persistence/src/main/java/org/nuiton/topia/persistence/TopiaApplicationContextCache.java 2014-01-17 17:01:06 UTC (rev 2979) @@ -43,7 +43,7 @@ * <p/> * This class is 'inspired' from the TopiaContextFactory of ToPIA 2.x * - * @author Arnaud Thimel <thimel@codelutin.com> + * @author Arnaud Thimel : thimel@codelutin.com * @since 3.0 */ public class TopiaApplicationContextCache { 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-15 11:27:43 UTC (rev 2978) +++ trunk/topia-persistence/src/main/java/org/nuiton/topia/persistence/TopiaEntity.java 2014-01-17 17:01:06 UTC (rev 2979) @@ -1,3 +1,5 @@ +package org.nuiton.topia.persistence; + /* * #%L * ToPIA :: Persistence @@ -23,20 +25,6 @@ * #L% */ -/* * - * TopiaEntity.java - * - * Created: 28 déc. 2005 22:48:10 - * - * @author poussin <poussin@codelutin.com> - * @version $Revision$ - * - * Last update: $Date$ - * by : $Author$ - */ - -package org.nuiton.topia.persistence; - import java.beans.PropertyChangeListener; import java.beans.VetoableChangeListener; import java.io.Serializable; @@ -45,43 +33,52 @@ /** * The TopiaEntity is the main interface for each entity generated. - * 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 - * 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> - * @version $Id$ */ public interface TopiaEntity extends Serializable { String PROPERTY_TOPIA_ID = "topiaId"; - /** @deprecated since 3.0, will be removed in 3.1, use {@link TopiaEntity#PROPERTY_TOPIA_ID} instead */ + /** + * @deprecated since 3.0, will be removed in 3.1, use {@link TopiaEntity#PROPERTY_TOPIA_ID} instead + */ @Deprecated String TOPIA_ID = PROPERTY_TOPIA_ID; String PROPERTY_TOPIA_CREATE_DATE = "topiaCreateDate"; - /** @deprecated since 3.0, will be removed in 3.1, use {@link TopiaEntity#PROPERTY_TOPIA_CREATE_DATE} instead */ + /** + * @deprecated since 3.0, will be removed in 3.1, use {@link TopiaEntity#PROPERTY_TOPIA_CREATE_DATE} instead + */ @Deprecated String TOPIA_CREATE_DATE = PROPERTY_TOPIA_CREATE_DATE; String PROPERTY_TOPIA_VERSION = "topiaVersion"; - /** @deprecated since 3.0, will be removed in 3.1, use {@link TopiaEntity#PROPERTY_TOPIA_VERSION} instead */ + /** + * @deprecated since 3.0, will be removed in 3.1, use {@link TopiaEntity#PROPERTY_TOPIA_VERSION} instead + */ @Deprecated String TOPIA_VERSION = PROPERTY_TOPIA_VERSION; - /** @deprecated since 3.0, will be removed in 3.1, unused */ + /** + * @deprecated since 3.0, will be removed in 3.1, unused + */ @Deprecated String COMPOSITE = "composite"; - /** @deprecated since 3.0, will be removed in 3.1, unused */ + /** + * @deprecated since 3.0, will be removed in 3.1, unused + */ @Deprecated String AGGREGATE = "aggregate"; @@ -97,7 +94,7 @@ /** * 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 TopiaDAO#create(Object...)}. + * using {@link org.nuiton.topia.persistence.TopiaDao#create()}. * * @param id technical id to set */ @@ -123,7 +120,7 @@ /** * Technical date creation of the entity. This date doesn't change through * time and was initialized on entity creation when using {@link - * TopiaDAO#create(Object...)}. + * org.nuiton.topia.persistence.TopiaDao#create()}. * * @return the creation date of the entity */ @@ -165,8 +162,8 @@ List<TopiaEntity> getComposite() throws TopiaException; /** - * @return all object that are aggregate with this instance, aggreate object - * are not removed automaticaly + * @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) */ Deleted: trunk/topia-persistence/src/main/java/org/nuiton/topia/persistence/TopiaEntityAbstract.java =================================================================== --- trunk/topia-persistence/src/main/java/org/nuiton/topia/persistence/TopiaEntityAbstract.java 2014-01-15 11:27:43 UTC (rev 2978) +++ trunk/topia-persistence/src/main/java/org/nuiton/topia/persistence/TopiaEntityAbstract.java 2014-01-17 17:01:06 UTC (rev 2979) @@ -1,359 +0,0 @@ -/* - * #%L - * ToPIA :: Persistence - * - * $Id$ - * $HeadURL$ - * %% - * Copyright (C) 2004 - 2010 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; - -import org.nuiton.topia.persistence.internal.AbstractTopiaDao; -import org.nuiton.topia.persistence.internal.support.TopiaFiresSupport; - -import java.beans.PropertyChangeListener; -import java.beans.PropertyChangeSupport; -import java.beans.VetoableChangeListener; -import java.beans.VetoableChangeSupport; -import java.util.Date; -import java.util.List; - -/** - * Classe de base de toutes les entités, cela permet de concentrer le code - * technique dans cette classe. L'identifiant peut-etre n'importe quoi Aucune - * restriction n'est faite dessus, il peut meme changer entre deux types - * d'entité si cela ne pose pas d'autre probleme (heritage entre ces entités). - * - * @author poussin <poussin@codelutin.com> - * @version $Id$ - */ -public abstract class TopiaEntityAbstract implements TopiaEntity { - - private static final long serialVersionUID = -7458577454878852241L; - - protected String topiaId; - - protected long topiaVersion; - - protected Date topiaCreateDate = new Date(); - - transient protected boolean deleted = false; - - transient protected TopiaFiresSupport fireSupport; - - transient protected VetoableChangeSupport readVetoables; - - transient protected PropertyChangeSupport readListeners; - - transient protected VetoableChangeSupport writeVetoables; - - transient protected PropertyChangeSupport writeListeners; - - /** - * Initialize {@link #readVetoables} at first use or after deserialisation. - * - * @return readVetoables - */ - protected VetoableChangeSupport getReadVetoableChangeSupport() { - if (readVetoables == null) { - readVetoables = new VetoableChangeSupport(this); - } - return readVetoables; - } - - /** - * 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 - */ - protected VetoableChangeSupport getWriteVetoableChangeSupport() { - if (writeVetoables == null) { - writeVetoables = new VetoableChangeSupport(this); - } - 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; - } - - @Override - public void setTopiaId(String v) { - topiaId = v; - } - - @Override - public long getTopiaVersion() { - return topiaVersion; - } - - @Override - public void setTopiaVersion(long v) { - topiaVersion = v; - } - - @Override - public Date getTopiaCreateDate() { - return topiaCreateDate; - } - - @Override - public void setTopiaCreateDate(Date topiaCreateDate) { - this.topiaCreateDate = topiaCreateDate; - } - - @Override - public boolean isPersisted() { - // Is or was the entity persisted ? - boolean result = topiaId != null; - // Is the entity deleted ? - result &= !deleted; - return result; - } - - @Override - public void notifyDeleted() { - deleted = true; - } - - @Override - public List<TopiaEntity> getComposite() throws TopiaException { - throw new UnsupportedOperationException(); - } - - @Override - public List<TopiaEntity> getAggregate() throws TopiaException { - throw new UnsupportedOperationException(); - } - - /** - * On utilise la date de creation comme hash code, cette date ne varie pas - * au cours du temps - */ - @Override - public int hashCode() { - Date date = getTopiaCreateDate(); - //TC-20100220 : il se peut que la date de creation soit nulle - // lorsque l'entite est utilise comme objet d'edition d'un formulaire - // par exemple... - int result = date == null ? 0 : date.hashCode(); - return result; - } - - /** - * On est sur que les objets sont bien les memes car s'il n'ont pas d'id - * cela veut dire qu'il ne vienne pas de la meme session donc qu'il sont - * nouveau et different, ou bien qu'ils viennent de la meme session et dans - * ce cas l'egalite == fonctionne. - */ - @Override - public boolean equals(Object obj) { - if (this == obj) { - return true; - } - if (!(obj instanceof TopiaEntity)) { - return false; - } - TopiaEntity other = (TopiaEntity) obj; - if (getTopiaId() == null || other.getTopiaId() == null) { - return false; - } - boolean result = getTopiaId().equals(other.getTopiaId()); - return result; - } - - protected TopiaFiresSupport getFireSupportOrNull() { - if (fireSupport == null) { - if (this instanceof TopiaEntityContextable) { - TopiaEntityContextable contextable = (TopiaEntityContextable) this; - AbstractTopiaDao topiaDAO = (AbstractTopiaDao)contextable.getTopiaDAOSupplier().getDao(getClass()); - fireSupport = topiaDAO.getTopiaFiresSupport(); - } - } - return fireSupport; - } - - protected void fireOnPreRead(String propertyName, Object value) { - TopiaFiresSupport firesSupport = getFireSupportOrNull(); - if (firesSupport != null) { - firesSupport.fireOnPreRead(getReadVetoableChangeSupport(), - this, propertyName, value); - } - } - - protected void fireOnPostRead(String propertyName, Object value) { - TopiaFiresSupport firesSupport = getFireSupportOrNull(); - if (firesSupport != null) { - firesSupport.fireOnPostRead(getReadPropertyChangeSupport(), - this, propertyName, value); - } - } - - protected void fireOnPostRead(String propertyName, int index, - Object value) { - TopiaFiresSupport firesSupport = getFireSupportOrNull(); - if (firesSupport != null) { - firesSupport.fireOnPostRead(getReadPropertyChangeSupport(), - this, propertyName, index, value); - } - } - - protected void fireOnPreWrite(String propertyName, Object oldValue, - Object newValue) { - TopiaFiresSupport firesSupport = getFireSupportOrNull(); - if (firesSupport != null) { - firesSupport.fireOnPreWrite(getWriteVetoableChangeSupport(), - this, propertyName, oldValue, newValue); - } - } - - protected void fireOnPostWrite(String propertyName, Object oldValue, - Object newValue) { - TopiaFiresSupport firesSupport = getFireSupportOrNull(); - if (firesSupport != null) { - firesSupport.fireOnPostWrite( - getWritePropertyChangeSupport(), this, propertyName, oldValue, newValue); - } - } - - protected void fireOnPostWrite(String propertyName, int index, - Object oldValue, Object newValue) { - TopiaFiresSupport firesSupport = getFireSupportOrNull(); - if (firesSupport != null) { - firesSupport.fireOnPostWrite( - getWritePropertyChangeSupport(), this, propertyName, index, oldValue, - newValue); - } - } - - @Override - public void addPropertyChangeListener(String propertyName, - PropertyChangeListener listener) { - getWritePropertyChangeSupport().addPropertyChangeListener(propertyName, listener); - } - - @Override - public void addPropertyChangeListener(PropertyChangeListener listener) { - getWritePropertyChangeSupport().addPropertyChangeListener(listener); - } - - @Override - public void addVetoableChangeListener(String propertyName, - VetoableChangeListener vetoable) { - getWriteVetoableChangeSupport().addVetoableChangeListener(propertyName, vetoable); - } - - @Override - public void addVetoableChangeListener(VetoableChangeListener vetoable) { - getWriteVetoableChangeSupport().addVetoableChangeListener(vetoable); - } - - @Override - public void removePropertyChangeListener(String propertyName, - PropertyChangeListener listener) { - getWritePropertyChangeSupport().removePropertyChangeListener(propertyName, listener); - } - - @Override - public void removePropertyChangeListener(PropertyChangeListener listener) { - getWritePropertyChangeSupport().removePropertyChangeListener(listener); - } - - @Override - public void removeVetoableChangeListener(String propertyName, - VetoableChangeListener vetoable) { - getWriteVetoableChangeSupport().removeVetoableChangeListener(propertyName, vetoable); - } - - @Override - public void removeVetoableChangeListener(VetoableChangeListener vetoable) { - getWriteVetoableChangeSupport().removeVetoableChangeListener(vetoable); - } - - @Override - public void addPropertyListener(String propertyName, - PropertyChangeListener listener) { - getReadPropertyChangeSupport().addPropertyChangeListener(propertyName, listener); - } - - @Override - public void addPropertyListener(PropertyChangeListener listener) { - getReadPropertyChangeSupport().addPropertyChangeListener(listener); - } - - @Override - public void addVetoableListener(String propertyName, - VetoableChangeListener vetoable) { - getReadVetoableChangeSupport().addVetoableChangeListener(propertyName, vetoable); - } - - @Override - public void addVetoableListener(VetoableChangeListener vetoable) { - getReadVetoableChangeSupport().addVetoableChangeListener(vetoable); - } - - @Override - public void removePropertyListener(String propertyName, - PropertyChangeListener listener) { - getReadPropertyChangeSupport().removePropertyChangeListener(propertyName, listener); - } - - @Override - public void removePropertyListener(PropertyChangeListener listener) { - getReadPropertyChangeSupport().removePropertyChangeListener(listener); - } - - @Override - public void removeVetoableListener(String propertyName, - VetoableChangeListener vetoable) { - getReadVetoableChangeSupport().removeVetoableChangeListener(propertyName, vetoable); - } - - @Override - public void removeVetoableListener(VetoableChangeListener vetoable) { - getReadVetoableChangeSupport().removeVetoableChangeListener(vetoable); - } - -} //TopiaEntityAbstract 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-15 11:27:43 UTC (rev 2978) +++ trunk/topia-persistence/src/main/java/org/nuiton/topia/persistence/TopiaEntityContextable.java 2014-01-17 17:01:06 UTC (rev 2979) @@ -1,7 +1,6 @@ /* * #%L - * - * + * * $Id$ * $HeadURL$ * %% @@ -26,14 +25,10 @@ package org.nuiton.topia.persistence; /** - * {@link TopiaEntity} with {@link TopiaContext} support (injected by - * {@link TopiaContext} into entities). + * {@link TopiaEntity} with {@link org.nuiton.topia.persistence.TopiaDaoSupplier} support (injected by + * {@link org.nuiton.topia.persistence.internal.AbstractTopiaDao} into entities). * * @author chatellier - * @version $Revision$ - * <p/> - * Last update : $Date$ - * By : $Author$ */ public interface TopiaEntityContextable extends TopiaEntity { 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-15 11:27:43 UTC (rev 2978) +++ trunk/topia-persistence/src/main/java/org/nuiton/topia/persistence/TopiaPersistenceContext.java 2014-01-17 17:01:06 UTC (rev 2979) @@ -28,14 +28,26 @@ import org.nuiton.topia.persistence.support.TopiaReplicationSupport; /** - * This API provides all methods related to persistence : + * This contract represents a persistence context, which lifecycle is linked to the transaction lifecycle. + * + * <p>It extends contracts such as : * <ul> - * <li>Generic entity find</li> - * <li>DAO factory</li> - * <li>Schema management</li> + * <li>{@link org.nuiton.topia.persistence.TopiaTransaction} - to deal with transaction lifecycle</li> + * <li>{@link org.nuiton.topia.persistence.TopiaDaoSupplier} - to let user get any Dao instance</li> + * <li>{@link org.nuiton.topia.persistence.support.TopiaReplicationSupport} - to use context to context replication + * facility</li> + * <li>{@link org.nuiton.topia.persistence.TopiaReplicationDestination} - can receive replicated entities</li> + * </ul></p> + * + * <p>In addition to these contracts, there is some other methods : + * <ul> + * <li>Generic entity find</li> + * <li>DAO factory</li> + * <li>Schema management</li> * </ul> + * </p> * - * @author Arnaud Thimel <thimel@codelutin.com> + * @author Arnaud Thimel : thimel@codelutin.com * @since 3.0 */ public interface TopiaPersistenceContext extends TopiaReplicationSupport, TopiaReplicationDestination, @@ -57,14 +69,14 @@ void update(TopiaEntity entity); /** - * delete into this TopiaContext an entity created by another TopiaContext + * Delete into this TopiaContext an entity created by another TopiaContext * * @param entity the entity to delete */ void delete(TopiaEntity entity); /** - * delete into this TopiaContext an entities created by another TopiaContext + * Delete into this TopiaContext an entities created by another TopiaContext * * @param entities the entities to delete */ @@ -75,7 +87,7 @@ * Get the currently configured {@link TopiaIdFactory}. * * @return the {@link TopiaIdFactory} in use - * @see {@link TopiaIdFactory} + * @see org.nuiton.topia.persistence.TopiaIdFactory * @since 3.0 */ TopiaIdFactory getTopiaIdFactory(); @@ -97,7 +109,7 @@ * Get the currently configured {@link TopiaFiresSupport}. * * @return the {@link TopiaFiresSupport} in use - * @see {@link TopiaFiresSupport} + * @see org.nuiton.topia.persistence.internal.support.TopiaFiresSupport * @since 3.0 */ TopiaFiresSupport getTopiaFiresSupport(); Modified: trunk/topia-persistence/src/main/java/org/nuiton/topia/persistence/TopiaPersistenceHelper.java =================================================================== --- trunk/topia-persistence/src/main/java/org/nuiton/topia/persistence/TopiaPersistenceHelper.java 2014-01-15 11:27:43 UTC (rev 2978) +++ trunk/topia-persistence/src/main/java/org/nuiton/topia/persistence/TopiaPersistenceHelper.java 2014-01-17 17:01:06 UTC (rev 2979) @@ -1,4 +1,5 @@ package org.nuiton.topia.persistence; + /* * #%L * ToPIA :: Persistence @@ -24,23 +25,15 @@ */ /** - * Object which helps to wrap some static generated code - * (dao helper, entityEnum). + * Object which helps to wrap some static generated code (entityEnum). * * @author tchemit <chemit@codelutin.com> * @since 2.6.12 + * @deprecated This is probably not useful anymore. */ public interface TopiaPersistenceHelper<T extends TopiaEntityEnum> { // TODO AThimel 20/07/13 Javadoc <E extends TopiaEntity> T getEntityEnum(Class<E> type); -// // TODO AThimel 20/07/13 Javadoc -// <E extends TopiaEntity> TopiaDao<E> getDAO(TopiaContext tx, -// Class<E> type); -// -// // TODO AThimel 20/07/13 Javadoc -// <E extends TopiaEntity> TopiaDao<E> getDAO(TopiaContext tx, -// T type); - } 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-15 11:27:43 UTC (rev 2978) +++ trunk/topia-persistence/src/main/java/org/nuiton/topia/persistence/TopiaTransaction.java 2014-01-17 17:01:06 UTC (rev 2979) @@ -27,7 +27,7 @@ /** * This API provides methods to manipulate transaction * - * @author Arnaud Thimel <thimel@codelutin.com> + * @author Arnaud Thimel : thimel@codelutin.com * @since 3.0 */ public interface TopiaTransaction { Modified: trunk/topia-persistence/src/main/java/org/nuiton/topia/persistence/event/TopiaSchemaListener.java =================================================================== --- trunk/topia-persistence/src/main/java/org/nuiton/topia/persistence/event/TopiaSchemaListener.java 2014-01-15 11:27:43 UTC (rev 2978) +++ trunk/topia-persistence/src/main/java/org/nuiton/topia/persistence/event/TopiaSchemaListener.java 2014-01-17 17:01:06 UTC (rev 2979) @@ -36,7 +36,7 @@ * <li>...</li> * </ul> * - * @author Arnaud Thimel <thimel@codelutin.com> + * @author Arnaud Thimel : thimel@codelutin.com * @since 3.0 */ public interface TopiaSchemaListener extends EventListener { Modified: trunk/topia-persistence/src/main/java/org/nuiton/topia/persistence/event/TopiaTransactionListener.java =================================================================== --- trunk/topia-persistence/src/main/java/org/nuiton/topia/persistence/event/TopiaTransactionListener.java 2014-01-15 11:27:43 UTC (rev 2978) +++ trunk/topia-persistence/src/main/java/org/nuiton/topia/persistence/event/TopiaTransactionListener.java 2014-01-17 17:01:06 UTC (rev 2979) @@ -1,3 +1,5 @@ +package org.nuiton.topia.persistence.event; + /* * #%L * ToPIA :: Persistence @@ -23,34 +25,31 @@ * #L% */ -package org.nuiton.topia.persistence.event; - import org.nuiton.topia.persistence.internal.support.TopiaFiresSupport; import java.util.EventListener; /** - * To listen transaction operations as commit and rollback. + * To listen transaction operations such as commit and rollback. * <p/> * <b>Warning:</b> Must be attached to the current transaction. * <p/> - * {@link TopiaContext} listens such listeners via {@code javaBeans} methods : + * {@link org.nuiton.topia.persistence.support.TopiaListenableSupport} listens such listeners via javaBeans methods : * <ul> - * <li>{@link TopiaContext#addTopiaTransactionListener(TopiaTransactionListener)}</li> - * <li>{@link TopiaContext#removeTopiaTransactionListener(TopiaTransactionListener)}</li> + * <li>{@link org.nuiton.topia.persistence.support.TopiaListenableSupport#addTopiaTransactionListener(TopiaTransactionListener)}</li> + * <li>{@link org.nuiton.topia.persistence.support.TopiaListenableSupport#removeTopiaTransactionListener(TopiaTransactionListener)}</li> * </ul> * * @author poussin <poussin@codelutin.com> - * @version $Id$ - * @see TopiaContext - * @see TopiaTransactionEvent - * @see TopiaFiresSupport#fireOnPostCommit(TopiaContextImplementor) - * @see TopiaFiresSupport#fireOnPostRollback(TopiaContextImplementor) + * @see org.nuiton.topia.persistence.support.TopiaListenableSupport + * @see org.nuiton.topia.persistence.event.TopiaTransactionEvent + * @see TopiaFiresSupport#fireOnPostCommit(org.nuiton.topia.persistence.TopiaPersistenceContext) + * @see TopiaFiresSupport#fireOnPostRollback(org.nuiton.topia.persistence.TopiaPersistenceContext) */ public interface TopiaTransactionListener extends EventListener { /** - * Fired by {@link TopiaFiresSupport#fireOnPostCommit(TopiaContextImplementor)}. + * Fired by {@link TopiaFiresSupport#fireOnPostCommit(org.nuiton.topia.persistence.TopiaPersistenceContext)}. * <p/> * Says after a commit was performed on listened transaction. * @@ -59,7 +58,7 @@ void commit(TopiaTransactionEvent event); /** - * Fired by {@link TopiaFiresSupport#fireOnPostRollback(TopiaContextImplementor)}. + * Fired by {@link TopiaFiresSupport#fireOnPostRollback(org.nuiton.topia.persistence.TopiaPersistenceContext)}. * <p/> * Says after a rollback was performed on listened transaction. * Modified: trunk/topia-persistence/src/main/java/org/nuiton/topia/persistence/event/package-info.java =================================================================== --- trunk/topia-persistence/src/main/java/org/nuiton/topia/persistence/event/package-info.java 2014-01-15 11:27:43 UTC (rev 2978) +++ trunk/topia-persistence/src/main/java/org/nuiton/topia/persistence/event/package-info.java 2014-01-17 17:01:06 UTC (rev 2979) @@ -22,8 +22,9 @@ * <http://www.gnu.org/licenses/lgpl-3.0.html>. * #L% */ + /** - * Events used for topia services. + * Events used for ToPIA services. * TODO-fdesbois-20100507 : Need more javadoc. */ package org.nuiton.topia.persistence.event; \ No newline at end of file Modified: trunk/topia-persistence/src/main/java/org/nuiton/topia/persistence/internal/AbstractTopiaApplicationContext.java =================================================================== --- trunk/topia-persistence/src/main/java/org/nuiton/topia/persistence/internal/AbstractTopiaApplicationContext.java 2014-01-15 11:27:43 UTC (rev 2978) +++ trunk/topia-persistence/src/main/java/org/nuiton/topia/persistence/internal/AbstractTopiaApplicationContext.java 2014-01-17 17:01:06 UTC (rev 2979) @@ -67,7 +67,7 @@ * It contains only high level methods and new contexts creation (transaction begin, ...). This class has to be extended * by the user, even if some default one could be automatically generated. * - * @author Arnaud Thimel <thimel@codelutin.com> + * @author Arnaud Thimel : thimel@codelutin.com * @since 3.0 */ public abstract class AbstractTopiaApplicationContext<K extends TopiaPersistenceContext> implements TopiaApplicationContext<K> { 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-15 11:27:43 UTC (rev 2978) +++ trunk/topia-persistence/src/main/java/org/nuiton/topia/persistence/internal/AbstractTopiaDao.java 2014-01-17 17:01:06 UTC (rev 2979) @@ -1,3 +1,5 @@ +package org.nuiton.topia.persistence.internal; + /* * #%L * ToPIA :: Persistence @@ -23,20 +25,6 @@ * #L% */ -/* * - * TopiaDAOAbstract.java - * - * Created: 31 déc. 2005 13:10:34 - * - * @author poussin <poussin@codelutin.com> - * @version $Revision$ - * - * Last update: $Date$ - * by : $Author$ - */ - -package org.nuiton.topia.persistence.internal; - import com.google.common.base.Optional; import com.google.common.base.Preconditions; import com.google.common.collect.Iterables; @@ -88,7 +76,7 @@ * * @param <E> the managed entity type * @author bpoussin <poussin@codelutin.com> - * @author Arnaud Thimel <thimel@codelutin.com> + * @author Arnaud Thimel : thimel@codelutin.com * @author Tony CHEMIT <chemit@codelutin.com> */ public abstract class AbstractTopiaDao<E extends TopiaEntity> implements TopiaDao<E> { Copied: trunk/topia-persistence/src/main/java/org/nuiton/topia/persistence/internal/AbstractTopiaEntity.java (from rev 2978, trunk/topia-persistence/src/main/java/org/nuiton/topia/persistence/TopiaEntityAbstract.java) =================================================================== --- trunk/topia-persistence/src/main/java/org/nuiton/topia/persistence/internal/AbstractTopiaEntity.java (rev 0) +++ trunk/topia-persistence/src/main/java/org/nuiton/topia/persistence/internal/AbstractTopiaEntity.java 2014-01-17 17:01:06 UTC (rev 2979) @@ -0,0 +1,360 @@ +/* + * #%L + * ToPIA :: Persistence + * + * $Id$ + * $HeadURL$ + * %% + * Copyright (C) 2004 - 2010 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.internal; + +import org.nuiton.topia.persistence.TopiaEntity; +import org.nuiton.topia.persistence.TopiaEntityContextable; +import org.nuiton.topia.persistence.TopiaException; +import org.nuiton.topia.persistence.internal.support.TopiaFiresSupport; + +import java.beans.PropertyChangeListener; +import java.beans.PropertyChangeSupport; +import java.beans.VetoableChangeListener; +import java.beans.VetoableChangeSupport; +import java.util.Date; +import java.util.List; + +/** + * Classe de base de toutes les entités, cela permet de concentrer le code + * technique dans cette classe. L'identifiant peut-etre n'importe quoi Aucune + * restriction n'est faite dessus, il peut meme changer entre deux types + * d'entité si cela ne pose pas d'autre probleme (heritage entre ces entités). + * + * @author poussin <poussin@codelutin.com> + */ +public abstract class AbstractTopiaEntity implements TopiaEntity { + + private static final long serialVersionUID = -7458577454878852241L; + + protected String topiaId; + + protected long topiaVersion; + + protected Date topiaCreateDate = new Date(); + + transient protected boolean deleted = false; + + transient protected TopiaFiresSupport fireSupport; + + transient protected VetoableChangeSupport readVetoables; + + transient protected PropertyChangeSupport readListeners; + + transient protected VetoableChangeSupport writeVetoables; + + transient protected PropertyChangeSupport writeListeners; + + /** + * Initialize {@link #readVetoables} at first use or after deserialisation. + * + * @return readVetoables + */ + protected VetoableChangeSupport getReadVetoableChangeSupport() { + if (readVetoables == null) { + readVetoables = new VetoableChangeSupport(this); + } + return readVetoables; + } + + /** + * 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 + */ + protected VetoableChangeSupport getWriteVetoableChangeSupport() { + if (writeVetoables == null) { + writeVetoables = new VetoableChangeSupport(this); + } + 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; + } + + @Override + public void setTopiaId(String v) { + topiaId = v; + } + + @Override + public long getTopiaVersion() { + return topiaVersion; + } + + @Override + public void setTopiaVersion(long v) { + topiaVersion = v; + } + + @Override + public Date getTopiaCreateDate() { + return topiaCreateDate; + } + + @Override + public void setTopiaCreateDate(Date topiaCreateDate) { + this.topiaCreateDate = topiaCreateDate; + } + + @Override + public boolean isPersisted() { + // Is or was the entity persisted ? + boolean result = topiaId != null; + // Is the entity deleted ? + result &= !deleted; + return result; + } + + @Override + public void notifyDeleted() { + deleted = true; + } + + @Override + public List<TopiaEntity> getComposite() throws TopiaException { + throw new UnsupportedOperationException(); + } + + @Override + public List<TopiaEntity> getAggregate() throws TopiaException { + throw new UnsupportedOperationException(); + } + + /** + * On utilise la date de creation comme hash code, cette date ne varie pas + * au cours du temps + */ + @Override + public int hashCode() { + Date date = getTopiaCreateDate(); + //TC-20100220 : il se peut que la date de creation soit nulle + // lorsque l'entite est utilise comme objet d'edition d'un formulaire + // par exemple... + int result = date == null ? 0 : date.hashCode(); + return result; + } + + /** + * On est sur que les objets sont bien les memes car s'il n'ont pas d'id + * cela veut dire qu'il ne vienne pas de la meme session donc qu'il sont + * nouveau et different, ou bien qu'ils viennent de la meme session et dans + * ce cas l'egalite == fonctionne. + */ + @Override + public boolean equals(Object obj) { + if (this == obj) { + return true; + } + if (!(obj instanceof TopiaEntity)) { + return false; + } + TopiaEntity other = (TopiaEntity) obj; + if (getTopiaId() == null || other.getTopiaId() == null) { + return false; + } + boolean result = getTopiaId().equals(other.getTopiaId()); + return result; + } + + protected TopiaFiresSupport getFireSupportOrNull() { + if (fireSupport == null) { + if (this instanceof TopiaEntityContextable) { + TopiaEntityContextable contextable = (TopiaEntityContextable) this; + AbstractTopiaDao topiaDAO = (AbstractTopiaDao)contextable.getTopiaDAOSupplier().getDao(getClass()); + fireSupport = topiaDAO.getTopiaFiresSupport(); + } + } + return fireSupport; + } + + protected void fireOnPreRead(String propertyName, Object value) { + TopiaFiresSupport firesSupport = getFireSupportOrNull(); + if (firesSupport != null) { + firesSupport.fireOnPreRead(getReadVetoableChangeSupport(), + this, propertyName, value); + } + } + + protected void fireOnPostRead(String propertyName, Object value) { + TopiaFiresSupport firesSupport = getFireSupportOrNull(); + if (firesSupport != null) { + firesSupport.fireOnPostRead(getReadPropertyChangeSupport(), + this, propertyName, value); + } + } + + protected void fireOnPostRead(String propertyName, int index, + Object value) { + TopiaFiresSupport firesSupport = getFireSupportOrNull(); + if (firesSupport != null) { + firesSupport.fireOnPostRead(getReadPropertyChangeSupport(), + this, propertyName, index, value); + } + } + + protected void fireOnPreWrite(String propertyName, Object oldValue, + Object newValue) { + TopiaFiresSupport firesSupport = getFireSupportOrNull(); + if (firesSupport != null) { + firesSupport.fireOnPreWrite(getWriteVetoableChangeSupport(), + this, propertyName, oldValue, newValue); + } + } + + protected void fireOnPostWrite(String propertyName, Object oldValue, + Object newValue) { + TopiaFiresSupport firesSupport = getFireSupportOrNull(); + if (firesSupport != null) { + firesSupport.fireOnPostWrite( + getWritePropertyChangeSupport(), this, propertyName, oldValue, newValue); + } + } + + protected void fireOnPostWrite(String propertyName, int index, + Object oldValue, Object newValue) { + TopiaFiresSupport firesSupport = getFireSupportOrNull(); + if (firesSupport != null) { + firesSupport.fireOnPostWrite( + getWritePropertyChangeSupport(), this, propertyName, index, oldValue, + newValue); + } + } + + @Override + public void addPropertyChangeListener(String propertyName, + PropertyChangeListener listener) { + getWritePropertyChangeSupport().addPropertyChangeListener(propertyName, listener); + } + + @Override + public void addPropertyChangeListener(PropertyChangeListener listener) { + getWritePropertyChangeSupport().addPropertyChangeListener(listener); + } + + @Override + public void addVetoableChangeListener(String propertyName, + VetoableChangeListener vetoable) { + getWriteVetoableChangeSupport().addVetoableChangeListener(propertyName, vetoable); + } + + @Override + public void addVetoableChangeListener(VetoableChangeListener vetoable) { + getWriteVetoableChangeSupport().addVetoableChangeListener(vetoable); + } + + @Override + public void removePropertyChangeListener(String propertyName, + PropertyChangeListener listener) { + getWritePropertyChangeSupport().removePropertyChangeListener(propertyName, listener); + } + + @Override + public void removePropertyChangeListener(PropertyChangeListener listener) { + getWritePropertyChangeSupport().removePropertyChangeListener(listener); + } + + @Override + public void removeVetoableChangeListener(String propertyName, + VetoableChangeListener vetoable) { + getWriteVetoableChangeSupport().removeVetoableChangeListener(propertyName, vetoable); + } + + @Override + public void removeVetoableChangeListener(VetoableChangeListener vetoable) { + getWriteVetoableChangeSupport().removeVetoableChangeListener(vetoable); + } + + @Override + public void addPropertyListener(String propertyName, + PropertyChangeListener listener) { + getReadPropertyChangeSupport().addPropertyChangeListener(propertyName, listener); + } + + @Override + public void addPropertyListener(PropertyChangeListener listener) { + getReadPropertyChangeSupport().addPropertyChangeListener(listener); + } + + @Override + public void addVetoableListener(String propertyName, + VetoableChangeListener vetoable) { + getReadVetoableChangeSupport().addVetoableChangeListener(propertyName, vetoable); + } + + @Override + public void addVetoableListener(VetoableChangeListener vetoable) { + getReadVetoableChangeSupport().addVetoableChangeListener(vetoable); + } + + @Override + public void removePropertyListener(String propertyName, + PropertyChangeListener listener) { + getReadPropertyChangeSupport().removePropertyChangeListener(propertyName, listener); + } + + @Override + public void removePropertyListener(PropertyChangeListener listener) { + getReadPropertyChangeSupport().removePropertyChangeListener(listener); + } + + @Override + public void removeVetoableListener(String propertyName, + VetoableChangeListener vetoable) { + getReadVetoableChangeSupport().removeVetoableChangeListener(propertyName, vetoable); + } + + @Override + public void removeVetoableListener(VetoableChangeListener vetoable) { + getReadVetoableChangeSupport().removeVetoableChangeListener(vetoable); + } + +} Modified: trunk/topia-persistence/src/main/java/org/nuiton/topia/persistence/internal/AbstractTopiaPersistenceContext.java =================================================================== --- trunk/topia-persistence/src/main/java/org/nuiton/topia/persistence/internal/AbstractTopiaPersistenceContext.java 2014-01-15 11:27:43 UTC (rev 2978) +++ trunk/topia-persistence/src/main/java/org/nuiton/topia/persistence/internal/AbstractTopiaPersistenceContext.java 2014-01-17 17:01:06 UTC (rev 2979) @@ -57,7 +57,7 @@ * Abstract implementation of the TopiaPersistenceContext. This class will be extended by a generated one in order to * generate getXxxDao methods. * - * @author Arnaud Thimel <thimel@codelutin.com> + * @author Arnaud Thimel : thimel@codelutin.com * @since 3.0 */ public abstract class AbstractTopiaPersistenceContext implements TopiaPersistenceContext { Modified: trunk/topia-persistence/src/main/java/org/nuiton/topia/persistence/internal/HibernateProvider.java =================================================================== --- trunk/topia-persistence/src/main/java/org/nuiton/topia/persistence/internal/HibernateProvider.java 2014-01-15 11:27:43 UTC (rev 2978) +++ trunk/topia-persistence/src/main/java/org/nuiton/topia/persistence/internal/HibernateProvider.java 2014-01-17 17:01:06 UTC (rev 2979) @@ -55,7 +55,7 @@ import com.google.common.collect.Lists; /** - * @author Arnaud Thimel <thimel@codelutin.com> + * @author Arnaud Thimel : thimel@codelutin.com */ public class HibernateProvider { Modified: trunk/topia-persistence/src/main/java/org/nuiton/topia/persistence/internal/TopiaHibernateSessionRegistry.java =================================================================== --- trunk/topia-persistence/src/main/java/org/nuiton/topia/persistence/internal/TopiaHibernateSessionRegistry.java 2014-01-15 11:27:43 UTC (rev 2978) +++ trunk/topia-persistence/src/main/java/org/nuiton/topia/persistence/internal/TopiaHibernateSessionRegistry.java 2014-01-17 17:01:06 UTC (rev 2979) @@ -37,7 +37,7 @@ /** * Class used to keep an association between an Hibernate Session and a TopiaPersistenceContext * - * @author Arnaud Thimel <thimel@codelutin.com> + * @author Arnaud Thimel : thimel@codelutin.com * @since 3.0 */ public class TopiaHibernateSessionRegistry { Modified: trunk/topia-persistence/src/main/java/org/nuiton/topia/persistence/internal/support/HibernateTopiaJpaSupport.java =================================================================== --- trunk/topia-persistence/src/main/java/org/nuiton/topia/persistence/internal/support/HibernateTopiaJpaSupport.java 2014-01-15 11:27:43 UTC (rev 2978) +++ trunk/topia-persistence/src/main/java/org/nuiton/topia/persistence/internal/support/HibernateTopiaJpaSupport.java 2014-01-17 17:01:06 UTC (rev 2979) @@ -41,7 +41,7 @@ * This class is the Hibernate implementation of TopiaJpaSupport. It realizes the bridge between the JPA specification * and the technical choice made for its implementation : Hibernate. * - * @author Arnaud Thimel <thimel@codelutin.com> + * @author Arnaud Thimel : thimel@codelutin.com * @since 3.0 */ public class HibernateTopiaJpaSupport implements TopiaJpaSupport { @@ -56,15 +56,15 @@ /** * This flag permits to use (or not) the flush mode when doing queries. - * <p/> - * The normal usage is to says yes (that's why the default value is - * {@code true}), in that case whebn doing queries (says in method - * {@link #findAll(String, Map<String, Object>)} or {@link #find(String, int, int, Map<String, Object>)}) - * it will use the flush mode {@link FlushMode#AUTO}). - * <p/> - * But sometimes, when doing a lot of queries (for some imports for example), + * + * <p>The normal usage is to says yes (that's why the default value is {@code true}), in that case when doing + * queries (says in method {@link #findAll(String, java.util.Map)} or + * {@link #find(String, int, int, java.util.Map)}) it will use the flush mode + * {@link org.hibernate.FlushMode#AUTO}).</p> + * + * <p>But sometimes, when doing a lot of queries (for some imports for example), * we do NOT want the session to be flushed each time we do a find, then you - * can set this flag to {@code false} using the method {@link #setUseFlushMode(boolean)} + * can set this flag to {@code false} using the method {@link #setUseFlushMode(boolean)}</p> * * @since 2.5 */ Modified: trunk/topia-persistence/src/main/java/org/nuiton/topia/persistence/internal/support/HibernateTopiaSqlSupport.java =================================================================== --- trunk/topia-persistence/src/main/java/org/nuiton/topia/persistence/internal/support/HibernateTopiaSqlSupport.java 2014-01-15 11:27:43 UTC (rev 2978) +++ trunk/topia-persistence/src/main/java/org/nuiton/topia/persistence/internal/support/HibernateTopiaSqlSupport.java 2014-01-17 17:01:06 UTC (rev 2979) @@ -40,7 +40,7 @@ import java.util.List; /** - * @author Arnaud Thimel <thimel@codelutin.com> + * @author Arnaud Thimel : thimel@codelutin.com */ public class HibernateTopiaSqlSupport implements TopiaSqlSupport { 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-15 11:27:43 UTC (rev 2978) +++ trunk/topia-persistence/src/main/java/org/nuiton/topia/persistence/internal/support/TopiaHibernateEventListener.java 2014-01-17 17:01:06 UTC (rev 2979) @@ -58,7 +58,7 @@ import com.google.common.base.Preconditions; /** - * @author Arnaud Thimel <thimel@codelutin.com> + * @author Arnaud Thimel : thimel@codelutin.com */ public class TopiaHibernateEventListener implements PreInsertEventListener, PostInsertEventListener, PreLoadEventListener, PostLoadEventListener, PreUpdateEventListener, PostUpdateEventListener, Modified: trunk/topia-persistence/src/main/java/org/nuiton/topia/persistence/internal/support/TopiaServiceSupportImpl.java =================================================================== --- trunk/topia-persistence/src/main/java/org/nuiton/topia/persistence/internal/support/TopiaServiceSupportImpl.java 2014-01-15 11:27:43 UTC (rev 2978) +++ trunk/topia-persistence/src/main/java/org/nuiton/topia/persistence/internal/support/TopiaServiceSupportImpl.java 2014-01-17 17:01:06 UTC (rev 2979) @@ -40,7 +40,7 @@ /** * FIXME AThimel 11/10/13 All this life-cycle has to be reviewed * - * @author Arnaud Thimel <thimel@codelutin.com> + * @author Arnaud Thimel : thimel@codelutin.com */ public class TopiaServiceSupportImpl implements TopiaServiceSupport { Modified: trunk/topia-persistence/src/main/java/org/nuiton/topia/persistence/metadata/package-info.java =================================================================== --- trunk/topia-persistence/src/main/java/org/nuiton/topia/persistence/metadata/package-info.java 2014-01-15 11:27:43 UTC (rev 2978) +++ trunk/topia-persistence/src/main/java/org/nuiton/topia/persistence/metadata/package-info.java 2014-01-17 17:01:06 UTC (rev 2979) @@ -1,11 +1,3 @@ -/** - * Package to define metadatas over {@link TopiaEntity}. - * - * @author tchemit <chemit@codelutin.com> - * @since 2.6.12 - */ -package org.nuiton.topia.persistence.metadata; - /* * #%L * ToPIA :: Persistence @@ -29,3 +21,11 @@ * <http://www.gnu.org/licenses/lgpl-3.0.html>. * #L% */ + +/** + * Package to define metadata over {@link org.nuiton.topia.persistence.TopiaEntity}. + * + * @author tchemit <chemit@codelutin.com> + * @since 2.6.12 + */ +package org.nuiton.topia.persistence.metadata; 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-15 11:27:43 UTC (rev 2978) +++ trunk/topia-persistence/src/main/java/org/nuiton/topia/persistence/package-info.java 2014-01-17 17:01:06 UTC (rev 2979) @@ -22,17 +22,30 @@ * <http://www.gnu.org/licenses/lgpl-3.0.html>. * #L% */ + /** - * This package contains interfaces and abstract classes for entities and daos. - * <p /> - * For daos : {@link org.nuiton.topia.persistence.TopiaDAO} as interface and - * {@link org.nuiton.topia.persistence.TopiaDAOImpl} as implementation. - * <p /> - * For entities : {@link org.nuiton.topia.persistence.TopiaEntity} as interface - * and {@link org.nuiton.topia.persistence.TopiaEntityAbstract} - * as abstract class inherited by generated entities for - * final applications. Generation is done using transformers from {@code - * org.nuiton.topia.generator} package. + * This package contains most of the needed contracts when using ToPIA. * + * <p>To manipulate ToPIA you need to understand the role of both interfaces + * {@link org.nuiton.topia.persistence.TopiaApplicationContext} and + * {@link org.nuiton.topia.persistence.TopiaPersistenceContext}. The implementation of these contracts has been + * generated in your own project under the name "XxxTopiaApplicationContext" and "XxxTopiaPersistenceContext" where + * "Xxx" is the name of your project.</p> + * + * <p>When configuring an application, you may need to use ToPIA defined constants that are listed in the + * {@link org.nuiton.topia.persistence.TopiaConfigurationConstants} contract.</p> + * + * <p>You might want to use a cache in order to keep a list of the running application context, for this particular case + * you can use {@link org.nuiton.topia.persistence.TopiaApplicationContextCache}.</p> + * + * <p>Each entity managed by ToPIA implements the {@link org.nuiton.topia.persistence.TopiaEntity} contract through the + * abstract class {@link org.nuiton.topia.persistence.internal.AbstractTopiaEntity}. You can find some useful methods on + * entities in the {@link org.nuiton.topia.persistence.TopiaEntities} class.</p> + * + * <p>Each Dao implements the {@link org.nuiton.topia.persistence.TopiaDao} contract through the abstract class + * {@link org.nuiton.topia.persistence.internal.AbstractTopiaDao}.</p> + * + * <p>Each service implements the {@link org.nuiton.topia.persistence.TopiaService}</p> + * */ package org.nuiton.topia.persistence; Modified: trunk/topia-persistence/src/main/java/org/nuiton/topia/persistence/support/TopiaHibernateSupport.java =================================================================== --- trunk/topia-persistence/src/main/java/org/nuiton/topia/persistence/support/TopiaHibernateSupport.java 2014-01-15 11:27:43 UTC (rev 2978) +++ trunk/topia-persistence/src/main/java/org/nuiton/topia/persistence/support/TopiaHibernateSupport.java 2014-01-17 17:01:06 UTC (rev 2979) @@ -31,7 +31,7 @@ /** * This API provides methods to interact with Hibernate * - * @author Arnaud Thimel <thimel@codelutin.com> + * @author Arnaud Thimel : thimel@codelutin.com * @since 3.0 */ public interface TopiaHibernateSupport { Modified: trunk/topia-persistence/src/main/java/org/nuiton/topia/persistence/support/TopiaJpaSupport.java =================================================================== --- trunk/topia-persistence/src/main/java/org/nuiton/topia/persistence/support/TopiaJpaSupport.java 2014-01-15 11:27:43 UTC (rev 2978) +++ trunk/topia-persistence/src/main/java/org/nuiton/topia/persistence/support/TopiaJpaSupport.java 2014-01-17 17:01:06 UTC (rev 2979) @@ -30,7 +30,7 @@ /** * This API provides methods to use persistence using JPA queries * - * @author Arnaud Thimel <thimel@codelutin.com> + * @author Arnaud Thimel : thimel@codelutin.com * @since 3.0 */ public interface TopiaJpaSupport { Modified: trunk/topia-persistence/src/main/java/org/nuiton/topia/persistence/support/TopiaListenableSupport.java =================================================================== --- trunk/topia-persistence/src/main/java/org/nuiton/topia/persistence/support/TopiaListenableSupport.java 2014-01-15 11:27:43 UTC (rev 2978) +++ trunk/topia-persistence/src/main/java/org/nuiton/topia/persistence/support/TopiaListenableSupport.java 2014-01-17 17:01:06 UTC (rev 2979) @@ -37,7 +37,7 @@ /** * This API provides methods to add/remove any kind of listener * - * @author Arnaud Thimel <thimel@codelutin.com> + * @author Arnaud Thimel : thimel@codelutin.com * @since 3.0 */ public interface TopiaListenableSupport { Modified: trunk/topia-persistence/src/main/java/org/nuiton/topia/persistence/support/TopiaReplicationSupport.java =================================================================== --- trunk/topia-persistence/src/main/java/org/nuiton/topia/persistence/support/TopiaReplicationSupport.java 2014-01-15 11:27:43 UTC (rev 2978) +++ trunk/topia-persistence/src/main/java/org/nuiton/topia/persistence/support/TopiaReplicationSupport.java 2014-01-17 17:01:06 UTC (rev 2979) @@ -32,7 +32,7 @@ /** * This API provides methods about entities replication to a destination * - * @author Arnaud Thimel <thimel@codelutin.com> + * @author Arnaud Thimel : thimel@codelutin.com * @since 3.0 */ public interface TopiaReplicationSupport { Modified: trunk/topia-persistence/src/main/java/org/nuiton/topia/persistence/support/TopiaServiceSupport.java =================================================================== --- trunk/topia-persistence/src/main/java/org/nuiton/topia/persistence/support/TopiaServiceSupport.java 2014-01-15 11:27:43 UTC (rev 2978) +++ trunk/topia-persistence/src/main/java/org/nuiton/topia/persistence/support/TopiaServiceSupport.java 2014-01-17 17:01:06 UTC (rev 2979) @@ -32,7 +32,7 @@ /** * This API provides methods to manipulate services * - * @author Arnaud Thimel <thimel@codelutin.com> + * @author Arnaud Thimel : thimel@codelutin.com * @since 3.0 */ public interface TopiaServiceSupport { Modified: trunk/topia-persistence/src/main/java/org/nuiton/topia/persistence/support/TopiaSqlSupport.java =================================================================== --- trunk/topia-persistence/src/main/java/org/nuiton/topia/persistence/support/TopiaSqlSupport.java 2014-01-15 11:27:43 UTC (rev 2978) +++ trunk/topia-persistence/src/main/java/org/nuiton/topia/persistence/support/TopiaSqlSupport.java 2014-01-17 17:01:06 UTC (rev 2979) @@ -31,7 +31,7 @@ /** * This API provides methods to run SQL queries * - * @author Arnaud Thimel <thimel@codelutin.com> + * @author Arnaud Thimel : thimel@codelutin.com * @since 3.0 */ public interface TopiaSqlSupport { Modified: trunk/topia-persistence/src/main/java/org/nuiton/topia/persistence/support/TopiaSqlWork.java =================================================================== --- trunk/topia-persistence/src/main/java/org/nuiton/topia/persistence/support/TopiaSqlWork.java 2014-01-15 11:27:43 UTC (rev 2978) +++ trunk/topia-persistence/src/main/java/org/nuiton/topia/persistence/support/TopiaSqlWork.java 2014-01-17 17:01:06 UTC (rev 2979) @@ -31,7 +31,7 @@ * Interface used for any native SQL batch. This interface is highly inspired * of org.hibernate.jdbc.Work. * - * @author Arnaud Thimel <thimel@codelutin.com> + * @author Arnaud Thimel : thimel@codelutin.com * @since 3.0 */ public interface TopiaSqlWork { Modified: trunk/topia-persistence/src/main/java/org/nuiton/topia/persistence/util/TopiaH2Util.java =================================================================== --- trunk/topia-persistence/src/main/java/org/nuiton/topia/persistence/util/TopiaH2Util.java 2014-01-15 11:27:43 UTC (rev 2978) +++ trunk/topia-persistence/src/main/java/org/nuiton/topia/persistence/util/TopiaH2Util.java 2014-01-17 17:01:06 UTC (rev 2979) @@ -1,3 +1,5 @@ +package org.nuiton.topia.persistence.util; + /* * #%L * ToPIA :: Persistence @@ -21,7 +23,6 @@ * <http://www.gnu.org/licenses/lgpl-3.0.html>. * #L% */ -package org.nuiton.topia.persistence.util; import java.io.BufferedInputStream; import java.io.File; @@ -35,7 +36,7 @@ import org.nuiton.topia.persistence.internal.support.TopiaFiresSupport; /** - * @author Arnaud Thimel <thimel@codelutin.com> + * @author Arnaud Thimel : thimel@codelutin.com */ public class TopiaH2Util { @@ -56,7 +57,6 @@ * * @param file file to write backup * @param compress if true then use gzip to compress file - * @see org.nuiton.topia.TopiaContext#backup(java.io.File,boolean) */ public void backup(File file, boolean compress) throws TopiaException { // context.checkClosed("backup"); @@ -74,7 +74,7 @@ * <p/> * Only work for h2 database * - * @see org.nuiton.topia.TopiaContext#restore(java.io.File) + * @param file the source file to use for restore */ public void restore(File file) throws TopiaException { // send event Modified: trunk/topia-persistence/src/main/java/org/nuiton/topia/persistence/util/TopiaUtil.java =================================================================== --- trunk/topia-persistence/src/main/java/org/nuiton/topia/persistence/util/TopiaUtil.java 2014-01-15 11:27:43 UTC (rev 2978) +++ trunk/topia-persistence/src/main/java/org/nuiton/topia/persistence/util/TopiaUtil.java 2014-01-17 17:01:06 UTC (rev 2979) @@ -1,3 +1,5 @@ +package org.nuiton.topia.persistence.util; + /* * #%L * ToPIA :: Persistence @@ -22,7 +24,6 @@ * <http://www.gnu.org/licenses/lgpl-3.0.html>. * #L% */ -package org.nuiton.topia.persistence.util; import com.google.common.base.Preconditions; import com.google.common.base.Supplier; @@ -64,7 +65,6 @@ * * @author bpoussin <poussin@codelutin.com> * @author tchemit <chemit@codelutin.com> - * @version $Id$ */ public class TopiaUtil { @@ -472,9 +472,10 @@ } /** - * @param configuration - * @return - * @deprecated since 3.0, will be remove soon, do not use it, prefer use {@link ConnectionProviderSupplier}. + * @param configuration the Hibernate configuration + * @return an initialized ConnectionProvider given by Hibernate + * @deprecated since 3.0, will be remove soon, do not use it, prefer use + * {@link org.nuiton.topia.persistence.util.TopiaUtil.ConnectionProviderSupplier}. */ @Deprecated protected static ConnectionProvider getConnectionProvider(Configuration configuration) { 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-15 11:27:43 UTC (rev 2978) +++ trunk/topia-persistence/src/test/java/org/nuiton/topia/persistence/DefaultTopiaIdFactoryTest.java 2014-01-17 17:01:06 UTC (rev 2979) @@ -2,6 +2,7 @@ import org.junit.Assert; import org.junit.Test; +import org.nuiton.topia.persistence.internal.AbstractTopiaEntity; import org.nuiton.topia.persistence.internal.DefaultTopiaIdFactory; /** @@ -11,7 +12,7 @@ interface EntityA extends TopiaEntity {} - class EntityAImpl extends TopiaEntityAbstract implements EntityA { + class EntityAImpl extends AbstractTopiaEntity implements EntityA { @Override public void accept(EntityVisitor visitor) throws TopiaException { @@ -21,7 +22,7 @@ interface EntityB extends TopiaEntity {} - class EntityBImpl extends TopiaEntityAbstract implements EntityB { + class EntityBImpl extends AbstractTopiaEntity implements EntityB { @Override public void accept(EntityVisitor visitor) throws TopiaException { Modified: trunk/topia-templates/src/main/java/org/nuiton/topia/templates/EntityEnumTransformer.java =================================================================== --- trunk/topia-templates/src/main/java/org/nuiton/topia/templates/EntityEnumTransformer.java 2014-01-15 11:27:43 UTC (rev 2978) +++ trunk/topia-templates/src/main/java/org/nuiton/topia/templates/EntityEnumTransformer.java 2014-01-17 17:01:06 UTC (rev 2979) @@ -24,10 +24,6 @@ * #L% */ -/*{generator option: parentheses = false}*/ - -/*{generator option: writeString = +}*/ - import java.lang.reflect.Array; import java.util.Arrays; import java.util.List; @@ -50,10 +46,14 @@ import org.nuiton.topia.persistence.util.EntityOperator; import org.nuiton.topia.persistence.util.EntityOperatorStore; +/*{generator option: parentheses = false}*/ + +/*{generator option: writeString = +}*/ + /** * Will generate XyzEntityEnum (where Xyz = Model name) * - * @author Arnaud Thimel <thimel@codelutin.com> + * @author Arnaud Thimel : thimel@codelutin.com * @plexus.component role="org.nuiton.eugene.Template" role-hint="org.nuiton.topia.templates.EntityEnumTransformer" * @since 3.0 */ 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-15 11:27:43 UTC (rev 2978) +++ trunk/topia-templates/src/main/java/org/nuiton/topia/templates/EntityHibernateMappingGenerator.java 2014-01-17 17:01:06 UTC (rev 2979) @@ -1,16 +1,3 @@ -/*{generator option: parentheses = true}*/ -/*{generator option: writeString = output.write}*/ - -/* * -* EntityHibernateMappingGenerator.java -* -* Created: 12 déc. 2005 -* -* @author Arnaud Thimel <thimel@codelutin.com> -* @version $Revision$ -* -*/ - package org.nuiton.topia.templates; /* @@ -59,10 +46,12 @@ import static org.nuiton.topia.templates.TopiaGeneratorUtil.hasUnidirectionalRelationOnAbstractType; +/*{generator option: parentheses = true}*/ +/*{generator option: writeString = output.write}*/ + /** * * @author poussin <poussin@codelutin.com> - * @version $Id$ * @plexus.component role="org.nuiton.eugene.Template" role-hint="org.nuiton.topia.templates.EntityHibernateMappingGenerator" */ public class EntityHibernateMappingGenerator extends ObjectModelGenerator { 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-15 11:27:43 UTC (rev 2978) +++ trunk/topia-templates/src/main/java/org/nuiton/topia/templates/EntityTransformer.java 2014-01-17 17:01:06 UTC (rev 2979) @@ -39,11 +39,11 @@ 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.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.TopiaEntityAbstract; import org.nuiton.topia.persistence.TopiaEntityContextable; import org.nuiton.topia.persistence.util.TopiaEntityHelper; @@ -55,8 +55,6 @@ import static org.nuiton.topia.templates.TopiaGeneratorUtil.hasUnidirectionalRelationOnAbstractType; - - /*{generator option: parentheses = false}*/ /*{generator option: writeString = +}*/ @@ -319,12 +317,12 @@ setSuperClass(outputAbstract, extendClass); } - // Extends TopiaEntityAbstract (only if hasn't parent entity) + // Extends AbstractTopiaEntity (only if hasn't parent entity) if (outputAbstract.getSuperclasses().isEmpty()) { String superClassName = TopiaGeneratorUtil.getEntitySuperClassTagValue(input, model); if (superClassName == null) { - superClassName = TopiaEntityAbstract.class.getName(); + superClassName = AbstractTopiaEntity.class.getName(); } setSuperClass(outputAbstract, superClassName); } Modified: trunk/topia-templates/src/main/java/org/nuiton/topia/templates/TopiaGeneratorUtil.java =================================================================== --- trunk/topia-templates/src/main/java/org/nuiton/topia/templates/TopiaGeneratorUtil.java 2014-01-15 11:27:43 UTC (rev 2978) +++ trunk/topia-templates/src/main/java/org/nuiton/topia/templates/TopiaGeneratorUtil.java 2014-01-17 17:01:06 UTC (rev 2979) @@ -66,11 +66,10 @@ * <p/> * Created: 13 déc. 2005 * - * @author Arnaud Thimel <thimel@codelutin.com> + * @author Arnaud Thimel : thimel@codelutin.com * @author tchemit <tchemit@codelutin.com> * @author fdesbois <fdesbois@codelutin.com> * @author chatellier <chatellier@codelutin.com> - * @version $Id$ */ public class TopiaGeneratorUtil extends JavaGeneratorUtil { Modified: trunk/topia-templates/src/main/java/org/nuiton/topia/templates/TopiaRelationValidator.java =================================================================== --- trunk/topia-templates/src/main/java/org/nuiton/topia/templates/TopiaRelationValidator.java 2014-01-15 11:27:43 UTC (rev 2978) +++ trunk/topia-templates/src/main/java/org/nuiton/topia/templates/TopiaRelationValidator.java 2014-01-17 17:01:06 UTC (rev 2979) @@ -1,15 +1,3 @@ -/* * -* TopiaRelationValidator.java -* -* Created: 31 mars 2006 -* -* @author Arnaud Thimel <thimel@codelutin.com> -* @version $Revision$ -* -* Mise a jour: $Date$ -* par : $Author$ -*/ - package org.nuiton.topia.templates; /* @@ -50,7 +38,9 @@ * <li>Toutes les relations ont des reverseAttribute</li> * </ul> * - * @version $Id$ + * Created: 31 mars 2006 + * + * @author Arnaud Thimel : thimel@codelutin.com */ public class TopiaRelationValidator extends ObjectModelValidator { 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-15 11:27:43 UTC (rev 2978) +++ trunk/topia-templates/src/main/java/org/nuiton/topia/templates/TopiaTagValues.java 2014-01-17 17:01:06 UTC (rev 2979) @@ -36,7 +36,6 @@ import org.nuiton.topia.persistence.internal.AbstractTopiaDao; import org.nuiton.topia.persistence.TopiaDao; import org.nuiton.topia.persistence.TopiaEntity; -import org.nuiton.topia.persistence.TopiaEntityAbstract; import org.nuiton.topia.persistence.TopiaEntityContextable; import static org.nuiton.eugene.ModelPropertiesUtil.TagValueDefinition; @@ -369,7 +368,7 @@ String TAG_DAO_SUPER_CLASS= "daoSuperClass"; /** - * Tag to specify a super class to use instead of {@link TopiaEntityAbstract}. + * 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}. * Modified: trunk/topia-templates/src/main/java/org/nuiton/topia/templates/package-info.java =================================================================== --- trunk/topia-templates/src/main/java/org/nuiton/topia/templates/package-info.java 2014-01-15 11:27:43 UTC (rev 2978) +++ trunk/topia-templates/src/main/java/org/nuiton/topia/templates/package-info.java 2014-01-17 17:01:06 UTC (rev 2979) @@ -22,6 +22,7 @@ * <http://www.gnu.org/licenses/lgpl-3.0.html>. * #L% */ + /** * TODO-FD20100507 : Need update this javadoc for ToPIA 2.4 * @@ -94,7 +95,7 @@ * TopiaEntity</p> * * <p><b><i>EntityAbstractGenerator</i></b> génère une classe qui - * implante l'interface de l'entité et étend TopiaEntityAbstract qui + * implante l'interface de l'entité et étend AbstractTopiaEntity qui * implante les méthodes du framework, méthode d'accès aux attributs * topiaId, topiaVersion et topiaCreateDate.</p> *
participants (1)
-
athimel@users.nuiton.org