Topia-commits
Threads by month
- ----- 2026 -----
- June
- May
- April
- March
- February
- January
- ----- 2025 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2024 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2023 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2022 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2021 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2020 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2019 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2018 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2017 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2016 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2015 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2014 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2013 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2012 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2011 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2010 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2009 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2008 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2007 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2006 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2005 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2004 -----
- December
- November
- October
- September
- August
- July
- June
- May
May 2012
- 4 participants
- 135 discussions
r2570 - in trunk: topia-persistence/src/main/java/org/nuiton/topia/persistence topia-persistence-tck/src/test/java/org/nuiton/topia/tck/it/deletetest topia-persistence-tck/src/test/java/org/nuiton/topia/tck/it/persistence
by athimel@users.nuiton.org 31 May '12
by athimel@users.nuiton.org 31 May '12
31 May '12
Author: athimel
Date: 2012-05-31 12:46:40 +0200 (Thu, 31 May 2012)
New Revision: 2570
Url: http://nuiton.org/repositories/revision/topia/2570
Log:
fixes #2084 Add a method isPersisted() on TopiaEntity
Added:
trunk/topia-persistence-tck/src/test/java/org/nuiton/topia/tck/it/persistence/IsPersistentTest.java
Modified:
trunk/topia-persistence-tck/src/test/java/org/nuiton/topia/tck/it/deletetest/DeleteEntityTest.java
trunk/topia-persistence/src/main/java/org/nuiton/topia/persistence/TopiaDAOImpl.java
trunk/topia-persistence/src/main/java/org/nuiton/topia/persistence/TopiaEntity.java
trunk/topia-persistence/src/main/java/org/nuiton/topia/persistence/TopiaEntityAbstract.java
Modified: trunk/topia-persistence/src/main/java/org/nuiton/topia/persistence/TopiaDAOImpl.java
===================================================================
--- trunk/topia-persistence/src/main/java/org/nuiton/topia/persistence/TopiaDAOImpl.java 2012-05-31 10:08:21 UTC (rev 2569)
+++ trunk/topia-persistence/src/main/java/org/nuiton/topia/persistence/TopiaDAOImpl.java 2012-05-31 10:46:40 UTC (rev 2570)
@@ -248,6 +248,7 @@
public void delete(E e) throws TopiaException {
try {
getEntityManager().remove(e);
+ e.notifyDeleted();
getContext().getFiresSupport().warnOnDeleteEntity(e);
} catch (PersistenceException eee) {
throw new TopiaPersistenceException("Unable to perform delete", eee);
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 2012-05-31 10:08:21 UTC (rev 2569)
+++ trunk/topia-persistence/src/main/java/org/nuiton/topia/persistence/TopiaEntity.java 2012-05-31 10:46:40 UTC (rev 2570)
@@ -133,6 +133,24 @@
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.
+ *
+ * @return true if the entity is persisted and not yet deleted
+ * @since 3.0
+ */
+ boolean isPersisted();
+
+ /**
+ * 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 since 3.0, prefer use the dao method {@link TopiaDAO#getComposite(TopiaEntity)}.
Modified: trunk/topia-persistence/src/main/java/org/nuiton/topia/persistence/TopiaEntityAbstract.java
===================================================================
--- trunk/topia-persistence/src/main/java/org/nuiton/topia/persistence/TopiaEntityAbstract.java 2012-05-31 10:08:21 UTC (rev 2569)
+++ trunk/topia-persistence/src/main/java/org/nuiton/topia/persistence/TopiaEntityAbstract.java 2012-05-31 10:46:40 UTC (rev 2570)
@@ -57,6 +57,8 @@
protected Date topiaCreateDate = new Date();
+ transient protected boolean deleted = false;
+
transient protected TopiaContext topiaContext;
transient protected VetoableChangeSupport readVetoables;
@@ -145,6 +147,20 @@
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;
+ }
+
public TopiaContext getTopiaContext() {
return topiaContext;
}
@@ -157,7 +173,7 @@
if (topiaContext == null) {
topiaContext = context;
} else {
- // XXX AThimel 30/05/2012 Use deprecated TRE because this will be removed with http://nuiton.org/issues/2078
+ // XXX AThimel 30/05/2012 Use deprecated TopiaRruntimeException because this will be removed with http://nuiton.org/issues/2078
throw new TopiaRuntimeException("Remplacement du contexte interdit");
}
}
Modified: trunk/topia-persistence-tck/src/test/java/org/nuiton/topia/tck/it/deletetest/DeleteEntityTest.java
===================================================================
--- trunk/topia-persistence-tck/src/test/java/org/nuiton/topia/tck/it/deletetest/DeleteEntityTest.java 2012-05-31 10:08:21 UTC (rev 2569)
+++ trunk/topia-persistence-tck/src/test/java/org/nuiton/topia/tck/it/deletetest/DeleteEntityTest.java 2012-05-31 10:46:40 UTC (rev 2570)
@@ -116,8 +116,6 @@
Party2 res2 = dao2.findByTopiaId(idPersonne2);
assertNull(res2);
log.debug("ENTITY PERSONNE DELETED !");
-
-
}
/**
@@ -174,7 +172,6 @@
Contact2 res2 = contactDAO.findByTopiaId(idContact);
assertNull(res2);
log.debug("ENTITY PERSONNE DELETED !");
-
}
}
Added: trunk/topia-persistence-tck/src/test/java/org/nuiton/topia/tck/it/persistence/IsPersistentTest.java
===================================================================
--- trunk/topia-persistence-tck/src/test/java/org/nuiton/topia/tck/it/persistence/IsPersistentTest.java (rev 0)
+++ trunk/topia-persistence-tck/src/test/java/org/nuiton/topia/tck/it/persistence/IsPersistentTest.java 2012-05-31 10:46:40 UTC (rev 2570)
@@ -0,0 +1,61 @@
+/*
+ * #%L
+ * ToPIA :: Persistence :: Test Compatibility Kit
+ * $Id$
+ * $HeadURL$
+ * %%
+ * Copyright (C) 2004 - 2012 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.tck.it.persistence;
+
+import junit.framework.Assert;
+import org.junit.Rule;
+import org.junit.Test;
+import org.nuiton.topia.TopiaContext;
+import org.nuiton.topia.TopiaException;
+import org.nuiton.topia.tck.TopiaDatabase;
+import org.nuiton.topia.tck.it.Company;
+import org.nuiton.topia.tck.it.CompanyDAO;
+import org.nuiton.topia.tck.it.TopiaDatabaseIt;
+import org.nuiton.topia.tck.it.TopiaTckItDAOHelper;
+
+/**
+ * @author Arnaud Thimel <thimel(a)codelutin.com>
+ */
+public class IsPersistentTest {
+
+ @Rule
+ public final TopiaDatabase db = new TopiaDatabaseIt();
+
+ @Test
+ public void testIsPersistent() throws TopiaException {
+ TopiaContext context = db.beginTransaction();
+ CompanyDAO companyDAO = TopiaTckItDAOHelper.getCompanyDAO(context);
+
+ Company company = companyDAO.newInstance();
+ Assert.assertFalse(company.isPersisted());
+
+ company.setName("Code Lutin");
+ companyDAO.create(company);
+ Assert.assertTrue(company.isPersisted());
+
+ companyDAO.delete(company);
+ Assert.assertFalse(company.isPersisted());
+ }
+
+}
Property changes on: trunk/topia-persistence-tck/src/test/java/org/nuiton/topia/tck/it/persistence/IsPersistentTest.java
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision HeadURL
Added: svn:eol-style
+ native
1
0
r2569 - in trunk: topia-persistence/src/main/java/org/nuiton/topia topia-persistence/src/main/java/org/nuiton/topia/framework topia-persistence-tck/src/test/java/org/nuiton/topia/tck/legacy/framework topia-service-migration/src/main/java/org/nuiton/topia/migration
by athimel@users.nuiton.org 31 May '12
by athimel@users.nuiton.org 31 May '12
31 May '12
Author: athimel
Date: 2012-05-31 12:08:21 +0200 (Thu, 31 May 2012)
New Revision: 2569
Url: http://nuiton.org/repositories/revision/topia/2569
Log:
Rename TopiaContext#isSchemaExist(Class) to TopiaContext#isTableExists(Class)
Modified:
trunk/topia-persistence-tck/src/test/java/org/nuiton/topia/tck/legacy/framework/TopiaUtilTest.java
trunk/topia-persistence/src/main/java/org/nuiton/topia/TopiaContext.java
trunk/topia-persistence/src/main/java/org/nuiton/topia/framework/TopiaContextImpl.java
trunk/topia-persistence/src/main/java/org/nuiton/topia/framework/TopiaSpecificUtil.java
trunk/topia-service-migration/src/main/java/org/nuiton/topia/migration/TopiaMigrationEngine.java
Modified: trunk/topia-persistence/src/main/java/org/nuiton/topia/TopiaContext.java
===================================================================
--- trunk/topia-persistence/src/main/java/org/nuiton/topia/TopiaContext.java 2012-05-30 16:39:02 UTC (rev 2568)
+++ trunk/topia-persistence/src/main/java/org/nuiton/topia/TopiaContext.java 2012-05-31 10:08:21 UTC (rev 2569)
@@ -438,9 +438,8 @@
*
* @param clazz the researched class
* @return true if the table exists on storage
- * @throws TopiaException if the context is not initialized
*/
- boolean isSchemaExist(Class<?> clazz) throws TopiaException;
+ boolean isTableExists(Class<?> clazz);
/**
* @return the current schema name
Modified: trunk/topia-persistence/src/main/java/org/nuiton/topia/framework/TopiaContextImpl.java
===================================================================
--- trunk/topia-persistence/src/main/java/org/nuiton/topia/framework/TopiaContextImpl.java 2012-05-30 16:39:02 UTC (rev 2568)
+++ trunk/topia-persistence/src/main/java/org/nuiton/topia/framework/TopiaContextImpl.java 2012-05-31 10:08:21 UTC (rev 2569)
@@ -976,7 +976,7 @@
for (EntityType<?> entity : entities) {
String entityName = entity.getName();
Class entityClass = Class.forName(entityName);
- if (isSchemaExist(entityClass)) {
+ if (isTableExists(entityClass)) {
return false;
}
}
@@ -988,8 +988,8 @@
}
@Override
- public boolean isSchemaExist(Class<?> clazz) {
- checkClosed("isSchemaExist");
+ public boolean isTableExists(Class<?> clazz) {
+ checkClosed("isTableExists");
boolean result = getSpecificUtil().isTableExists(clazz);
Modified: trunk/topia-persistence/src/main/java/org/nuiton/topia/framework/TopiaSpecificUtil.java
===================================================================
--- trunk/topia-persistence/src/main/java/org/nuiton/topia/framework/TopiaSpecificUtil.java 2012-05-30 16:39:02 UTC (rev 2568)
+++ trunk/topia-persistence/src/main/java/org/nuiton/topia/framework/TopiaSpecificUtil.java 2012-05-31 10:08:21 UTC (rev 2569)
@@ -46,7 +46,7 @@
*
* @param clazz the researched class
* @return true if the table exists on storage
- * @see TopiaContext#isSchemaExist(Class)
+ * @see TopiaContext#isTableExists(Class)
*/
boolean isTableExists(Class<?> clazz);
Modified: trunk/topia-persistence-tck/src/test/java/org/nuiton/topia/tck/legacy/framework/TopiaUtilTest.java
===================================================================
--- trunk/topia-persistence-tck/src/test/java/org/nuiton/topia/tck/legacy/framework/TopiaUtilTest.java 2012-05-30 16:39:02 UTC (rev 2568)
+++ trunk/topia-persistence-tck/src/test/java/org/nuiton/topia/tck/legacy/framework/TopiaUtilTest.java 2012-05-31 10:08:21 UTC (rev 2569)
@@ -96,7 +96,7 @@
public void testIsSchemaExistFailed() throws Exception {
TopiaContext rootContext = db.getRootCtxt();
rootContext.beginTransaction();
- rootContext.isSchemaExist(String.class);
+ rootContext.isTableExists(String.class);
}
@Test
@@ -106,14 +106,14 @@
// XXX AThimel 10/05/2012 This cannot be done with ToPIA 3 because of
// XXX independence regarding to the JPA implem, which changes the way
// XXX EntityManager is created
-// boolean actual = rootContext.isSchemaExist(PersonImpl.class);
+// boolean actual = rootContext.isTableExists(PersonImpl.class);
boolean actual = false;
assertFalse(actual);
TopiaContext tx = rootContext.beginTransaction();
tx.createSchema();
- actual = rootContext.isSchemaExist(PersonImpl.class);
+ actual = rootContext.isTableExists(PersonImpl.class);
assertTrue(actual);
Modified: trunk/topia-service-migration/src/main/java/org/nuiton/topia/migration/TopiaMigrationEngine.java
===================================================================
--- trunk/topia-service-migration/src/main/java/org/nuiton/topia/migration/TopiaMigrationEngine.java 2012-05-30 16:39:02 UTC (rev 2568)
+++ trunk/topia-service-migration/src/main/java/org/nuiton/topia/migration/TopiaMigrationEngine.java 2012-05-31 10:08:21 UTC (rev 2569)
@@ -523,7 +523,7 @@
// on detecte si la table de versionning existe
- versionTableExist = rootContext.isSchemaExist(TMSVersion.class);
+ versionTableExist = rootContext.isTableExists(TMSVersion.class);
// check if at least one class exists in db
1
0
r2568 - in trunk/topia-persistence-tck/src/test/java/org/nuiton/topia/tck: it/persistence mapping/test12 mapping/test13 replication
by athimel@users.nuiton.org 30 May '12
by athimel@users.nuiton.org 30 May '12
30 May '12
Author: athimel
Date: 2012-05-30 18:39:02 +0200 (Wed, 30 May 2012)
New Revision: 2568
Url: http://nuiton.org/repositories/revision/topia/2568
Log:
Apply exceptions refactoring to tests
Modified:
trunk/topia-persistence-tck/src/test/java/org/nuiton/topia/tck/it/persistence/NaturalIdTest.java
trunk/topia-persistence-tck/src/test/java/org/nuiton/topia/tck/mapping/test12/EntityWithBasicNotNullFieldsTest.java
trunk/topia-persistence-tck/src/test/java/org/nuiton/topia/tck/mapping/test13/EntityWithNaturalIdTest.java
trunk/topia-persistence-tck/src/test/java/org/nuiton/topia/tck/replication/AbstractTopiaReplicationServiceTest.java
trunk/topia-persistence-tck/src/test/java/org/nuiton/topia/tck/replication/TopiaReplicationServiceImplTest.java
Modified: trunk/topia-persistence-tck/src/test/java/org/nuiton/topia/tck/it/persistence/NaturalIdTest.java
===================================================================
--- trunk/topia-persistence-tck/src/test/java/org/nuiton/topia/tck/it/persistence/NaturalIdTest.java 2012-05-30 16:38:41 UTC (rev 2567)
+++ trunk/topia-persistence-tck/src/test/java/org/nuiton/topia/tck/it/persistence/NaturalIdTest.java 2012-05-30 16:39:02 UTC (rev 2568)
@@ -32,6 +32,7 @@
import org.junit.Test;
import org.nuiton.topia.TopiaContext;
import org.nuiton.topia.TopiaException;
+import org.nuiton.topia.persistence.TopiaPersistenceException;
import org.nuiton.topia.tck.TopiaDatabase;
import org.nuiton.topia.tck.it.NaturalizedEntity;
import org.nuiton.topia.tck.it.NaturalizedEntityDAO;
@@ -79,7 +80,7 @@
transaction.commitTransaction();
}
- @Test(expected = TopiaException.class)
+ @Test(expected = TopiaPersistenceException.class)
public void testCreateFailed() throws Exception {
log.debug("Test naturalId : create failed");
TopiaContext transaction = db.beginTransaction();
Modified: trunk/topia-persistence-tck/src/test/java/org/nuiton/topia/tck/mapping/test12/EntityWithBasicNotNullFieldsTest.java
===================================================================
--- trunk/topia-persistence-tck/src/test/java/org/nuiton/topia/tck/mapping/test12/EntityWithBasicNotNullFieldsTest.java 2012-05-30 16:38:41 UTC (rev 2567)
+++ trunk/topia-persistence-tck/src/test/java/org/nuiton/topia/tck/mapping/test12/EntityWithBasicNotNullFieldsTest.java 2012-05-30 16:39:02 UTC (rev 2568)
@@ -28,6 +28,7 @@
import org.junit.Test;
import org.nuiton.topia.TopiaContext;
import org.nuiton.topia.TopiaException;
+import org.nuiton.topia.persistence.TopiaPersistenceException;
import org.nuiton.topia.tck.mapping.AbstractMappingTest;
import java.util.Date;
@@ -50,8 +51,8 @@
aDAO = getDAO(tx, A12A.class);
}
- @Test(expected = TopiaException.class)
- public void createwithNull() throws TopiaException {
+ @Test(expected = TopiaPersistenceException.class)
+ public void createWithNull() throws TopiaException {
long nbA = aDAO.count();
Modified: trunk/topia-persistence-tck/src/test/java/org/nuiton/topia/tck/mapping/test13/EntityWithNaturalIdTest.java
===================================================================
--- trunk/topia-persistence-tck/src/test/java/org/nuiton/topia/tck/mapping/test13/EntityWithNaturalIdTest.java 2012-05-30 16:38:41 UTC (rev 2567)
+++ trunk/topia-persistence-tck/src/test/java/org/nuiton/topia/tck/mapping/test13/EntityWithNaturalIdTest.java 2012-05-30 16:39:02 UTC (rev 2568)
@@ -28,6 +28,7 @@
import org.junit.Test;
import org.nuiton.topia.TopiaContext;
import org.nuiton.topia.TopiaException;
+import org.nuiton.topia.persistence.TopiaPersistenceException;
import org.nuiton.topia.tck.mapping.AbstractMappingTest;
import java.util.Date;
@@ -50,8 +51,8 @@
aDAO = getDAO(tx, A13A.class);
}
- @Test(expected = TopiaException.class)
- public void createwithNull() throws TopiaException {
+ @Test(expected = TopiaPersistenceException.class)
+ public void createWithNull() throws TopiaException {
long nbA = aDAO.count();
Modified: trunk/topia-persistence-tck/src/test/java/org/nuiton/topia/tck/replication/AbstractTopiaReplicationServiceTest.java
===================================================================
--- trunk/topia-persistence-tck/src/test/java/org/nuiton/topia/tck/replication/AbstractTopiaReplicationServiceTest.java 2012-05-30 16:38:41 UTC (rev 2567)
+++ trunk/topia-persistence-tck/src/test/java/org/nuiton/topia/tck/replication/AbstractTopiaReplicationServiceTest.java 2012-05-30 16:39:02 UTC (rev 2568)
@@ -71,7 +71,7 @@
protected TopiaContext ctxt;
- protected TopiaContextImplementor dstCtxt;
+ protected TopiaContext dstCtxt;
protected TopiaReplicationService service;
Modified: trunk/topia-persistence-tck/src/test/java/org/nuiton/topia/tck/replication/TopiaReplicationServiceImplTest.java
===================================================================
--- trunk/topia-persistence-tck/src/test/java/org/nuiton/topia/tck/replication/TopiaReplicationServiceImplTest.java 2012-05-30 16:38:41 UTC (rev 2567)
+++ trunk/topia-persistence-tck/src/test/java/org/nuiton/topia/tck/replication/TopiaReplicationServiceImplTest.java 2012-05-30 16:39:02 UTC (rev 2568)
@@ -33,6 +33,7 @@
import org.nuiton.topia.TopiaException;
import org.nuiton.topia.framework.TopiaContextImplementor;
import org.nuiton.topia.persistence.TopiaEntityEnum;
+import org.nuiton.topia.persistence.TopiaPersistenceException;
import org.nuiton.topia.persistence.util.TopiaEntityIdsMap;
import org.nuiton.topia.replication.model.ReplicationModel;
import org.nuiton.topia.replication.operation.DettachAssociation;
@@ -219,14 +220,14 @@
/**
* Cette methode montre pourquoi la simple replication ne peut pas
- * fonctionne :)
+ * fonctionner :)
* <p/>
* Le replicateur ne deplique pas dans le bon ordre et on a donc des
* violations de clef etrangeres...
*
* @throws Exception pour toute erreur
*/
- @Test(expected = TopiaException.class)
+ @Test(expected = TopiaPersistenceException.class)
public void testSimpleReplicateFailed() throws Exception {
TopiaContext dstRootCtxt = createDb2("testSimpleReplicateFailed");
@@ -234,7 +235,7 @@
//model = service.prepare(contracts, pet.getTopiaId());
TopiaContext srcCtxt = ctxt.beginTransaction();
- dstCtxt = (TopiaContextImplementor) dstRootCtxt.beginTransaction();
+ dstCtxt = dstRootCtxt.beginTransaction();
try {
1
0
30 May '12
Author: athimel
Date: 2012-05-30 18:38:41 +0200 (Wed, 30 May 2012)
New Revision: 2567
Url: http://nuiton.org/repositories/revision/topia/2567
Log:
Refactor exceptions
Added:
trunk/topia-persistence/src/main/java/org/nuiton/topia/TopiaContextIllegalStateException.java
trunk/topia-persistence/src/main/java/org/nuiton/topia/TopiaImportExportException.java
trunk/topia-persistence/src/main/java/org/nuiton/topia/TopiaMisconfigurationException.java
trunk/topia-persistence/src/main/java/org/nuiton/topia/TopiaRootContextInvalidUsageException.java
trunk/topia-persistence/src/main/java/org/nuiton/topia/framework/TopiaQueryInvalidUsageException.java
trunk/topia-persistence/src/main/java/org/nuiton/topia/framework/TopiaSQLException.java
trunk/topia-persistence/src/main/java/org/nuiton/topia/persistence/TopiaPersistenceException.java
Modified:
trunk/topia-persistence/src/main/java/org/nuiton/topia/TopiaException.java
trunk/topia-persistence/src/main/java/org/nuiton/topia/TopiaNotFoundException.java
trunk/topia-persistence/src/main/java/org/nuiton/topia/framework/TopiaContextImpl.java
trunk/topia-persistence/src/main/java/org/nuiton/topia/framework/TopiaH2Util.java
trunk/topia-persistence/src/main/java/org/nuiton/topia/framework/TopiaPersistenceProvider.java
trunk/topia-persistence/src/main/java/org/nuiton/topia/framework/TopiaQuery.java
trunk/topia-persistence/src/main/java/org/nuiton/topia/framework/TopiaSQLQuery.java
trunk/topia-persistence/src/main/java/org/nuiton/topia/generator/DAOHelperTransformer.java
trunk/topia-persistence/src/main/java/org/nuiton/topia/persistence/TopiaDAOImpl.java
trunk/topia-persistence/src/main/java/org/nuiton/topia/persistence/TopiaEntityAbstract.java
trunk/topia-persistence/src/main/java/org/nuiton/topia/persistence/util/DBMapping.java
trunk/topia-service-migration/src/main/java/org/nuiton/topia/migration/MigrationServiceException.java
trunk/topia-service-migration/src/main/java/org/nuiton/topia/migration/TopiaMigrationEngine.java
trunk/topia-service-migration/src/main/java/org/nuiton/topia/migration/mappings/TMSVersionDAO.java
Added: trunk/topia-persistence/src/main/java/org/nuiton/topia/TopiaContextIllegalStateException.java
===================================================================
--- trunk/topia-persistence/src/main/java/org/nuiton/topia/TopiaContextIllegalStateException.java (rev 0)
+++ trunk/topia-persistence/src/main/java/org/nuiton/topia/TopiaContextIllegalStateException.java 2012-05-30 16:38:41 UTC (rev 2567)
@@ -0,0 +1,41 @@
+/*
+ * #%L
+ * ToPIA :: Persistence
+ * $Id$
+ * $HeadURL$
+ * %%
+ * Copyright (C) 2004 - 2012 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;
+
+/**
+ * Exception that represents an illegal TopiaContext state usage. (eg. commit
+ * when no transaction has been opened, context closed, ...)
+ *
+ * @author Arnaud Thimel <thimel(a)codelutin.com>
+ * @since 3.0
+ */
+public class TopiaContextIllegalStateException extends TopiaException {
+
+ private static final long serialVersionUID = -755223973024035180L;
+
+ public TopiaContextIllegalStateException(String message) {
+ super(message);
+ }
+
+}
Property changes on: trunk/topia-persistence/src/main/java/org/nuiton/topia/TopiaContextIllegalStateException.java
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision HeadURL
Added: svn:eol-style
+ native
Modified: trunk/topia-persistence/src/main/java/org/nuiton/topia/TopiaException.java
===================================================================
--- trunk/topia-persistence/src/main/java/org/nuiton/topia/TopiaException.java 2012-05-30 10:35:42 UTC (rev 2566)
+++ trunk/topia-persistence/src/main/java/org/nuiton/topia/TopiaException.java 2012-05-30 16:38:41 UTC (rev 2567)
@@ -28,14 +28,14 @@
/**
* Main exception for ToPIA manipulation errors (entity class not found, context
* unavailable, invalid state, access denied, ...). Since ToPIA 3.0, this
- * exception is unchecked.
+ * exception is abstract and unchecked.
* <p/>
* Created: 23 déc. 2005 23:03:36
*
* @author poussin <poussin(a)codelutin.com>
* @version $Id$
*/
-public class TopiaException extends RuntimeException {
+public abstract class TopiaException extends RuntimeException {
/**
* Version UID
Added: trunk/topia-persistence/src/main/java/org/nuiton/topia/TopiaImportExportException.java
===================================================================
--- trunk/topia-persistence/src/main/java/org/nuiton/topia/TopiaImportExportException.java (rev 0)
+++ trunk/topia-persistence/src/main/java/org/nuiton/topia/TopiaImportExportException.java 2012-05-30 16:38:41 UTC (rev 2567)
@@ -0,0 +1,47 @@
+/*
+ * #%L
+ * ToPIA :: Persistence
+ * $Id$
+ * $HeadURL$
+ * %%
+ * Copyright (C) 2004 - 2012 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;
+
+import org.nuiton.topia.TopiaException;
+
+/**
+ * Exception to handle any import/export failure
+ *
+ * @author Arnaud Thimel <thimel(a)codelutin.com>
+ * @since 3.0
+ * @deprecated as import/export operations are deprecated
+ */
+@Deprecated
+public class TopiaImportExportException extends TopiaException {
+ private static final long serialVersionUID = -8647343923565006463L;
+
+ public TopiaImportExportException(String message) {
+ super(message);
+ }
+
+ public TopiaImportExportException(String message, Throwable cause) {
+ super(message, cause);
+ }
+
+}
Property changes on: trunk/topia-persistence/src/main/java/org/nuiton/topia/TopiaImportExportException.java
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision HeadURL
Added: svn:eol-style
+ native
Added: trunk/topia-persistence/src/main/java/org/nuiton/topia/TopiaMisconfigurationException.java
===================================================================
--- trunk/topia-persistence/src/main/java/org/nuiton/topia/TopiaMisconfigurationException.java (rev 0)
+++ trunk/topia-persistence/src/main/java/org/nuiton/topia/TopiaMisconfigurationException.java 2012-05-30 16:38:41 UTC (rev 2567)
@@ -0,0 +1,44 @@
+/*
+ * #%L
+ * ToPIA :: Persistence
+ * $Id$
+ * $HeadURL$
+ * %%
+ * Copyright (C) 2004 - 2012 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;
+
+/**
+ * Exception that represents a configuration problem.
+ *
+ * @author Arnaud Thimel <thimel(a)codelutin.com>
+ * @since 3.0
+ */
+public class TopiaMisconfigurationException extends TopiaException {
+
+ private static final long serialVersionUID = 6659608403215001967L;
+
+ public TopiaMisconfigurationException(String message) {
+ super(message);
+ }
+
+ public TopiaMisconfigurationException(String message, Throwable cause) {
+ super(message, cause);
+ }
+
+}
Property changes on: trunk/topia-persistence/src/main/java/org/nuiton/topia/TopiaMisconfigurationException.java
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision HeadURL
Added: svn:eol-style
+ native
Modified: trunk/topia-persistence/src/main/java/org/nuiton/topia/TopiaNotFoundException.java
===================================================================
--- trunk/topia-persistence/src/main/java/org/nuiton/topia/TopiaNotFoundException.java 2012-05-30 10:35:42 UTC (rev 2566)
+++ trunk/topia-persistence/src/main/java/org/nuiton/topia/TopiaNotFoundException.java 2012-05-30 16:38:41 UTC (rev 2567)
@@ -26,25 +26,20 @@
package org.nuiton.topia;
/**
- * TODO-FD20100507 : Need javadoc.
+ * Exception that represents some missing object. Most of the time, it is
+ * because a given class could not be found withing the classpath.
*
* Created: 23 déc. 2005 23:04:28
*
* @author poussin <poussin(a)codelutin.com>
* @version $Id$
*/
-public class TopiaNotFoundException extends TopiaException {
+public class TopiaNotFoundException extends TopiaMisconfigurationException {
/** Version UID */
- private static final long serialVersionUID = -8206486077608923797L;
+ private static final long serialVersionUID = -322080381055204593L;
/**
- * Default constructor.
- */
- public TopiaNotFoundException() {
- }
-
- /**
* Constructor with {@code message}.
*
* @param message exception message
@@ -64,12 +59,4 @@
super(message, cause);
}
- /**
- * Constructor for a wrapped TopiaNotFoundException over a {@code cause}.
- *
- * @param cause exception cause
- */
- public TopiaNotFoundException(Throwable cause) {
- super(cause);
- }
}
Added: trunk/topia-persistence/src/main/java/org/nuiton/topia/TopiaRootContextInvalidUsageException.java
===================================================================
--- trunk/topia-persistence/src/main/java/org/nuiton/topia/TopiaRootContextInvalidUsageException.java (rev 0)
+++ trunk/topia-persistence/src/main/java/org/nuiton/topia/TopiaRootContextInvalidUsageException.java 2012-05-30 16:38:41 UTC (rev 2567)
@@ -0,0 +1,41 @@
+/*
+ * #%L
+ * ToPIA :: Persistence
+ * $Id$
+ * $HeadURL$
+ * %%
+ * Copyright (C) 2004 - 2012 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;
+
+/**
+ * Some operations are not possible on the root context. This exception
+ * represents these cases.
+ *
+ * @author Arnaud Thimel <thimel(a)codelutin.com>
+ * @since 3.0
+ */
+public class TopiaRootContextInvalidUsageException extends TopiaException {
+
+ private static final long serialVersionUID = -3010531829428818338L;
+
+ public TopiaRootContextInvalidUsageException(String message) {
+ super(message);
+ }
+
+}
Property changes on: trunk/topia-persistence/src/main/java/org/nuiton/topia/TopiaRootContextInvalidUsageException.java
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision HeadURL
Added: svn:eol-style
+ native
Modified: trunk/topia-persistence/src/main/java/org/nuiton/topia/framework/TopiaContextImpl.java
===================================================================
--- trunk/topia-persistence/src/main/java/org/nuiton/topia/framework/TopiaContextImpl.java 2012-05-30 10:35:42 UTC (rev 2566)
+++ trunk/topia-persistence/src/main/java/org/nuiton/topia/framework/TopiaContextImpl.java 2012-05-30 16:38:41 UTC (rev 2567)
@@ -41,8 +41,11 @@
import org.dom4j.io.XMLWriter;
import org.nuiton.topia.TopiaContext;
import org.nuiton.topia.TopiaContextFactory;
-import org.nuiton.topia.TopiaException;
+import org.nuiton.topia.TopiaContextIllegalStateException;
+import org.nuiton.topia.TopiaImportExportException;
+import org.nuiton.topia.TopiaMisconfigurationException;
import org.nuiton.topia.TopiaNotFoundException;
+import org.nuiton.topia.TopiaRootContextInvalidUsageException;
import org.nuiton.topia.event.TopiaContextListener;
import org.nuiton.topia.event.TopiaEntitiesVetoable;
import org.nuiton.topia.event.TopiaEntityListener;
@@ -54,6 +57,7 @@
import org.nuiton.topia.persistence.TopiaDAOImpl;
import org.nuiton.topia.persistence.TopiaEntity;
import org.nuiton.topia.persistence.TopiaIdUtil;
+import org.nuiton.topia.persistence.TopiaPersistenceException;
import javax.persistence.EntityManager;
import javax.persistence.EntityManagerFactory;
@@ -306,7 +310,7 @@
@Override
public EntityManager getEntityManager() {
if (entityManager == null) {
- throw new TopiaException(
+ throw new TopiaContextIllegalStateException(
"No EntityManager found. Please open first a new " +
"transaction using 'beginTransaction()' method.");
}
@@ -334,7 +338,9 @@
result = getParentContext().getSpecificUtil();
}
if (result == null) {
- throw new TopiaException("No TopiaSpecificUtil found.");
+ throw new TopiaMisconfigurationException("TopiaSpecificUtil not " +
+ "found. Please check that you're using a " +
+ "topia-persistence-xxx implementation");
}
return result;
}
@@ -479,8 +485,9 @@
throw new IllegalArgumentException(message);
}
if (TopiaPredicates.IS_ROOT_CONTEXT.apply(this)) {
- throw new TopiaException(
- "You are on root context, you MUST open a transaction to perform any database access.");
+ throw new TopiaRootContextInvalidUsageException(
+ "You are on the root context, you MUST open a transaction" +
+ " to perform any database access.");
}
Set<EntityType<?>> entities = getEntityManagerFactory().getMetamodel().getEntities();
boolean found = false;
@@ -503,7 +510,7 @@
String exceptionMessage = String.format(
"Entity type '%s' not managed by this context, you probably forgot to declare it.",
entityClass.getName());
- throw new TopiaException(exceptionMessage);
+ throw new TopiaMisconfigurationException(exceptionMessage);
}
TopiaDAO<E> result = (TopiaDAO<E>) daoCache.get(entityClass);
@@ -559,24 +566,28 @@
// maintenant, sinon lorsque l'on fait des acces a la base, une
// transaction par defaut est utilisé mais elle n'est jamais vraiment
// fermé ce qui pose des problemes de lock sur les tables.
+ boolean couldNotCreate = true;
try {
-// result.hibernate.beginTransaction();
result.entityManager.getTransaction().begin();
- } catch (Exception eee) {
+ couldNotCreate = false;
+ } catch (PersistenceException pe) {
+ throw new TopiaPersistenceException(
+ "An error occurred while getting a new transaction : " +
+ pe.getMessage(), pe);
+ } finally {
- // on a pas pu ouvrir la transaction, on faut donc tout fermer
- // et declancher une exception
- try {
- result.entityManager.close();
- } catch (PersistenceException e1) {
- if (log.isErrorEnabled()) {
- log.error("Could not close entityManager session", e1);
+ if (couldNotCreate) {
+ // on a pas pu ouvrir la transaction, il faut donc tout fermer
+ // et declancher une exception
+ try {
+ result.entityManager.close();
+ } catch (PersistenceException pe) {
+ if (log.isErrorEnabled()) {
+ log.error("Could not close entityManager session", pe);
+ }
}
}
- throw new TopiaException(
- "An error occurred while getting a new transaction : "
- + eee.getMessage(), eee);
}
// 20081217 : add child AFTER EntityManager opening
@@ -590,8 +601,8 @@
@Override
public void commitTransaction() {
if (TopiaPredicates.IS_ROOT_CONTEXT.apply(this)) {
- String message = String.format("Operation '%s' is not permitted on root context", "commitTransaction");
- throw new TopiaException(message);
+ throw new TopiaRootContextInvalidUsageException("Operation " +
+ "'commitTransaction' is not permitted on root context");
}
checkClosed("commitTransaction");
@@ -608,18 +619,22 @@
entityManager.getTransaction().begin();
- } catch (Exception eee) {
- throw new TopiaException(
+ } catch (IllegalStateException ise) {
+ throw new TopiaPersistenceException(
"An error occurred during commit operation : " +
- eee.getMessage(), eee);
+ ise.getMessage(), ise);
+ } catch (PersistenceException pe) {
+ throw new TopiaPersistenceException(
+ "An error occurred during commit operation : " +
+ pe.getMessage(), pe);
}
}
@Override
public void rollbackTransaction() {
if (TopiaPredicates.IS_ROOT_CONTEXT.apply(this)) {
- String message = String.format("Operation '%s' is not permitted on root context", "rollbackTransaction");
- throw new TopiaException(message);
+ throw new TopiaRootContextInvalidUsageException("Operation " +
+ "'rollbackTransaction' is not permitted on root context");
}
checkClosed("rollbackTransaction");
try {
@@ -641,7 +656,7 @@
}
} catch (PersistenceException eee) {
- throw new TopiaException(
+ throw new TopiaPersistenceException(
"An error occurred during rollback operation : " +
eee.getMessage(), eee);
}
@@ -696,7 +711,7 @@
String message = String.format(
"This context is closed, unable to perform operation '%s'",
method);
- throw new TopiaException(message);
+ throw new TopiaContextIllegalStateException(message);
}
}
@@ -896,11 +911,11 @@
List result = query.getResultList();
result = firesSupport.fireEntitiesLoad(this, result);
return result;
- } catch (PersistenceException eee) {
+ } catch (PersistenceException pe) {
String message = String.format(
"An error occurred (%s) during a query operation : %s",
- eee.getMessage(), jpaql);
- throw new TopiaException(message, eee);
+ pe.getMessage(), jpaql);
+ throw new TopiaPersistenceException(message, pe);
}
}
@@ -917,11 +932,11 @@
}
int result = query.executeUpdate();
return result;
- } catch (PersistenceException eee) {
+ } catch (PersistenceException pe) {
String message = String.format(
"An error occurred (%s) during a query operation : %s",
- eee.getMessage(), jpaql);
- throw new TopiaException(message, eee);
+ pe.getMessage(), jpaql);
+ throw new TopiaPersistenceException(message, pe);
}
}
@@ -941,8 +956,8 @@
try {
Query nativeQuery = getEntityManager().createNativeQuery(sqlScript);
nativeQuery.executeUpdate();
- } catch (PersistenceException e) {
- throw new TopiaException("Could not execute sql code", e);
+ } catch (PersistenceException pe) {
+ throw new TopiaPersistenceException("Could not execute sql code", pe);
}
}
@@ -967,14 +982,13 @@
}
return true;
} catch (ClassNotFoundException cnfe) {
- throw new TopiaException(
+ throw new TopiaNotFoundException(
"Unable to detect if schema is empty", cnfe);
}
}
@Override
- public boolean isSchemaExist(Class<?> clazz)
- {
+ public boolean isSchemaExist(Class<?> clazz) {
checkClosed("isSchemaExist");
boolean result = getSpecificUtil().isTableExists(clazz);
@@ -994,10 +1008,10 @@
getFiresSupport().firePreCreateSchema(this);
getSpecificUtil().createSchema(showSchema);
getFiresSupport().firePostCreateSchema(this);
- } catch (PersistenceException eee) {
- throw new TopiaException(
+ } catch (PersistenceException pe) {
+ throw new TopiaPersistenceException(
"Schema could not be created for the following reason : "
- + eee.getMessage(), eee);
+ + pe.getMessage(), pe);
}
}
@@ -1005,10 +1019,10 @@
public void showCreateSchema() {
try {
getSpecificUtil().showCreateSchema();
- } catch (PersistenceException eee) {
- throw new TopiaException(
+ } catch (PersistenceException pe) {
+ throw new TopiaPersistenceException(
"Schema creation could not be displayed for the following reason : "
- + eee.getMessage(), eee);
+ + pe.getMessage(), pe);
}
}
@@ -1019,10 +1033,10 @@
getFiresSupport().firePreUpdateSchema(this);
getSpecificUtil().updateSchema(showSchema);
getFiresSupport().firePostUpdateSchema(this);
- } catch (PersistenceException eee) {
- throw new TopiaException(
+ } catch (PersistenceException pe) {
+ throw new TopiaPersistenceException(
"Schema could not be updated for the following reason : "
- + eee.getMessage(), eee);
+ + pe.getMessage(), pe);
}
}
@@ -1193,7 +1207,7 @@
log.debug("Lecture du document terminee");
}
} catch (DocumentException de) {
- throw new TopiaException(
+ throw new TopiaImportExportException(
"Could not read XML document for following reason : %s" +
de.getMessage(), de);
}
@@ -1204,7 +1218,7 @@
getSpecificUtil().importXML(this, elements);
} else {
- throw new TopiaException("Empty document");
+ throw new TopiaImportExportException("Empty document");
}
}
@@ -1235,14 +1249,14 @@
result.write(doc);
result.close();
- } catch (PersistenceException eee) {
- throw new TopiaException(
+ } catch (PersistenceException pe) {
+ throw new TopiaPersistenceException(
"An error occurred during export operation : %s" +
- eee.getMessage(), eee);
- } catch (IOException eee) {
- throw new TopiaException(
+ pe.getMessage(), pe);
+ } catch (IOException ioe) {
+ throw new TopiaImportExportException(
"An error occurred during export operation : %s" +
- eee.getMessage(), eee);
+ ioe.getMessage(), ioe);
}
}
@@ -1272,9 +1286,9 @@
" was sucessfully done.");
}
}
- } catch (PersistenceException eee) {
- throw new TopiaException(
- "An error occurs while a replication operation : " + eee.getMessage(), eee);
+ } catch (PersistenceException pe) {
+ throw new TopiaPersistenceException(
+ "An error occurs while a replication operation : " + pe.getMessage(), pe);
}
}
@@ -1337,10 +1351,10 @@
String className = entityType.getName();
try {
entityAndCondition[i++] = Class.forName(className);
- } catch (ClassNotFoundException e) {
+ } catch (ClassNotFoundException cnfe) {
// should never happen!
- throw new TopiaException(
- "class cast exception for entity " + className);
+ throw new TopiaNotFoundException(
+ "Entity class registered but not found " + className);
}
entityAndCondition[i++] = null;
@@ -1389,9 +1403,9 @@
destinationContext.receiveReplicatedEntity(entity);
}
- } catch (PersistenceException eee) {
- throw new TopiaException(
- "An error occurs while a replication operation : " + eee.getMessage(), eee);
+ } catch (PersistenceException pe) {
+ throw new TopiaPersistenceException(
+ "An error occurs while a replication operation : " + pe.getMessage(), pe);
}
}
Modified: trunk/topia-persistence/src/main/java/org/nuiton/topia/framework/TopiaH2Util.java
===================================================================
--- trunk/topia-persistence/src/main/java/org/nuiton/topia/framework/TopiaH2Util.java 2012-05-30 10:35:42 UTC (rev 2566)
+++ trunk/topia-persistence/src/main/java/org/nuiton/topia/framework/TopiaH2Util.java 2012-05-30 16:38:41 UTC (rev 2567)
@@ -54,20 +54,16 @@
*/
public void backup(File file, boolean compress) throws TopiaException {
context.checkClosed("backup");
- try {
- String options = "";
- if (compress) {
- options += " COMPRESSION GZIP";
- }
- Query query = context.getEntityManager().createNativeQuery(
- "SCRIPT TO '" + file.getAbsolutePath() + "'" + options);
- query.getResultList();
+ String options = "";
+ if (compress) {
+ options += " COMPRESSION GZIP";
+ }
- } catch (Exception eee) {
- throw new TopiaException(
- "Unable to backup to file : " + eee.getMessage(), eee);
- }
+ Query query = context.getEntityManager().createNativeQuery(
+ "SCRIPT TO '" + file.getAbsolutePath() + "'" + options);
+ query.getResultList();
+
}
/**
@@ -112,7 +108,7 @@
// send event AFTER restore
context.getFiresSupport().firePostRestoreSchema(context);
} catch (Exception eee) {
- throw new TopiaException(
+ throw new TopiaH2UtilException(
"Unable to restore from file : " + eee.getMessage() + ". " +
"SQL is " + sql, eee);
}
@@ -137,9 +133,21 @@
tx.closeContext();
root.finalize();
} catch (Throwable eee) {
- throw new TopiaException(
+ throw new TopiaH2UtilException(
"Unable to perform clear operation : " + eee.getMessage(), eee);
}
}
+ /**
+ * Exception only used within TopiaH2Util
+ */
+ private class TopiaH2UtilException extends TopiaException {
+
+ private static final long serialVersionUID = -7874205136201318340L;
+
+ public TopiaH2UtilException(String message, Throwable cause) {
+ super(message, cause);
+ }
+
+ }
}
Modified: trunk/topia-persistence/src/main/java/org/nuiton/topia/framework/TopiaPersistenceProvider.java
===================================================================
--- trunk/topia-persistence/src/main/java/org/nuiton/topia/framework/TopiaPersistenceProvider.java 2012-05-30 10:35:42 UTC (rev 2566)
+++ trunk/topia-persistence/src/main/java/org/nuiton/topia/framework/TopiaPersistenceProvider.java 2012-05-30 16:38:41 UTC (rev 2567)
@@ -25,6 +25,7 @@
import org.apache.commons.lang3.tuple.Pair;
import org.nuiton.topia.TopiaException;
+import org.nuiton.topia.TopiaMisconfigurationException;
import javax.persistence.EntityManagerFactory;
import javax.persistence.spi.PersistenceProvider;
@@ -69,14 +70,14 @@
Set<Class<?>> entityClasses = (Set<Class<?>>) map.get(TOPIA_ENTITIES);
if (entityClasses == null) {
String message = String.format(MISSING_PROPERTY, TOPIA_ENTITIES);
- throw new TopiaException(message);
+ throw new TopiaMisconfigurationException(message);
}
// Get the TopiaContextImplementor
TopiaContextImplementor topiaContext = (TopiaContextImplementor)map.get(TOPIA_CONTEXT);
if (topiaContext == null) {
String message = String.format(MISSING_PROPERTY, TOPIA_CONTEXT);
- throw new TopiaException(message);
+ throw new TopiaMisconfigurationException(message);
}
// Delegate creation to the specific JPA implementation
Modified: trunk/topia-persistence/src/main/java/org/nuiton/topia/framework/TopiaQuery.java
===================================================================
--- trunk/topia-persistence/src/main/java/org/nuiton/topia/framework/TopiaQuery.java 2012-05-30 10:35:42 UTC (rev 2566)
+++ trunk/topia-persistence/src/main/java/org/nuiton/topia/framework/TopiaQuery.java 2012-05-30 16:38:41 UTC (rev 2567)
@@ -1557,7 +1557,7 @@
if (userSelects.size() > 1) {
// can not count this on multiple select...
- throw new TopiaException(
+ throw new TopiaQueryInvalidUsageException(
"To count, can not have more than one select, but found " +
userSelects);
}
@@ -1653,7 +1653,7 @@
*/
protected <T extends TopiaEntity> Object loadProperty(T entity,
String property)
- throws TopiaException {
+ throws TopiaQueryInvalidUsageException {
try {
Object res = PropertyUtils.getProperty(entity, property);
if (log.isDebugEnabled()) {
@@ -1666,15 +1666,15 @@
}
return res;
} catch (IllegalAccessException eee) {
- throw new TopiaException("Illegal access on property " +
+ throw new TopiaQueryInvalidUsageException("Illegal access on property " +
property + " from entity " +
entity.getClass().getName(), eee);
} catch (InvocationTargetException eee) {
- throw new TopiaException("Invocation error on entity " +
+ throw new TopiaQueryInvalidUsageException("Invocation error on entity " +
entity.getClass().getName() + " for property " +
property, eee);
} catch (NoSuchMethodException eee) {
- throw new TopiaException("Getter method does not exist for" +
+ throw new TopiaQueryInvalidUsageException("Getter method does not exist for" +
" property " + property + " from entity " +
entity.getClass().getName(), eee);
}
Added: trunk/topia-persistence/src/main/java/org/nuiton/topia/framework/TopiaQueryInvalidUsageException.java
===================================================================
--- trunk/topia-persistence/src/main/java/org/nuiton/topia/framework/TopiaQueryInvalidUsageException.java (rev 0)
+++ trunk/topia-persistence/src/main/java/org/nuiton/topia/framework/TopiaQueryInvalidUsageException.java 2012-05-30 16:38:41 UTC (rev 2567)
@@ -0,0 +1,46 @@
+/*
+ * #%L
+ * ToPIA :: Persistence
+ * $Id$
+ * $HeadURL$
+ * %%
+ * Copyright (C) 2004 - 2012 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.framework;
+
+import org.nuiton.topia.TopiaException;
+
+/**
+ * Exception that represents an invalid {@link TopiaQuery} usage.
+ *
+ * @author Arnaud Thimel <thimel(a)codelutin.com>
+ * @since 3.0
+ */
+public class TopiaQueryInvalidUsageException extends TopiaException {
+
+ private static final long serialVersionUID = -9025508741037436698L;
+
+ public TopiaQueryInvalidUsageException(String message) {
+ super(message);
+ }
+
+ public TopiaQueryInvalidUsageException(String message, Throwable cause) {
+ super(message, cause);
+ }
+
+}
Property changes on: trunk/topia-persistence/src/main/java/org/nuiton/topia/framework/TopiaQueryInvalidUsageException.java
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision HeadURL
Added: svn:eol-style
+ native
Added: trunk/topia-persistence/src/main/java/org/nuiton/topia/framework/TopiaSQLException.java
===================================================================
--- trunk/topia-persistence/src/main/java/org/nuiton/topia/framework/TopiaSQLException.java (rev 0)
+++ trunk/topia-persistence/src/main/java/org/nuiton/topia/framework/TopiaSQLException.java 2012-05-30 16:38:41 UTC (rev 2567)
@@ -0,0 +1,44 @@
+/*
+ * #%L
+ * ToPIA :: Persistence
+ * $Id$
+ * $HeadURL$
+ * %%
+ * Copyright (C) 2004 - 2012 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.framework;
+
+import org.nuiton.topia.TopiaException;
+
+import java.sql.SQLException;
+
+/**
+ * Exception that handles any {@link SQLException} for {@link TopiaSQLQuery}
+ *
+ * @author Arnaud Thimel <thimel(a)codelutin.com>
+ * @since 3.0
+ */
+public class TopiaSQLException extends TopiaException {
+
+ private static final long serialVersionUID = -4070739964219494983L;
+
+ public TopiaSQLException(String message, SQLException cause) {
+ super(message, cause);
+ }
+
+}
Property changes on: trunk/topia-persistence/src/main/java/org/nuiton/topia/framework/TopiaSQLException.java
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision HeadURL
Added: svn:eol-style
+ native
Modified: trunk/topia-persistence/src/main/java/org/nuiton/topia/framework/TopiaSQLQuery.java
===================================================================
--- trunk/topia-persistence/src/main/java/org/nuiton/topia/framework/TopiaSQLQuery.java 2012-05-30 10:35:42 UTC (rev 2566)
+++ trunk/topia-persistence/src/main/java/org/nuiton/topia/framework/TopiaSQLQuery.java 2012-05-30 16:38:41 UTC (rev 2567)
@@ -26,6 +26,7 @@
import org.nuiton.topia.TopiaContext;
import org.nuiton.topia.TopiaException;
+import org.nuiton.topia.persistence.TopiaPersistenceException;
import java.sql.Connection;
import java.sql.PreparedStatement;
@@ -70,7 +71,7 @@
*
* @param tx the transaction used to execute the query.
* @return the single result or {@code null} if none found.
- * @throws TopiaException for any pb
+ * @throws TopiaSQLException for any pb
*/
public O findSingleResult(TopiaContext tx) throws TopiaException {
final List<O> result = new ArrayList<O>();
@@ -86,8 +87,8 @@
findSingleResult(result, set);
- } catch (Exception e) {
- throw new TopiaException("Could not execute query", e);
+ } catch (SQLException sqle) {
+ throw new TopiaSQLException("Could not execute query", sqle);
} finally {
ps.close();
}
@@ -101,7 +102,7 @@
*
* @param tx the transaction used to execute the query.
* @return the list of results (the list is empty if non result is found).
- * @throws TopiaException for any pb
+ * @throws TopiaSQLException for any pb
*/
public List<O> findMultipleResult(TopiaContext tx) throws TopiaException {
final List<O> result = new ArrayList<O>();
@@ -117,8 +118,8 @@
findMultipleResult(result, set);
- } catch (Exception e) {
- throw new TopiaException("Could not execute query", e);
+ } catch (SQLException sqle) {
+ throw new TopiaSQLException("Could not execute query", sqle);
} finally {
ps.close();
}
Modified: trunk/topia-persistence/src/main/java/org/nuiton/topia/generator/DAOHelperTransformer.java
===================================================================
--- trunk/topia-persistence/src/main/java/org/nuiton/topia/generator/DAOHelperTransformer.java 2012-05-30 10:35:42 UTC (rev 2566)
+++ trunk/topia-persistence/src/main/java/org/nuiton/topia/generator/DAOHelperTransformer.java 2012-05-30 16:38:41 UTC (rev 2567)
@@ -36,6 +36,7 @@
import org.nuiton.eugene.models.object.xml.ObjectModelEnumerationImpl;
import org.nuiton.topia.TopiaContext;
import org.nuiton.topia.TopiaException;
+import org.nuiton.topia.TopiaNotFoundException;
import org.nuiton.topia.framework.TopiaContextImplementor;
import org.nuiton.topia.persistence.TopiaDAO;
import org.nuiton.topia.persistence.TopiaEntity;
@@ -106,6 +107,7 @@
entityEnumName
);
addImport(daoHelper, TopiaException.class);
+ addImport(daoHelper, TopiaNotFoundException.class);
addImport(daoHelper, TopiaEntityEnum.class);
addImport(daoHelper, EntityOperatorStore.class);
addImport(daoHelper, Arrays.class);
@@ -473,7 +475,7 @@
try {
implementation = (Class<? extends TopiaEntity>) Class.forName(implementationFQN);
} catch (ClassNotFoundException e) {
- throw new TopiaException("could not find class " + implementationFQN, e);
+ throw new TopiaNotFoundException("Could not find class " + implementationFQN, e);
}
}
return implementation;
Modified: trunk/topia-persistence/src/main/java/org/nuiton/topia/persistence/TopiaDAOImpl.java
===================================================================
--- trunk/topia-persistence/src/main/java/org/nuiton/topia/persistence/TopiaDAOImpl.java 2012-05-30 10:35:42 UTC (rev 2566)
+++ trunk/topia-persistence/src/main/java/org/nuiton/topia/persistence/TopiaDAOImpl.java 2012-05-30 16:38:41 UTC (rev 2567)
@@ -43,6 +43,7 @@
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.nuiton.topia.TopiaException;
+import org.nuiton.topia.TopiaMisconfigurationException;
import org.nuiton.topia.event.TopiaEntityListener;
import org.nuiton.topia.event.TopiaEntityVetoable;
import org.nuiton.topia.framework.TopiaContextImplementor;
@@ -89,8 +90,7 @@
}
@Override
- public void init(TopiaContextImplementor context, Class<E> entityClass)
- throws TopiaException {
+ public void init(TopiaContextImplementor context, Class<E> entityClass) {
log.debug("init dao for " + entityClass.getName());
this.context = context;
this.entityClass = entityClass;
@@ -103,7 +103,7 @@
@SuppressWarnings("unchecked")
@Override
- public E newInstance() throws TopiaException {
+ public E newInstance() {
if (log.isDebugEnabled()) {
log.debug("entityClass = " + entityClass);
}
@@ -113,25 +113,23 @@
try {
E result = implementation.newInstance();
return result;
- } catch (Exception e) {
- throw new TopiaException(
+ } catch (Exception eee) {
+ throw new TopiaMisconfigurationException(
"Impossible de trouver ou d'instancier la classe "
- + implementation);
+ + implementation, eee);
}
}
@Override
- public <U extends TopiaEntity> List<U> findUsages(Class<U> type, E e)
- throws TopiaException {
- // must be implemented by specialized dao
- throw new UnsupportedOperationException();
+ public <U extends TopiaEntity> List<U> findUsages(Class<U> type, E e) {
+ throw new UnsupportedOperationException(
+ "This method must be overridden in generated DAO");
}
@Override
- public Map<Class<? extends TopiaEntity>, List<? extends TopiaEntity>> findAllUsages(E e)
- throws TopiaException {
- // must be implemented by specialized dao
- throw new UnsupportedOperationException();
+ public Map<Class<? extends TopiaEntity>, List<? extends TopiaEntity>> findAllUsages(E e) {
+ throw new UnsupportedOperationException(
+ "This method must be overridden in generated DAO");
}
@Override
@@ -242,7 +240,7 @@
getContext().getFiresSupport().warnOnUpdateEntity(e);
return e;
} catch (PersistenceException eee) {
- throw new TopiaException(eee);
+ throw new TopiaPersistenceException("Unable to perform update", eee);
}
}
@@ -252,7 +250,7 @@
getEntityManager().remove(e);
getContext().getFiresSupport().warnOnDeleteEntity(e);
} catch (PersistenceException eee) {
- throw new TopiaException(eee);
+ throw new TopiaPersistenceException("Unable to perform delete", eee);
}
}
@@ -489,14 +487,14 @@
public Multimap<Class<? extends TopiaEntity>, TopiaEntity> getComposite(
E entity) throws TopiaException {
throw new UnsupportedOperationException(
- "This method must be overided in generated DAO");
+ "This method must be overridden in generated DAO");
}
@Override
public Multimap<Class<? extends TopiaEntity>, TopiaEntity> getAggregate(
E entity) throws TopiaException {
throw new UnsupportedOperationException(
- "This method must be overided in generated DAO");
+ "This method must be overridden in generated DAO");
}
/**
Modified: trunk/topia-persistence/src/main/java/org/nuiton/topia/persistence/TopiaEntityAbstract.java
===================================================================
--- trunk/topia-persistence/src/main/java/org/nuiton/topia/persistence/TopiaEntityAbstract.java 2012-05-30 10:35:42 UTC (rev 2566)
+++ trunk/topia-persistence/src/main/java/org/nuiton/topia/persistence/TopiaEntityAbstract.java 2012-05-30 16:38:41 UTC (rev 2567)
@@ -27,6 +27,7 @@
import org.nuiton.topia.TopiaContext;
import org.nuiton.topia.TopiaException;
+import org.nuiton.topia.TopiaRuntimeException;
import org.nuiton.topia.framework.TopiaContextImplementor;
import java.beans.PropertyChangeListener;
@@ -150,13 +151,14 @@
/**
* @param context The context to set.
- * @throws TopiaException if any pb ?
+ * @throws TopiaException if trying to replace a context
*/
public void setTopiaContext(TopiaContext context) throws TopiaException {
if (topiaContext == null) {
topiaContext = context;
} else {
- throw new TopiaException("Remplacement du contexte interdit");
+ // XXX AThimel 30/05/2012 Use deprecated TRE because this will be removed with http://nuiton.org/issues/2078
+ throw new TopiaRuntimeException("Remplacement du contexte interdit");
}
}
Added: trunk/topia-persistence/src/main/java/org/nuiton/topia/persistence/TopiaPersistenceException.java
===================================================================
--- trunk/topia-persistence/src/main/java/org/nuiton/topia/persistence/TopiaPersistenceException.java (rev 0)
+++ trunk/topia-persistence/src/main/java/org/nuiton/topia/persistence/TopiaPersistenceException.java 2012-05-30 16:38:41 UTC (rev 2567)
@@ -0,0 +1,49 @@
+/*
+ * #%L
+ * ToPIA :: Persistence
+ * $Id$
+ * $HeadURL$
+ * %%
+ * Copyright (C) 2004 - 2012 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.TopiaException;
+
+import javax.persistence.PersistenceException;
+import java.sql.SQLException;
+
+/**
+ * Exception when some operation failed within the persistence provider
+ *
+ * @author Arnaud Thimel <thimel(a)codelutin.com>
+ * @since 3.0
+ */
+public class TopiaPersistenceException extends TopiaException {
+
+ private static final long serialVersionUID = 7431698657423221049L;
+
+ public TopiaPersistenceException(String message, PersistenceException cause) {
+ super(message, cause);
+ }
+
+ public TopiaPersistenceException(String message, IllegalStateException cause) {
+ super(message, cause);
+ }
+
+}
Property changes on: trunk/topia-persistence/src/main/java/org/nuiton/topia/persistence/TopiaPersistenceException.java
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision HeadURL
Added: svn:eol-style
+ native
Modified: trunk/topia-persistence/src/main/java/org/nuiton/topia/persistence/util/DBMapping.java
===================================================================
--- trunk/topia-persistence/src/main/java/org/nuiton/topia/persistence/util/DBMapping.java 2012-05-30 10:35:42 UTC (rev 2566)
+++ trunk/topia-persistence/src/main/java/org/nuiton/topia/persistence/util/DBMapping.java 2012-05-30 16:38:41 UTC (rev 2567)
@@ -327,14 +327,14 @@
protected BigInteger getBigInteger(TopiaContext ctxt, String sql, BigInteger defaultSize) throws TopiaException {
BigInteger size = defaultSize;
if (ctxt != null) {
- try {
+// try {
Query query = ((TopiaContextImpl) ctxt).getEntityManager().createNativeQuery(sql);
size = (BigInteger) query.getResultList().get(0);
// } catch (SQLGrammarException e) {
- } catch (Exception e) {
- // could not obtain sequence
- throw new TopiaException(e);
- }
+// } catch (Exception e) {
+// // could not obtain sequence
+// throw new TopiaException(e);
+// }
}
return size;
}
Modified: trunk/topia-service-migration/src/main/java/org/nuiton/topia/migration/MigrationServiceException.java
===================================================================
--- trunk/topia-service-migration/src/main/java/org/nuiton/topia/migration/MigrationServiceException.java 2012-05-30 10:35:42 UTC (rev 2566)
+++ trunk/topia-service-migration/src/main/java/org/nuiton/topia/migration/MigrationServiceException.java 2012-05-30 16:38:41 UTC (rev 2567)
@@ -25,6 +25,8 @@
package org.nuiton.topia.migration;
+import org.nuiton.topia.TopiaException;
+
/**
* TopiaMigrationServiceException.java
*
@@ -33,44 +35,47 @@
* @author Eon Sébastien
* @author Trève Vincent
* @version $Revision$
- *
- * Last update : $Date$
+ * <p/>
+ * Last update : $Date$
*/
-public class MigrationServiceException extends Exception {
+public class MigrationServiceException extends TopiaException {
- /**
- * Version
- */
- private static final long serialVersionUID = -8900901171551405745L;
-
- /**
- * Constructeur par defaut
- */
- public MigrationServiceException() {
- }
-
- /**
- * Constructeur avec message
- * @param message Le message d'erreur
- */
- public MigrationServiceException(String message) {
- super(message);
- }
-
- /**
- * Constructeur avec message et exception
- * @param message Le message d'erreur
- * @param exception l'exception
- */
- public MigrationServiceException(String message, Throwable exception) {
- super(message, exception);
- }
+ /**
+ * Version
+ */
+ private static final long serialVersionUID = -8900901171551405745L;
- /**
- * Constructeur avec exception
- * @param exception l'exception
- */
- public MigrationServiceException(Throwable exception) {
- super(exception);
- }
+ /**
+ * Constructeur par defaut
+ */
+ public MigrationServiceException() {
+ }
+
+ /**
+ * Constructeur avec message
+ *
+ * @param message Le message d'erreur
+ */
+ public MigrationServiceException(String message) {
+ super(message);
+ }
+
+ /**
+ * Constructeur avec message et exception
+ *
+ * @param message Le message d'erreur
+ * @param exception l'exception
+ */
+ public MigrationServiceException(String message, Throwable exception) {
+ super(message, exception);
+ }
+
+ /**
+ * Constructeur avec exception
+ *
+ * @param exception l'exception
+ */
+ public MigrationServiceException(Throwable exception) {
+ super(exception);
+ }
}
Modified: trunk/topia-service-migration/src/main/java/org/nuiton/topia/migration/TopiaMigrationEngine.java
===================================================================
--- trunk/topia-service-migration/src/main/java/org/nuiton/topia/migration/TopiaMigrationEngine.java 2012-05-30 10:35:42 UTC (rev 2566)
+++ trunk/topia-service-migration/src/main/java/org/nuiton/topia/migration/TopiaMigrationEngine.java 2012-05-30 16:38:41 UTC (rev 2567)
@@ -244,17 +244,12 @@
}
if (migrateOnInit) {
- // do automatic migration
- try {
- if (log.isDebugEnabled()) {
- log.debug("Starts Migrate from preInit...");
- }
- doMigrateSchema();
-
- } catch (MigrationServiceException e) {
- throw new TopiaException("Can't migrate schema for reason " + e.getMessage(), e);
+ if (log.isDebugEnabled()) {
+ log.debug("Starts Migrate from preInit...");
}
+ doMigrateSchema();
+
} else {
if (log.isDebugEnabled()) {
log.debug("Service [" + this + "] skip migration on init as required");
@@ -276,7 +271,7 @@
if (log.isErrorEnabled()) {
log.error("Database migration failed !");
}
- throw new TopiaException("Database migration failed !");
+ throw new MigrationServiceException("Database migration failed !");
}
}
Modified: trunk/topia-service-migration/src/main/java/org/nuiton/topia/migration/mappings/TMSVersionDAO.java
===================================================================
--- trunk/topia-service-migration/src/main/java/org/nuiton/topia/migration/mappings/TMSVersionDAO.java 2012-05-30 10:35:42 UTC (rev 2566)
+++ trunk/topia-service-migration/src/main/java/org/nuiton/topia/migration/mappings/TMSVersionDAO.java 2012-05-30 16:38:41 UTC (rev 2567)
@@ -33,10 +33,12 @@
import org.nuiton.topia.TopiaException;
import org.nuiton.topia.framework.TopiaContextImplementor;
import org.nuiton.topia.framework.TopiaSQLWork;
+import org.nuiton.topia.persistence.TopiaPersistenceException;
import org.nuiton.util.Version;
import org.nuiton.util.VersionUtil;
import javax.persistence.EntityManager;
+import javax.persistence.PersistenceException;
import javax.persistence.TypedQuery;
import java.sql.Connection;
import java.sql.PreparedStatement;
@@ -97,8 +99,8 @@
// save entity
session.persist(result);
return result;
- } catch (HibernateException e) {
- throw new TopiaException("Could not create version " + version, e);
+ } catch (PersistenceException pe) {
+ throw new TopiaPersistenceException("Could not create version " + version, pe);
}
}
@@ -107,8 +109,8 @@
EntityManager session = ((TopiaContextImplementor) tx).getEntityManager();
session.merge(version);
tx.commitTransaction();
- } catch (HibernateException e) {
- throw new TopiaException("Could not update version " + version, e);
+ } catch (PersistenceException pe) {
+ throw new TopiaPersistenceException("Could not update version " + version, pe);
}
}
@@ -122,8 +124,8 @@
for (TMSVersion o : list) {
session.remove(o);
}
- } catch (HibernateException e) {
- throw new TopiaException("Could not delete all versions", e);
+ } catch (PersistenceException pe) {
+ throw new TopiaPersistenceException("Could not delete all versions", pe);
}
}
1
0
r2566 - trunk/topia-persistence/src/main/java/org/nuiton/topia/generator
by fdesbois@users.nuiton.org 30 May '12
by fdesbois@users.nuiton.org 30 May '12
30 May '12
Author: fdesbois
Date: 2012-05-30 12:35:42 +0200 (Wed, 30 May 2012)
New Revision: 2566
Url: http://nuiton.org/repositories/revision/topia/2566
Log:
ensure isolation in loops for getComposite and getAggregate
Modified:
trunk/topia-persistence/src/main/java/org/nuiton/topia/generator/EntityDAOTransformer.java
Modified: trunk/topia-persistence/src/main/java/org/nuiton/topia/generator/EntityDAOTransformer.java
===================================================================
--- trunk/topia-persistence/src/main/java/org/nuiton/topia/generator/EntityDAOTransformer.java 2012-05-30 08:54:49 UTC (rev 2565)
+++ trunk/topia-persistence/src/main/java/org/nuiton/topia/generator/EntityDAOTransformer.java 2012-05-30 10:35:42 UTC (rev 2566)
@@ -1232,18 +1232,22 @@
if (TopiaGeneratorUtil.isNMultiplicity(attr)) {
addImport(result, Collection.class);
body.append(""
-/*{ Collection<<%=type%>> ee = entity.<%=getterName%>();
- if (ee != null) {
- tmp.putAll(<%=type%>.class, ee);
- }
+/*{ {
+ Collection<<%=type%>> ee = entity.<%=getterName%>();
+ if (ee != null) {
+ tmp.putAll(<%=type%>.class, ee);
+ }
+ }
}*/
);
} else {
body.append(""
-/*{ <%=type%> ee = entity.<%=getterName%>();
- if (ee != null) {
- tmp.put(<%=type%>.class, ee);
- }
+/*{ {
+ <%=type%> ee = entity.<%=getterName%>();
+ if (ee != null) {
+ tmp.put(<%=type%>.class, ee);
+ }
+ }
}*/
);
}
@@ -1267,10 +1271,12 @@
assocAttrName));
if (!TopiaGeneratorUtil.isNMultiplicity(attr)) {
body.append(""
-/*{ <%=assocClassFQN%> ee = entity.<%=getterName%>();
- if (ee != null) {
- tmp.put(<%=assocClassFQN%>.class, ee);
- }
+/*{ {
+ <%=assocClassFQN%> ee = entity.<%=getterName%>();
+ if (ee != null) {
+ tmp.put(<%=assocClassFQN%>.class, ee);
+ }
+ }
}*/
);
} else {
@@ -1359,18 +1365,22 @@
type = TopiaGeneratorUtil.getSimpleName(type);
if (TopiaGeneratorUtil.isNMultiplicity(attr)) {
body.append(""
-/*{ <%=type%> ee = entity.<%=getterName%>();
- if (ee != null) {
- tmp.put(<%=type%>.class, ee);
- }
+/*{ {
+ <%=type%> ee = entity.<%=getterName%>();
+ if (ee != null) {
+ tmp.put(<%=type%>.class, ee);
+ }
+ }
}*/
);
} else {
body.append(""
-/*{ Collection<<%=type%>> ee = entity.<%=getterName%>();
- if (ee != null) {
- tmp.putAll(<%=type%>.class, ee);
- }
+/*{ {
+ Collection<<%=type%>> ee = entity.<%=getterName%>();
+ if (ee != null) {
+ tmp.putAll(<%=type%>.class, ee);
+ }
+ }
}*/
);
}
1
0
Author: athimel
Date: 2012-05-30 10:54:49 +0200 (Wed, 30 May 2012)
New Revision: 2565
Url: http://nuiton.org/repositories/revision/topia/2565
Log:
Remove dependency to topia-persistence-tests
Modified:
trunk/topia-service-migration/pom.xml
Modified: trunk/topia-service-migration/pom.xml
===================================================================
--- trunk/topia-service-migration/pom.xml 2012-05-30 08:52:02 UTC (rev 2564)
+++ trunk/topia-service-migration/pom.xml 2012-05-30 08:54:49 UTC (rev 2565)
@@ -51,14 +51,6 @@
</dependency>
<dependency>
- <groupId>${project.groupId}</groupId>
- <artifactId>topia-persistence</artifactId>
- <version>${project.version}</version>
- <scope>test</scope>
- <classifier>tests</classifier>
- </dependency>
-
- <dependency>
<groupId>org.nuiton</groupId>
<artifactId>nuiton-utils</artifactId>
</dependency>
1
0
r2564 - trunk/topia-persistence/src/main/java/org/nuiton/topia
by athimel@users.nuiton.org 30 May '12
by athimel@users.nuiton.org 30 May '12
30 May '12
Author: athimel
Date: 2012-05-30 10:52:02 +0200 (Wed, 30 May 2012)
New Revision: 2564
Url: http://nuiton.org/repositories/revision/topia/2564
Log:
Revert TopiaRuntimeException deletion, better deprecate it
Added:
trunk/topia-persistence/src/main/java/org/nuiton/topia/TopiaRuntimeException.java
Added: trunk/topia-persistence/src/main/java/org/nuiton/topia/TopiaRuntimeException.java
===================================================================
--- trunk/topia-persistence/src/main/java/org/nuiton/topia/TopiaRuntimeException.java (rev 0)
+++ trunk/topia-persistence/src/main/java/org/nuiton/topia/TopiaRuntimeException.java 2012-05-30 08:52:02 UTC (rev 2564)
@@ -0,0 +1,80 @@
+/*
+ * #%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;
+
+/**
+ * Runtime exception for ToPIA. <u>Was</u> useful as TopiaException <u>was</u>
+ * technical and checked.
+ *
+ * @author chatellier <chatellier(a)codelutin.com>
+ * @version $Id$
+ * @deprecated Not used anymore, please use TopiaException. Will be removed in
+ * a future version.
+ */
+@Deprecated
+public class TopiaRuntimeException extends TopiaException {
+
+ /**
+ * Version UID
+ */
+ private static final long serialVersionUID = 4706337137948838375L;
+
+ /**
+ * Default constructor.
+ */
+ public TopiaRuntimeException() {
+ }
+
+ /**
+ * Constructor with {@code message}.
+ *
+ * @param message exception message
+ */
+ public TopiaRuntimeException(String message) {
+ super(message);
+ }
+
+ /**
+ * Constructor for a wrapped TopiaRuntimeException over a {@code cause}
+ * with a {@code message}.
+ *
+ * @param message exception message
+ * @param cause exception cause
+ */
+ public TopiaRuntimeException(String message, Throwable cause) {
+ super(message, cause);
+ }
+
+ /**
+ * Constructor for a wrapped TopiaRuntimeException over a {@code cause}.
+ *
+ * @param cause exception cause
+ */
+ public TopiaRuntimeException(Throwable cause) {
+ super(cause);
+ }
+
+}
Property changes on: trunk/topia-persistence/src/main/java/org/nuiton/topia/TopiaRuntimeException.java
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision HeadURL
Added: svn:eol-style
+ native
1
0
Author: athimel
Date: 2012-05-30 10:06:53 +0200 (Wed, 30 May 2012)
New Revision: 2563
Url: http://nuiton.org/repositories/revision/topia/2563
Log:
Update mavenpom and dependencies versions
Modified:
branches/topia-2.6-maintenance/pom.xml
Modified: branches/topia-2.6-maintenance/pom.xml
===================================================================
--- branches/topia-2.6-maintenance/pom.xml 2012-05-30 07:50:27 UTC (rev 2562)
+++ branches/topia-2.6-maintenance/pom.xml 2012-05-30 08:06:53 UTC (rev 2563)
@@ -33,7 +33,7 @@
<parent>
<groupId>org.nuiton</groupId>
<artifactId>mavenpom4redmineAndCentral</artifactId>
- <version>3.2</version>
+ <version>3.3.2</version>
</parent>
<artifactId>topia</artifactId>
@@ -68,14 +68,13 @@
<!-- libs version -->
<eugeneVersion>2.4.2</eugeneVersion>
- <nuitonUtilsVersion>2.4.6</nuitonUtilsVersion>
- <processorPluginVersion>1.2.1</processorPluginVersion>
+ <nuitonUtilsVersion>2.4.8</nuitonUtilsVersion>
+ <processorPluginVersion>1.2.2</processorPluginVersion>
<nuitonI18nVersion>2.4.1</nuitonI18nVersion>
<xmlrpcVersion>3.1.2</xmlrpcVersion>
<hibernateVersion>3.6.10.Final</hibernateVersion>
- <!--<hibernateVersion>4.0.0.CR1</hibernateVersion>-->
<sl4jVersion>1.6.4</sl4jVersion>
- <h2Version>1.3.165</h2Version>
+ <h2Version>1.3.167</h2Version>
<!-- i18n configuration -->
<i18n.bundles>fr_FR,en_GB,es_ES</i18n.bundles>
1
0
Author: athimel
Date: 2012-05-30 09:50:27 +0200 (Wed, 30 May 2012)
New Revision: 2562
Url: http://nuiton.org/repositories/revision/topia/2562
Log:
fixes #2075 Rename method TopiaContext#find(String, Object...) to TopiaContext#findAll(String, Object...)
Modified:
branches/topia-2.6-maintenance/topia-persistence/src/main/java/org/nuiton/topia/TopiaContext.java
branches/topia-2.6-maintenance/topia-persistence/src/main/java/org/nuiton/topia/framework/TopiaContextImpl.java
branches/topia-2.6-maintenance/topia-persistence/src/main/java/org/nuiton/topia/framework/TopiaQuery.java
branches/topia-2.6-maintenance/topia-persistence/src/main/java/org/nuiton/topia/generator/DAOAbstractTransformer.java
branches/topia-2.6-maintenance/topia-persistence/src/main/java/org/nuiton/topia/generator/EntityDAOTransformer.java
branches/topia-2.6-maintenance/topia-persistence/src/main/java/org/nuiton/topia/persistence/TopiaDAOLegacy.java
branches/topia-2.6-maintenance/topia-service-security/src/main/java/org/nuiton/topia/security/TopiaSecurityServiceImpl.java
branches/topia-2.6-maintenance/topia-service-security/src/main/java/org/nuiton/topia/security/entities/authorization/TopiaAssociationAuthorizationImpl.java
branches/topia-2.6-maintenance/topia-service-security/src/main/java/org/nuiton/topia/security/jaas/TopiaLoginModule.java
Modified: branches/topia-2.6-maintenance/topia-persistence/src/main/java/org/nuiton/topia/TopiaContext.java
===================================================================
--- branches/topia-2.6-maintenance/topia-persistence/src/main/java/org/nuiton/topia/TopiaContext.java 2012-05-30 07:42:12 UTC (rev 2561)
+++ branches/topia-2.6-maintenance/topia-persistence/src/main/java/org/nuiton/topia/TopiaContext.java 2012-05-30 07:50:27 UTC (rev 2562)
@@ -203,7 +203,7 @@
* @return La liste des resultats
* @throws TopiaException si une erreur survient durant la requete
*/
- List find(String hql, Object... args) throws TopiaException;
+ List findAll(String hql, Object... args) throws TopiaException;
/**
* Permet de faire une requete HQL hibernate directement sur la base en
Modified: branches/topia-2.6-maintenance/topia-persistence/src/main/java/org/nuiton/topia/framework/TopiaContextImpl.java
===================================================================
--- branches/topia-2.6-maintenance/topia-persistence/src/main/java/org/nuiton/topia/framework/TopiaContextImpl.java 2012-05-30 07:42:12 UTC (rev 2561)
+++ branches/topia-2.6-maintenance/topia-persistence/src/main/java/org/nuiton/topia/framework/TopiaContextImpl.java 2012-05-30 07:50:27 UTC (rev 2562)
@@ -173,7 +173,7 @@
*
* 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 #find(String, Object...)} or {@link #find(String, int, int, Object...)})
+ * {@link #findAll(String, Object...)} or {@link #find(String, int, int, Object...)})
* it will use the flush mode {@link FlushMode#AUTO}).
*
* But sometimes, when doing a lot of queries (for some imports for example),
@@ -988,9 +988,9 @@
}
@Override
- public List<?> find(String hql, Object... args) throws TopiaException {
+ public List<?> findAll(String hql, Object... args) throws TopiaException {
checkClosed(_("topia.persistence.error.unsupported.operation.on.closed.context",
- "find"));
+ "findAll"));
try {
Query query = getHibernate().createQuery(hql);
@@ -1219,7 +1219,7 @@
log.debug("acquire entities " + query);
}
// acquire data to replicate
- List<?> entities = find(query);
+ List<?> entities = findAll(query);
replicate0(dstContextImpl, entities.toArray());
if (log.isDebugEnabled()) {
log.debug("replication of entities " + query +
Modified: branches/topia-2.6-maintenance/topia-persistence/src/main/java/org/nuiton/topia/framework/TopiaQuery.java
===================================================================
--- branches/topia-2.6-maintenance/topia-persistence/src/main/java/org/nuiton/topia/framework/TopiaQuery.java 2012-05-30 07:42:12 UTC (rev 2561)
+++ branches/topia-2.6-maintenance/topia-persistence/src/main/java/org/nuiton/topia/framework/TopiaQuery.java 2012-05-30 07:50:27 UTC (rev 2562)
@@ -48,7 +48,7 @@
import java.util.Map;
/**
- * Query HQL managment to simplify usage of {@link TopiaContext#find(String,
+ * Query HQL managment to simplify usage of {@link TopiaContext#findAll(String,
* Object...) }.
* <p/>
* TODO-FD20091224 JUnit Tests
@@ -74,7 +74,7 @@
* SQL :
* "SELECT * FROM PersonImpl WHERE firstName LIKE 'M%' AND year > 1980"
* <p/>
- * HQL using {@link TopiaContext#find(String, Object...) } :
+ * HQL using {@link TopiaContext#findAll(String, Object...) } :
* TopiaContext context = rootContext.beginTransaction();
* context.find("FROM " + Person.class.getName() + " WHERE firstName LIKE
* :firstName AND year > :year",
@@ -92,7 +92,7 @@
* Example 2 :
* -----------
* <p/>
- * HQL using {@link TopiaContext#find(String, Object...) } :
+ * HQL using {@link TopiaContext#findAll(String, Object...) } :
* TopiaContext context = rootContext.beginTransaction();
* <p/>
* String query = "FROM " + Person.class.getName();
@@ -114,7 +114,7 @@
* separator = " AND ";
* }
* <p/>
- * context.find(query, params.toArray());
+ * context.findAll(query, params.toArray());
* <p/>
* Here we have only two non obligatory params, but imagine if we must have
* almost 6 or 7 parameters like this !
@@ -168,7 +168,7 @@
* ----------------
* <p/>
* - execute : as the same result as
- * {@link TopiaContext#find(String, Object...) }
+ * {@link TopiaContext#findAll(String, Object...) }
* <p/>
* Depends on entity type ;
* ------------------------
@@ -1374,7 +1374,7 @@
* @param transaction the TopiaContext to use for execution
* @return a List of results
* @throws TopiaException for error on query execution
- * @see TopiaContext#find(String, Object...)
+ * @see TopiaContext#findAll(String, Object...)
*/
public List execute(TopiaContext transaction) throws TopiaException {
String query = fullQuery();
@@ -1386,7 +1386,7 @@
result = transaction.find(query, startIndex, endIndex,
getParams().toArray());
} else {
- result = transaction.find(query, getParams().toArray());
+ result = transaction.findAll(query, getParams().toArray());
}
return result;
}
Modified: branches/topia-2.6-maintenance/topia-persistence/src/main/java/org/nuiton/topia/generator/DAOAbstractTransformer.java
===================================================================
--- branches/topia-2.6-maintenance/topia-persistence/src/main/java/org/nuiton/topia/generator/DAOAbstractTransformer.java 2012-05-30 07:42:12 UTC (rev 2561)
+++ branches/topia-2.6-maintenance/topia-persistence/src/main/java/org/nuiton/topia/generator/DAOAbstractTransformer.java 2012-05-30 07:50:27 UTC (rev 2562)
@@ -357,7 +357,7 @@
"l'acces a l'entite pour le service Taas");
setOperationBody(op, ""
/*{ TopiaContextImplementor context = getContext();
- List<String> result = context.find(query, "id", topiaId);
+ List<String> result = context.findAll(query, "id", topiaId);
List<Permission> resultPermissions = new ArrayList<Permission>();
for (String topiaIdPermission : result) {
Modified: branches/topia-2.6-maintenance/topia-persistence/src/main/java/org/nuiton/topia/generator/EntityDAOTransformer.java
===================================================================
--- branches/topia-2.6-maintenance/topia-persistence/src/main/java/org/nuiton/topia/generator/EntityDAOTransformer.java 2012-05-30 07:42:12 UTC (rev 2561)
+++ branches/topia-2.6-maintenance/topia-persistence/src/main/java/org/nuiton/topia/generator/EntityDAOTransformer.java 2012-05-30 07:50:27 UTC (rev 2562)
@@ -524,7 +524,7 @@
// "l'acces a l'entite pour le service Taas");
setOperationBody(op, ""
/*{ TopiaContextImplementor context = getContext();
- List<String> result = context.find(query, "id", topiaId);
+ List<String> result = context.findAll(query, "id", topiaId);
List<Permission> resultPermissions = new ArrayList<Permission>();
for (String topiaIdPermission : result) {
Modified: branches/topia-2.6-maintenance/topia-persistence/src/main/java/org/nuiton/topia/persistence/TopiaDAOLegacy.java
===================================================================
--- branches/topia-2.6-maintenance/topia-persistence/src/main/java/org/nuiton/topia/persistence/TopiaDAOLegacy.java 2012-05-30 07:42:12 UTC (rev 2561)
+++ branches/topia-2.6-maintenance/topia-persistence/src/main/java/org/nuiton/topia/persistence/TopiaDAOLegacy.java 2012-05-30 07:50:27 UTC (rev 2562)
@@ -489,8 +489,8 @@
@Override
public List<String> findAllIds() throws TopiaException {
-// List<String> find = context.find("select src.topiaId from " + entityClass.getSimpleName() + "Impl src");
- List<String> find = context.find("select src.topiaId from " + getEntityClass() + " src");
+// List<String> findAll = context.findAll("select src.topiaId from " + entityClass.getSimpleName() + "Impl src");
+ List<String> find = context.findAll("select src.topiaId from " + getEntityClass() + " src");
return find;
}
Modified: branches/topia-2.6-maintenance/topia-service-security/src/main/java/org/nuiton/topia/security/TopiaSecurityServiceImpl.java
===================================================================
--- branches/topia-2.6-maintenance/topia-service-security/src/main/java/org/nuiton/topia/security/TopiaSecurityServiceImpl.java 2012-05-30 07:42:12 UTC (rev 2561)
+++ branches/topia-2.6-maintenance/topia-service-security/src/main/java/org/nuiton/topia/security/TopiaSecurityServiceImpl.java 2012-05-30 07:50:27 UTC (rev 2562)
@@ -402,7 +402,7 @@
//FIXME : Voir si on peut mettre en relation un objet vers plusieurs objets
protected List<String> getRealExpressions(String topiaId) {
try {
- List<String> allBy = getSecurityContext().find("select distinct link.by from " +
+ List<String> allBy = getSecurityContext().findAll("select distinct link.by from " +
TopiaExpressionLink.class.getName() + " link where link.replace=:replace",
"replace", topiaId);
getSecurityContext().commitTransaction();
Modified: branches/topia-2.6-maintenance/topia-service-security/src/main/java/org/nuiton/topia/security/entities/authorization/TopiaAssociationAuthorizationImpl.java
===================================================================
--- branches/topia-2.6-maintenance/topia-service-security/src/main/java/org/nuiton/topia/security/entities/authorization/TopiaAssociationAuthorizationImpl.java 2012-05-30 07:42:12 UTC (rev 2561)
+++ branches/topia-2.6-maintenance/topia-service-security/src/main/java/org/nuiton/topia/security/entities/authorization/TopiaAssociationAuthorizationImpl.java 2012-05-30 07:50:27 UTC (rev 2562)
@@ -66,7 +66,7 @@
String where = "test.topiaId=:test and association.topiaId=:association";
TopiaContext context = getTopiaContext();
try {
- List<?> find = context.find("select " + select + " from " + from + " where " + where,
+ List<?> find = context.findAll("select " + select + " from " + from + " where " + where,
"test", thisExpression,
"association", thatExpression);
return (Long)find.get(0) >= 1;
Modified: branches/topia-2.6-maintenance/topia-service-security/src/main/java/org/nuiton/topia/security/jaas/TopiaLoginModule.java
===================================================================
--- branches/topia-2.6-maintenance/topia-service-security/src/main/java/org/nuiton/topia/security/jaas/TopiaLoginModule.java 2012-05-30 07:42:12 UTC (rev 2561)
+++ branches/topia-2.6-maintenance/topia-service-security/src/main/java/org/nuiton/topia/security/jaas/TopiaLoginModule.java 2012-05-30 07:50:27 UTC (rev 2562)
@@ -148,7 +148,7 @@
// Force le rechargement des groupes d'où la non utilisation de
// la méthode : user.getTopiaGroup()
- Set<TopiaGroup> groups = new HashSet<TopiaGroup>(securityManager.getSecurityContext().find(
+ Set<TopiaGroup> groups = new HashSet<TopiaGroup>(securityManager.getSecurityContext().findAll(
"select topiaGroup from " + TopiaGroup.class.getName() +
" topiaGroup join topiaGroup.topiaUser as topiaUser where topiaUser = :user", "user", user));
1
0
r2561 - in branches/topia-2.6-maintenance: . topia-persistence topia-service-migration topia-service-replication topia-service-security
by athimel@users.nuiton.org 30 May '12
by athimel@users.nuiton.org 30 May '12
30 May '12
Author: athimel
Date: 2012-05-30 09:42:12 +0200 (Wed, 30 May 2012)
New Revision: 2561
Url: http://nuiton.org/repositories/revision/topia/2561
Log:
Fix POMs according to maintenance branch
Modified:
branches/topia-2.6-maintenance/pom.xml
branches/topia-2.6-maintenance/topia-persistence/pom.xml
branches/topia-2.6-maintenance/topia-service-migration/pom.xml
branches/topia-2.6-maintenance/topia-service-replication/pom.xml
branches/topia-2.6-maintenance/topia-service-security/pom.xml
Modified: branches/topia-2.6-maintenance/pom.xml
===================================================================
--- branches/topia-2.6-maintenance/pom.xml 2012-05-30 07:35:45 UTC (rev 2560)
+++ branches/topia-2.6-maintenance/pom.xml 2012-05-30 07:42:12 UTC (rev 2561)
@@ -37,7 +37,7 @@
</parent>
<artifactId>topia</artifactId>
- <version>2.6.10</version>
+ <version>2.6.11-SNAPSHOT</version>
<modules>
<module>topia-persistence</module>
@@ -443,9 +443,9 @@
<!-- Source control management. -->
<scm>
- <connection>scm:svn:http://svn.nuiton.org/svn/topia/tags/topia-2.6.10</connection>
- <developerConnection>scm:svn:http://svn.nuiton.org/svn/topia/tags/topia-2.6.10</developerConnection>
- <url>http://www.nuiton.org/repositories/browse/topia/tags/topia-2.6.10</url>
+ <connection>scm:svn:http://svn.nuiton.org/svn/topia/branches/topia-2.6-maintenance</connection>
+ <developerConnection>scm:svn:http://svn.nuiton.org/svn/topia/branches/topia-2.6-maintenance</developerConnection>
+ <url>http://www.nuiton.org/repositories/browse/topia/branches/topia-2.6-maintena…</url>
</scm>
<distributionManagement>
Modified: branches/topia-2.6-maintenance/topia-persistence/pom.xml
===================================================================
--- branches/topia-2.6-maintenance/topia-persistence/pom.xml 2012-05-30 07:35:45 UTC (rev 2560)
+++ branches/topia-2.6-maintenance/topia-persistence/pom.xml 2012-05-30 07:42:12 UTC (rev 2561)
@@ -35,7 +35,7 @@
<parent>
<groupId>org.nuiton</groupId>
<artifactId>topia</artifactId>
- <version>2.6.10</version>
+ <version>2.6.11-SNAPSHOT</version>
</parent>
<groupId>org.nuiton.topia</groupId>
Modified: branches/topia-2.6-maintenance/topia-service-migration/pom.xml
===================================================================
--- branches/topia-2.6-maintenance/topia-service-migration/pom.xml 2012-05-30 07:35:45 UTC (rev 2560)
+++ branches/topia-2.6-maintenance/topia-service-migration/pom.xml 2012-05-30 07:42:12 UTC (rev 2561)
@@ -35,7 +35,7 @@
<parent>
<groupId>org.nuiton</groupId>
<artifactId>topia</artifactId>
- <version>2.6.10</version>
+ <version>2.6.11-SNAPSHOT</version>
</parent>
<groupId>org.nuiton.topia</groupId>
Modified: branches/topia-2.6-maintenance/topia-service-replication/pom.xml
===================================================================
--- branches/topia-2.6-maintenance/topia-service-replication/pom.xml 2012-05-30 07:35:45 UTC (rev 2560)
+++ branches/topia-2.6-maintenance/topia-service-replication/pom.xml 2012-05-30 07:42:12 UTC (rev 2561)
@@ -35,7 +35,7 @@
<parent>
<groupId>org.nuiton</groupId>
<artifactId>topia</artifactId>
- <version>2.6.10</version>
+ <version>2.6.11-SNAPSHOT</version>
</parent>
<groupId>org.nuiton.topia</groupId>
Modified: branches/topia-2.6-maintenance/topia-service-security/pom.xml
===================================================================
--- branches/topia-2.6-maintenance/topia-service-security/pom.xml 2012-05-30 07:35:45 UTC (rev 2560)
+++ branches/topia-2.6-maintenance/topia-service-security/pom.xml 2012-05-30 07:42:12 UTC (rev 2561)
@@ -35,7 +35,7 @@
<parent>
<groupId>org.nuiton</groupId>
<artifactId>topia</artifactId>
- <version>2.6.10</version>
+ <version>2.6.11-SNAPSHOT</version>
</parent>
<groupId>org.nuiton.topia</groupId>
1
0