Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEike Stepper2010-12-14 06:41:48 +0000
committerEike Stepper2010-12-14 06:41:48 +0000
commitd4b66c5f48062c0a6052f6c4773b62fa15670f07 (patch)
treef99dfccf850e3040e1e2caa807358fcc5c70ef15 /plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/mapping/horizontal/AbstractHorizontalMappingStrategy.java
parentfc982253ff800cf6c3c0de6ae30d685ebc34c666 (diff)
downloadcdo-d4b66c5f48062c0a6052f6c4773b62fa15670f07.tar.gz
cdo-d4b66c5f48062c0a6052f6c4773b62fa15670f07.tar.xz
cdo-d4b66c5f48062c0a6052f6c4773b62fa15670f07.zip
[332125] Wrong new offline ids after repair db
https://bugs.eclipse.org/bugs/show_bug.cgi?id=332125
Diffstat (limited to 'plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/mapping/horizontal/AbstractHorizontalMappingStrategy.java')
-rw-r--r--plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/mapping/horizontal/AbstractHorizontalMappingStrategy.java18
1 files changed, 13 insertions, 5 deletions
diff --git a/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/mapping/horizontal/AbstractHorizontalMappingStrategy.java b/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/mapping/horizontal/AbstractHorizontalMappingStrategy.java
index a945f2dfcd..9d59b0868d 100644
--- a/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/mapping/horizontal/AbstractHorizontalMappingStrategy.java
+++ b/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/mapping/horizontal/AbstractHorizontalMappingStrategy.java
@@ -421,8 +421,12 @@ public abstract class AbstractHorizontalMappingStrategy extends AbstractMappingS
String dbName = getStore().getRepository().getName();
List<String> names = DBUtil.getAllTableNames(connection, dbName);
- String prefix = "SELECT MIN(" + CDODBSchema.ATTRIBUTES_ID + ") FROM " + dbName + ".";
- String suffix = " WHERE 0>" + CDODBSchema.ATTRIBUTES_BRANCH;
+ String prefix = "SELECT MIN(t." + CDODBSchema.ATTRIBUTES_ID + ") FROM " + dbName + "." + CDODBSchema.CDO_OBJECTS
+ + " AS o, " + dbName + ".";
+
+ String suffix = " AS t WHERE t." + CDODBSchema.ATTRIBUTES_BRANCH + "<0 AND t." + CDODBSchema.ATTRIBUTES_ID + "=o."
+ + CDODBSchema.ATTRIBUTES_ID + " AND t." + CDODBSchema.ATTRIBUTES_CREATED + "=o."
+ + CDODBSchema.ATTRIBUTES_CREATED;
for (String name : names)
{
@@ -436,10 +440,14 @@ public abstract class AbstractHorizontalMappingStrategy extends AbstractMappingS
if (resultSet.next())
{
- long id = resultSet.getLong(1);
- if (id < min)
+ Object result = resultSet.getObject(1);
+ if (result instanceof Long)
{
- min = id;
+ long id = ((Long)result).longValue();
+ if (id < min)
+ {
+ min = id;
+ }
}
}
}

Back to the top