Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/mapping/horizontal/NonAuditListTableMapping.java')
-rw-r--r--plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/mapping/horizontal/NonAuditListTableMapping.java22
1 files changed, 20 insertions, 2 deletions
diff --git a/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/mapping/horizontal/NonAuditListTableMapping.java b/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/mapping/horizontal/NonAuditListTableMapping.java
index bc791c94ac..ea04a417cd 100644
--- a/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/mapping/horizontal/NonAuditListTableMapping.java
+++ b/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/mapping/horizontal/NonAuditListTableMapping.java
@@ -69,11 +69,13 @@ public class NonAuditListTableMapping extends AbstractListTableMapping implement
public NonAuditListTableMapping(IMappingStrategy mappingStrategy, EClass eClass, EStructuralFeature feature)
{
super(mappingStrategy, eClass, feature);
- initSQLStrings();
}
- private void initSQLStrings()
+ @Override
+ protected void initSQLStrings()
{
+ super.initSQLStrings();
+
IDBTable table = getTable();
// ----------- clear list -------------------------
@@ -205,6 +207,11 @@ public class NonAuditListTableMapping extends AbstractListTableMapping implement
public void processDelta(IDBStoreAccessor accessor, CDOID id, int branchId, int oldVersion, int newVersion, long created, CDOListFeatureDelta delta)
{
+ if (getTable() == null)
+ {
+ initTable(accessor);
+ }
+
List<CDOFeatureDelta> listChanges = delta.getListChanges();
int oldListSize = delta.getOriginSize();
@@ -228,6 +235,11 @@ public class NonAuditListTableMapping extends AbstractListTableMapping implement
*/
private void clearList(IDBStoreAccessor accessor, CDOID id)
{
+ if (getTable() == null)
+ {
+ return;
+ }
+
IIDHandler idHandler = getMappingStrategy().getStore().getIDHandler();
IDBPreparedStatement stmt = accessor.getDBConnection().prepareStatement(sqlClear, ReuseProbability.HIGH);
@@ -248,6 +260,12 @@ public class NonAuditListTableMapping extends AbstractListTableMapping implement
private int getCurrentIndexOffset(IDBStoreAccessor accessor, CDOID id)
{
+ if (getTable() == null)
+ {
+ // List is empty. Return the default offset of 0.
+ return 0;
+ }
+
IIDHandler idHandler = getMappingStrategy().getStore().getIDHandler();
IDBPreparedStatement stmt = accessor.getDBConnection().prepareStatement(sqlReadCurrentIndexOffset, ReuseProbability.HIGH);
ResultSet rset = null;

Back to the top