diff options
author | Eike Stepper | 2016-10-18 15:30:55 +0000 |
---|---|---|
committer | Eike Stepper | 2016-10-18 15:30:55 +0000 |
commit | d271b313d58d5eef02ed687c151a42dfd0c0f0ed (patch) | |
tree | 57ca0c57f33f0780f6092613bab565d35f7986af /plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo | |
parent | 6809f0af826be94b174d4e1a45d75e686813d267 (diff) | |
download | cdo-d271b313d58d5eef02ed687c151a42dfd0c0f0ed.tar.gz cdo-d271b313d58d5eef02ed687c151a42dfd0c0f0ed.tar.xz cdo-d271b313d58d5eef02ed687c151a42dfd0c0f0ed.zip |
[Releng] Increase max line length to 160
Diffstat (limited to 'plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo')
53 files changed, 398 insertions, 619 deletions
diff --git a/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/db/CDODBUtil.java b/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/db/CDODBUtil.java index a457b2522c..d823ddec8a 100644 --- a/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/db/CDODBUtil.java +++ b/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/db/CDODBUtil.java @@ -84,8 +84,7 @@ public final class CDODBUtil /** * @since 2.0 */ - public static IDBStore createStore(IMappingStrategy mappingStrategy, IDBAdapter dbAdapter, - IDBConnectionProvider dbConnectionProvider) + public static IDBStore createStore(IMappingStrategy mappingStrategy, IDBAdapter dbAdapter, IDBConnectionProvider dbConnectionProvider) { return createStore(mappingStrategy, dbAdapter, dbConnectionProvider, null); } @@ -93,8 +92,8 @@ public final class CDODBUtil /** * @since 4.2 */ - public static IDBStore createStore(IMappingStrategy mappingStrategy, IDBAdapter dbAdapter, - IDBConnectionProvider dbConnectionProvider, Map<String, String> properties) + public static IDBStore createStore(IMappingStrategy mappingStrategy, IDBAdapter dbAdapter, IDBConnectionProvider dbConnectionProvider, + Map<String, String> properties) { DBStore store = new DBStore(); store.setMappingStrategy(mappingStrategy); @@ -123,8 +122,7 @@ public final class CDODBUtil /** * @since 4.1 */ - public static IMappingStrategy createHorizontalMappingStrategy(boolean auditing, boolean branching, - boolean withRanges) + public static IMappingStrategy createHorizontalMappingStrategy(boolean auditing, boolean branching, boolean withRanges) { if (branching) { diff --git a/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/db/IIDHandler.java b/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/db/IIDHandler.java index b5939663b6..d1fbf45e90 100644 --- a/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/db/IIDHandler.java +++ b/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/db/IIDHandler.java @@ -92,9 +92,7 @@ public interface IIDHandler extends Comparator<CDOID> public String unmapURI(IDBStoreAccessor accessor, CDOID id); - public void rawExport(Connection connection, CDODataOutput out, long fromCommitTime, long toCommitTime) - throws IOException; + public void rawExport(Connection connection, CDODataOutput out, long fromCommitTime, long toCommitTime) throws IOException; - public void rawImport(Connection connection, CDODataInput in, long fromCommitTime, long toCommitTime, OMMonitor fork) - throws IOException; + public void rawImport(Connection connection, CDODataInput in, long fromCommitTime, long toCommitTime, OMMonitor fork) throws IOException; } diff --git a/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/db/IMetaDataManager.java b/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/db/IMetaDataManager.java index 198bd1d318..3a1ba472c6 100644 --- a/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/db/IMetaDataManager.java +++ b/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/db/IMetaDataManager.java @@ -102,13 +102,12 @@ public interface IMetaDataManager /** * @since 3.0 */ - public void rawExport(Connection connection, CDODataOutput out, long fromCommitTime, long toCommitTime) - throws IOException; + public void rawExport(Connection connection, CDODataOutput out, long fromCommitTime, long toCommitTime) throws IOException; /** * @since 4.0 */ - public Collection<InternalCDOPackageUnit> rawImport(Connection connection, CDODataInput in, long fromCommitTime, - long toCommitTime, OMMonitor monitor) throws IOException; + public Collection<InternalCDOPackageUnit> rawImport(Connection connection, CDODataInput in, long fromCommitTime, long toCommitTime, OMMonitor monitor) + throws IOException; } diff --git a/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/db/mapping/AbstractTypeMapping.java b/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/db/mapping/AbstractTypeMapping.java index b90b1cab5d..b40de921bd 100644 --- a/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/db/mapping/AbstractTypeMapping.java +++ b/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/db/mapping/AbstractTypeMapping.java @@ -100,8 +100,7 @@ public abstract class AbstractTypeMapping implements ITypeMapping return dbType; } - public final void setValueFromRevision(PreparedStatement stmt, int index, InternalCDORevision revision) - throws SQLException + public final void setValueFromRevision(PreparedStatement stmt, int index, InternalCDORevision revision) throws SQLException { setValue(stmt, index, getRevisionValue(revision)); } diff --git a/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/db/mapping/AbstractTypeMappingFactory.java b/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/db/mapping/AbstractTypeMappingFactory.java index 571b8e94af..e4cb658b8a 100644 --- a/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/db/mapping/AbstractTypeMappingFactory.java +++ b/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/db/mapping/AbstractTypeMappingFactory.java @@ -23,8 +23,7 @@ import org.eclipse.net4j.util.factory.ProductCreationException; * @author Stefan Winkler * @since 4.0 */ -public abstract class AbstractTypeMappingFactory extends Factory - implements org.eclipse.emf.cdo.server.db.mapping.ITypeMapping.Factory +public abstract class AbstractTypeMappingFactory extends Factory implements org.eclipse.emf.cdo.server.db.mapping.ITypeMapping.Factory { private ITypeMapping.Descriptor descriptor; diff --git a/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/db/mapping/ColumnTypeModifier.java b/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/db/mapping/ColumnTypeModifier.java index d916a38c6c..0786cdd11d 100644 --- a/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/db/mapping/ColumnTypeModifier.java +++ b/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/db/mapping/ColumnTypeModifier.java @@ -41,8 +41,7 @@ public abstract class ColumnTypeModifier /** * Can modify the column type of a {@link ITypeMapping type mapping} that is created by the {@link ITypeMapping.Registry type mapping registry}. */ - public abstract DBType modify(ITypeMapping.Provider provider, IMappingStrategy mappingStrategy, - EStructuralFeature feature, DBType dbType); + public abstract DBType modify(ITypeMapping.Provider provider, IMappingStrategy mappingStrategy, EStructuralFeature feature, DBType dbType); /** * Creates {@link ColumnTypeModifier} instances. diff --git a/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/db/mapping/IClassMapping.java b/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/db/mapping/IClassMapping.java index 1f49ff8d5d..27b3f87c2c 100644 --- a/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/db/mapping/IClassMapping.java +++ b/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/db/mapping/IClassMapping.java @@ -108,8 +108,7 @@ public interface IClassMapping * the monitor to indicate progress. * @since 4.0 */ - public void writeRevision(IDBStoreAccessor accessor, InternalCDORevision revision, boolean mapType, boolean revise, - OMMonitor monitor); + public void writeRevision(IDBStoreAccessor accessor, InternalCDORevision revision, boolean mapType, boolean revise, OMMonitor monitor); /** * Detaches (deletes) a CDO object leaving a "ghost" revision behind. @@ -126,8 +125,7 @@ public interface IClassMapping * the monitor to indicate progress. * @since 3.0 */ - public void detachObject(IDBStoreAccessor accessor, CDOID id, int version, CDOBranch branch, long timeStamp, - OMMonitor monitor); + public void detachObject(IDBStoreAccessor accessor, CDOID id, int version, CDOBranch branch, long timeStamp, OMMonitor monitor); /** * Create a prepared statement which returns all IDs of instances of the corresponding class. @@ -160,8 +158,7 @@ public interface IClassMapping * if called on a mapping which does not map an <code>EClass instanceof CDOResourceNode</code>. * @since 3.0 */ - public PreparedStatement createResourceQueryStatement(IDBStoreAccessor accessor, CDOID folderId, String name, - boolean exactMatch, CDOBranchPoint branchPoint); + public PreparedStatement createResourceQueryStatement(IDBStoreAccessor accessor, CDOID folderId, String name, boolean exactMatch, CDOBranchPoint branchPoint); /** * Passes all revisions of the store to the {@link CDORevisionHandler handler} if <b>all</b> of the following @@ -176,8 +173,7 @@ public interface IClassMapping * CDORevisionHandler) * @since 4.0 */ - public void handleRevisions(IDBStoreAccessor accessor, CDOBranch branch, long timeStamp, boolean exactTime, - CDORevisionHandler handler); + public void handleRevisions(IDBStoreAccessor accessor, CDOBranch branch, long timeStamp, boolean exactTime, CDORevisionHandler handler); /** * Returns a set of CDOIDs that have at least one revision in any of the passed branches and time ranges. diff --git a/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/db/mapping/IClassMappingDeltaSupport.java b/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/db/mapping/IClassMappingDeltaSupport.java index 1c00dc1267..446a6b7adb 100644 --- a/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/db/mapping/IClassMappingDeltaSupport.java +++ b/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/db/mapping/IClassMappingDeltaSupport.java @@ -38,6 +38,5 @@ public interface IClassMappingDeltaSupport * @param monitor * the monitor to report progress. */ - public void writeRevisionDelta(IDBStoreAccessor accessor, InternalCDORevisionDelta delta, long created, - OMMonitor monitor); + public void writeRevisionDelta(IDBStoreAccessor accessor, InternalCDORevisionDelta delta, long created, OMMonitor monitor); } diff --git a/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/db/mapping/IClassMappingUnitSupport.java b/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/db/mapping/IClassMappingUnitSupport.java index 65e8e77d33..cf193dbfde 100644 --- a/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/db/mapping/IClassMappingUnitSupport.java +++ b/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/db/mapping/IClassMappingUnitSupport.java @@ -25,6 +25,5 @@ import java.sql.SQLException; */ public interface IClassMappingUnitSupport extends IClassMapping { - public void readUnitRevisions(IDBStoreAccessor accessor, CDOBranchPoint branchPoint, CDOID rootID, - CDORevisionHandler revisionHandler) throws SQLException; + public void readUnitRevisions(IDBStoreAccessor accessor, CDOBranchPoint branchPoint, CDOID rootID, CDORevisionHandler revisionHandler) throws SQLException; } diff --git a/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/db/mapping/IListMapping.java b/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/db/mapping/IListMapping.java index 2032e8306d..6bb9cfe957 100644 --- a/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/db/mapping/IListMapping.java +++ b/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/db/mapping/IListMapping.java @@ -108,6 +108,5 @@ public interface IListMapping * @see IStoreAccessor#queryXRefs(IStoreAccessor.QueryXRefsContext) * @since 4.0 */ - public boolean queryXRefs(IDBStoreAccessor accessor, String mainTableName, String mainTableWhere, - QueryXRefsContext context, String idString); + public boolean queryXRefs(IDBStoreAccessor accessor, String mainTableName, String mainTableWhere, QueryXRefsContext context, String idString); } diff --git a/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/db/mapping/IListMapping2.java b/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/db/mapping/IListMapping2.java index 331a210833..dda252a811 100644 --- a/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/db/mapping/IListMapping2.java +++ b/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/db/mapping/IListMapping2.java @@ -23,6 +23,5 @@ public interface IListMapping2 extends IListMapping { public void addSimpleChunkWhere(IDBStoreAccessor accessor, CDOID cdoid, StringBuilder builder, int index); - public void addRangedChunkWhere(IDBStoreAccessor accessor, CDOID cdoid, StringBuilder builder, int fromIndex, - int toIndex); + public void addRangedChunkWhere(IDBStoreAccessor accessor, CDOID cdoid, StringBuilder builder, int fromIndex, int toIndex); } diff --git a/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/db/mapping/IListMappingDeltaSupport.java b/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/db/mapping/IListMappingDeltaSupport.java index 50f20f4747..300cad62ea 100644 --- a/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/db/mapping/IListMappingDeltaSupport.java +++ b/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/db/mapping/IListMappingDeltaSupport.java @@ -42,6 +42,5 @@ public interface IListMappingDeltaSupport * the {@link CDOListFeatureDelta} which contains the list deltas. * @since 4.0 */ - public void processDelta(IDBStoreAccessor accessor, CDOID id, int branchId, int oldVersion, int newVersion, - long created, CDOListFeatureDelta delta); + public void processDelta(IDBStoreAccessor accessor, CDOID id, int branchId, int oldVersion, int newVersion, long created, CDOListFeatureDelta delta); } diff --git a/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/db/mapping/IListMappingUnitSupport.java b/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/db/mapping/IListMappingUnitSupport.java index 9730f3cf87..6c48339a01 100644 --- a/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/db/mapping/IListMappingUnitSupport.java +++ b/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/db/mapping/IListMappingUnitSupport.java @@ -27,9 +27,7 @@ import java.sql.SQLException; */ public interface IListMappingUnitSupport extends IListMapping { - public ResultSet queryUnitEntries(IDBStoreAccessor accessor, IIDHandler idHandler, long timeStamp, CDOID rootID) - throws SQLException; + public ResultSet queryUnitEntries(IDBStoreAccessor accessor, IIDHandler idHandler, long timeStamp, CDOID rootID) throws SQLException; - public void readUnitEntries(ResultSet resultSet, IIDHandler idHandler, CDOID id, MoveableList<Object> list) - throws SQLException; + public void readUnitEntries(ResultSet resultSet, IIDHandler idHandler, CDOID id, MoveableList<Object> list) throws SQLException; } diff --git a/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/db/mapping/IMappingStrategy.java b/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/db/mapping/IMappingStrategy.java index ff4c1ef316..2729797ea7 100644 --- a/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/db/mapping/IMappingStrategy.java +++ b/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/db/mapping/IMappingStrategy.java @@ -343,8 +343,7 @@ public interface IMappingStrategy * * @since 4.0 */ - public void handleRevisions(IDBStoreAccessor accessor, EClass eClass, CDOBranch branch, long timeStamp, - boolean exactTime, CDORevisionHandler handler); + public void handleRevisions(IDBStoreAccessor accessor, EClass eClass, CDOBranch branch, long timeStamp, boolean exactTime, CDORevisionHandler handler); /** * Returns a set of CDOIDs that have at least one revision in any of the passed branches and time ranges. @@ -358,14 +357,13 @@ public interface IMappingStrategy /** * @since 3.0 */ - public void rawExport(IDBStoreAccessor accessor, CDODataOutput out, int lastReplicatedBranchID, int lastBranchID, - long lastReplicatedCommitTime, long lastCommitTime) throws IOException; + public void rawExport(IDBStoreAccessor accessor, CDODataOutput out, int lastReplicatedBranchID, int lastBranchID, long lastReplicatedCommitTime, + long lastCommitTime) throws IOException; /** * @since 4.0 */ - public void rawImport(IDBStoreAccessor accessor, CDODataInput in, long fromCommitTime, long toCommitTime, - OMMonitor monitor) throws IOException; + public void rawImport(IDBStoreAccessor accessor, CDODataInput in, long fromCommitTime, long toCommitTime, OMMonitor monitor) throws IOException; /** * @since 4.0 diff --git a/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/CommitInfoTable.java b/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/CommitInfoTable.java index b42431b0a3..b219011f87 100644 --- a/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/CommitInfoTable.java +++ b/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/CommitInfoTable.java @@ -78,8 +78,8 @@ public class CommitInfoTable extends Lifecycle this.store = store; } - public void writeCommitInfo(IDBStoreAccessor accessor, CDOBranch branch, long timeStamp, long previousTimeStamp, - String userID, String comment, CDOBranchPoint mergeSource, OMMonitor monitor) + public void writeCommitInfo(IDBStoreAccessor accessor, CDOBranch branch, long timeStamp, long previousTimeStamp, String userID, String comment, + CDOBranchPoint mergeSource, OMMonitor monitor) { IDBPreparedStatement stmt = accessor.getDBConnection().prepareStatement(sqlInsert, ReuseProbability.HIGH); @@ -117,8 +117,7 @@ public class CommitInfoTable extends Lifecycle } } - public void loadCommitInfos(IDBStoreAccessor accessor, CDOBranch branch, long startTime, long endTime, - CDOCommitInfoHandler handler) + public void loadCommitInfos(IDBStoreAccessor accessor, CDOBranch branch, long startTime, long endTime, CDOCommitInfoHandler handler) { int count = CDOCommitInfoUtil.decodeCount(endTime); @@ -222,8 +221,7 @@ public class CommitInfoTable extends Lifecycle } } - CDOCommitInfo commitInfo = commitInfoManager.createCommitInfo(infoBranch, timeStamp, previousTimeStamp, userID, - comment, mergeSource, null); + CDOCommitInfo commitInfo = commitInfoManager.createCommitInfo(infoBranch, timeStamp, previousTimeStamp, userID, comment, mergeSource, null); handler.handleCommitInfo(commitInfo); } } @@ -238,8 +236,7 @@ public class CommitInfoTable extends Lifecycle } } - public void rawExport(Connection connection, CDODataOutput out, long fromCommitTime, long toCommitTime) - throws IOException + public void rawExport(Connection connection, CDODataOutput out, long fromCommitTime, long toCommitTime) throws IOException { out.writeBoolean(withMergeSource); @@ -247,14 +244,13 @@ public class CommitInfoTable extends Lifecycle DBUtil.serializeTable(out, connection, table, null, where); } - public void rawImport(Connection connection, CDODataInput in, long fromCommitTime, long toCommitTime, - OMMonitor monitor) throws IOException + public void rawImport(Connection connection, CDODataInput in, long fromCommitTime, long toCommitTime, OMMonitor monitor) throws IOException { boolean actualWithMergeSource = in.readBoolean(); if (actualWithMergeSource != withMergeSource) { - throw new IllegalStateException("Commit info data mismatch. Expected: " + (withMergeSource ? "with" : "without") - + " merge source. Actual: " + (actualWithMergeSource ? "with" : "without") + " merge source."); + throw new IllegalStateException("Commit info data mismatch. Expected: " + (withMergeSource ? "with" : "without") + " merge source. Actual: " + + (actualWithMergeSource ? "with" : "without") + " merge source."); } DBUtil.deserializeTable(in, connection, table, monitor.fork()); @@ -265,8 +261,7 @@ public class CommitInfoTable extends Lifecycle IDBField timeStampField = table.getField(TIMESTAMP); long lastCommitTime = DBUtil.selectMaximumLong(connection, timeStampField); - long lastNonLocalCommitTime = DBUtil.selectMaximumLong(connection, timeStampField, - CDOBranch.MAIN_BRANCH_ID + "<=" + BRANCH); + long lastNonLocalCommitTime = DBUtil.selectMaximumLong(connection, timeStampField, CDOBranch.MAIN_BRANCH_ID + "<=" + BRANCH); if (lastNonLocalCommitTime == CDOBranchPoint.UNSPECIFIED_DATE) { diff --git a/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/DBBrowserPage.java b/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/DBBrowserPage.java index 0824e7e0b1..995b328e25 100644 --- a/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/DBBrowserPage.java +++ b/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/DBBrowserPage.java @@ -89,10 +89,9 @@ public class DBBrowserPage extends AbstractPage boolean schema = browser.isParam("schema"); pout.print("<table border=\"0\">\r\n"); - pout.print("<tr><td><b>Empty tables:</b></td><td><b>" - + browser.href(used ? "Hidden" : "Shown", getName(), "used", String.valueOf(!used)) + "</b></td></tr>\r\n"); - pout.print("<tr><td><b>Row data:</b></td><td><b>" - + browser.href(schema ? "Hidden" : "Shown", getName(), "schema", String.valueOf(!schema)) + pout.print( + "<tr><td><b>Empty tables:</b></td><td><b>" + browser.href(used ? "Hidden" : "Shown", getName(), "used", String.valueOf(!used)) + "</b></td></tr>\r\n"); + pout.print("<tr><td><b>Row data:</b></td><td><b>" + browser.href(schema ? "Hidden" : "Shown", getName(), "schema", String.valueOf(!schema)) + "</b></td></tr>\r\n"); pout.print("</table><br>\r\n"); @@ -170,8 +169,7 @@ public class DBBrowserPage extends AbstractPage } } - protected void executeQuery(CDOServerBrowser browser, PrintStream pout, Connection connection, String table, - String sql) + protected void executeQuery(CDOServerBrowser browser, PrintStream pout, Connection connection, String table, String sql) { String order = browser.getParam("order"); String direction = browser.getParam("direction"); diff --git a/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/DBRevisionHandler.java b/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/DBRevisionHandler.java index cce592156c..841beedcd9 100644 --- a/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/DBRevisionHandler.java +++ b/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/DBRevisionHandler.java @@ -31,8 +31,8 @@ public class DBRevisionHandler implements CDORevisionHandler { if (revision.getVersion() < CDOBranchVersion.FIRST_VERSION - 1) { - revision = new DetachedCDORevision(revision.getEClass(), revision.getID(), revision.getBranch(), - -revision.getVersion(), revision.getTimeStamp(), revision.getRevised()); + revision = new DetachedCDORevision(revision.getEClass(), revision.getID(), revision.getBranch(), -revision.getVersion(), revision.getTimeStamp(), + revision.getRevised()); } return delegate.handleRevision(revision); diff --git a/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/DBStore.java b/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/DBStore.java index 15e383d1f3..83a5676ebf 100644 --- a/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/DBStore.java +++ b/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/DBStore.java @@ -390,10 +390,8 @@ public class DBStore extends Store implements IDBStore, IMappingConstants, CDOAl public void setPersistentProperties(Map<String, String> properties) { IDBConnection connection = database.getConnection(); - IDBPreparedStatement deleteStmt = connection.prepareStatement(CDODBSchema.SQL_DELETE_PROPERTIES, - ReuseProbability.MEDIUM); - IDBPreparedStatement insertStmt = connection.prepareStatement(CDODBSchema.SQL_INSERT_PROPERTIES, - ReuseProbability.MEDIUM); + IDBPreparedStatement deleteStmt = connection.prepareStatement(CDODBSchema.SQL_DELETE_PROPERTIES, ReuseProbability.MEDIUM); + IDBPreparedStatement insertStmt = connection.prepareStatement(CDODBSchema.SQL_INSERT_PROPERTIES, ReuseProbability.MEDIUM); String sql = null; try @@ -658,8 +656,7 @@ public class DBStore extends Store implements IDBStore, IMappingConstants, CDOAl } String schemaName = repository.getName(); - boolean fixNullableIndexColumns = schemaVersion != FIRST_START - && schemaVersion < FIRST_VERSION_WITH_NULLABLE_CHECKS; + boolean fixNullableIndexColumns = schemaVersion != FIRST_START && schemaVersion < FIRST_VERSION_WITH_NULLABLE_CHECKS; database = DBUtil.openDatabase(dbAdapter, dbConnectionProvider, schemaName, fixNullableIndexColumns); IDBSchemaTransaction schemaTransaction = database.openSchemaTransaction(); @@ -692,8 +689,7 @@ public class DBStore extends Store implements IDBStore, IMappingConstants, CDOAl } setRevisionTemporality(mappingStrategy.hasAuditSupport() ? RevisionTemporality.AUDITING : RevisionTemporality.NONE); - setRevisionParallelism( - mappingStrategy.hasBranchingSupport() ? RevisionParallelism.BRANCHING : RevisionParallelism.NONE); + setRevisionParallelism(mappingStrategy.hasBranchingSupport() ? RevisionParallelism.BRANCHING : RevisionParallelism.NONE); if (schemaVersion == FIRST_START) { @@ -878,8 +874,8 @@ public class DBStore extends Store implements IDBStore, IMappingConstants, CDOAl continue; } - lastNonLocalCommitTime = Math.max(lastNonLocalCommitTime, DBUtil.selectMaximumLong(connection, - branchField, CDOBranch.MAIN_BRANCH_ID + "<=" + IMappingConstants.ATTRIBUTES_BRANCH)); + lastNonLocalCommitTime = Math.max(lastNonLocalCommitTime, + DBUtil.selectMaximumLong(connection, branchField, CDOBranch.MAIN_BRANCH_ID + "<=" + IMappingConstants.ATTRIBUTES_BRANCH)); } lastCommitTime = Math.max(lastCommitTime, DBUtil.selectMaximumLong(connection, createdField)); @@ -942,8 +938,8 @@ public class DBStore extends Store implements IDBStore, IMappingConstants, CDOAl try { statement = connection.createStatement(); - resultSet = statement.executeQuery("SELECT " + CDODBSchema.PROPERTIES_VALUE + " FROM " + CDODBSchema.PROPERTIES - + " WHERE " + CDODBSchema.PROPERTIES_NAME + "='" + PROP_SCHEMA_VERSION + "'"); + resultSet = statement.executeQuery("SELECT " + CDODBSchema.PROPERTIES_VALUE + " FROM " + CDODBSchema.PROPERTIES + " WHERE " + CDODBSchema.PROPERTIES_NAME + + "='" + PROP_SCHEMA_VERSION + "'"); if (resultSet.next()) { @@ -1028,8 +1024,7 @@ public class DBStore extends Store implements IDBStore, IMappingConstants, CDOAl String from = " FROM " + name + " WHERE " + ATTRIBUTES_VERSION + "<" + CDOBranchVersion.FIRST_VERSION; - statement.executeUpdate("DELETE FROM " + CDODBSchema.CDO_OBJECTS + " WHERE " + ATTRIBUTES_ID - + " IN (SELECT " + ATTRIBUTES_ID + from + ")"); + statement.executeUpdate("DELETE FROM " + CDODBSchema.CDO_OBJECTS + " WHERE " + ATTRIBUTES_ID + " IN (SELECT " + ATTRIBUTES_ID + from + ")"); statement.executeUpdate("DELETE" + from); } @@ -1067,8 +1062,7 @@ public class DBStore extends Store implements IDBStore, IMappingConstants, CDOAl private static final SchemaMigrator NULLABLE_COLUMNS_MIGRATION = null; - private static final SchemaMigrator[] SCHEMA_MIGRATORS = { NO_MIGRATION_NEEDED, NON_AUDIT_MIGRATION, - LOB_SIZE_MIGRATION, NULLABLE_COLUMNS_MIGRATION }; + private static final SchemaMigrator[] SCHEMA_MIGRATORS = { NO_MIGRATION_NEEDED, NON_AUDIT_MIGRATION, LOB_SIZE_MIGRATION, NULLABLE_COLUMNS_MIGRATION }; static { diff --git a/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/DBStoreAccessor.java b/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/DBStoreAccessor.java index 2b3c84870e..c658103dbc 100644 --- a/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/DBStoreAccessor.java +++ b/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/DBStoreAccessor.java @@ -233,8 +233,7 @@ public class DBStoreAccessor extends StoreAccessor implements IDBStoreAccessor, return null; } - public InternalCDORevision readRevision(CDOID id, CDOBranchPoint branchPoint, int listChunk, - CDORevisionCacheAdder cache) + public InternalCDORevision readRevision(CDOID id, CDOBranchPoint branchPoint, int listChunk, CDORevisionCacheAdder cache) { if (TRACER.isEnabled()) { @@ -255,8 +254,7 @@ public class DBStoreAccessor extends StoreAccessor implements IDBStoreAccessor, int version = revision.getVersion(); if (version < CDOBranchVersion.UNSPECIFIED_VERSION) { - return new DetachedCDORevision(eClass, id, revision.getBranch(), -version, revision.getTimeStamp(), - revision.getRevised()); + return new DetachedCDORevision(eClass, id, revision.getBranch(), -version, revision.getTimeStamp(), revision.getRevised()); } return revision; @@ -267,8 +265,7 @@ public class DBStoreAccessor extends StoreAccessor implements IDBStoreAccessor, return null; } - public InternalCDORevision readRevisionByVersion(CDOID id, CDOBranchVersion branchVersion, int listChunk, - CDORevisionCacheAdder cache) + public InternalCDORevision readRevisionByVersion(CDOID id, CDOBranchVersion branchVersion, int listChunk, CDORevisionCacheAdder cache) { DBStore store = getStore(); EClass eClass = getObjectType(id); @@ -294,8 +291,7 @@ public class DBStoreAccessor extends StoreAccessor implements IDBStoreAccessor, if (success && revision.getVersion() < CDOBranchVersion.FIRST_VERSION - 1) { // it is detached revision - revision = new DetachedCDORevision(eClass, id, revision.getBranch(), -revision.getVersion(), - revision.getTimeStamp(), revision.getRevised()); + revision = new DetachedCDORevision(eClass, id, revision.getBranch(), -revision.getVersion(), revision.getTimeStamp(), revision.getRevised()); } } @@ -486,8 +482,7 @@ public class DBStoreAccessor extends StoreAccessor implements IDBStoreAccessor, IIDHandler idHandler = store.getIDHandler(); // Remember maxID because it may have to be adjusted if the repository is BACKUP or CLONE. See bug 325097. - boolean adjustMaxID = !context.getBranchPoint().getBranch().isLocal() - && store.getRepository().getIDGenerationLocation() == IDGenerationLocation.STORE; + boolean adjustMaxID = !context.getBranchPoint().getBranch().isLocal() && store.getRepository().getIDGenerationLocation() == IDGenerationLocation.STORE; // Remember CDOIDs of new objects. They are cleared after writeRevisions() for (InternalCDORevision revision : context.getNewObjects()) @@ -503,27 +498,24 @@ public class DBStoreAccessor extends StoreAccessor implements IDBStoreAccessor, @Deprecated @Override - protected void writeCommitInfo(CDOBranch branch, long timeStamp, long previousTimeStamp, String userID, - String comment, OMMonitor monitor) + protected void writeCommitInfo(CDOBranch branch, long timeStamp, long previousTimeStamp, String userID, String comment, OMMonitor monitor) { writeCommitInfo(branch, timeStamp, previousTimeStamp, userID, comment, null, monitor); } @Override - protected void writeCommitInfo(CDOBranch branch, long timeStamp, long previousTimeStamp, String userID, - String comment, CDOBranchPoint mergeSource, OMMonitor monitor) + protected void writeCommitInfo(CDOBranch branch, long timeStamp, long previousTimeStamp, String userID, String comment, CDOBranchPoint mergeSource, + OMMonitor monitor) { CommitInfoTable commitInfoTable = getStore().getCommitInfoTable(); if (commitInfoTable != null) { - commitInfoTable.writeCommitInfo(this, branch, timeStamp, previousTimeStamp, userID, comment, mergeSource, - monitor); + commitInfoTable.writeCommitInfo(this, branch, timeStamp, previousTimeStamp, userID, comment, mergeSource, monitor); } } @Override - protected void writeRevisionDeltas(InternalCDORevisionDelta[] revisionDeltas, CDOBranch branch, long created, - OMMonitor monitor) + protected void writeRevisionDeltas(InternalCDORevisionDelta[] revisionDeltas, CDOBranch branch, long created, OMMonitor monitor) { IMappingStrategy mappingStrategy = getStore().getMappingStrategy(); @@ -550,27 +542,23 @@ public class DBStoreAccessor extends StoreAccessor implements IDBStoreAccessor, { CDOID id = delta.getID(); EClass eClass = getObjectType(id); - IClassMappingDeltaSupport mapping = (IClassMappingDeltaSupport)getStore().getMappingStrategy() - .getClassMapping(eClass); + IClassMappingDeltaSupport mapping = (IClassMappingDeltaSupport)getStore().getMappingStrategy().getClassMapping(eClass); mapping.writeRevisionDelta(this, delta, created, monitor); } @Override - protected void writeNewObjectRevisions(InternalCommitContext context, InternalCDORevision[] newObjects, - CDOBranch branch, OMMonitor monitor) + protected void writeNewObjectRevisions(InternalCommitContext context, InternalCDORevision[] newObjects, CDOBranch branch, OMMonitor monitor) { writeRevisions(context, true, newObjects, branch, monitor); } @Override - protected void writeDirtyObjectRevisions(InternalCommitContext context, InternalCDORevision[] dirtyObjects, - CDOBranch branch, OMMonitor monitor) + protected void writeDirtyObjectRevisions(InternalCommitContext context, InternalCDORevision[] dirtyObjects, CDOBranch branch, OMMonitor monitor) { writeRevisions(context, false, dirtyObjects, branch, monitor); } - protected void writeRevisions(InternalCommitContext context, boolean attachNewObjects, - InternalCDORevision[] revisions, CDOBranch branch, OMMonitor monitor) + protected void writeRevisions(InternalCommitContext context, boolean attachNewObjects, InternalCDORevision[] revisions, CDOBranch branch, OMMonitor monitor) { try { @@ -635,10 +623,8 @@ public class DBStoreAccessor extends StoreAccessor implements IDBStoreAccessor, // but for now: - InternalCDORevision revision = revisionManager.getRevision(id, branch.getHead(), CDORevision.UNCHUNKED, - CDORevision.DEPTH_NONE, true); - int version = ObjectUtil.equals(branch, revision.getBranch()) ? revision.getVersion() + 1 - : CDOBranchVersion.FIRST_VERSION; + InternalCDORevision revision = revisionManager.getRevision(id, branch.getHead(), CDORevision.UNCHUNKED, CDORevision.DEPTH_NONE, true); + int version = ObjectUtil.equals(branch, revision.getBranch()) ? revision.getVersion() + 1 : CDOBranchVersion.FIRST_VERSION; if (TRACER.isEnabled()) { @@ -1093,15 +1079,13 @@ public class DBStoreAccessor extends StoreAccessor implements IDBStoreAccessor, return mappingStrategy.readChangeSet(this, monitor, segments); } - public void handleRevisions(EClass eClass, CDOBranch branch, long timeStamp, boolean exactTime, - CDORevisionHandler handler) + public void handleRevisions(EClass eClass, CDOBranch branch, long timeStamp, boolean exactTime, CDORevisionHandler handler) { IMappingStrategy mappingStrategy = getStore().getMappingStrategy(); mappingStrategy.handleRevisions(this, eClass, branch, timeStamp, exactTime, new DBRevisionHandler(handler)); } - public void rawExport(CDODataOutput out, int fromBranchID, int toBranchID, long fromCommitTime, long toCommitTime) - throws IOException + public void rawExport(CDODataOutput out, int fromBranchID, int toBranchID, long fromCommitTime, long toCommitTime) throws IOException { DBStore store = getStore(); InternalRepository repository = store.getRepository(); @@ -1140,8 +1124,7 @@ public class DBStoreAccessor extends StoreAccessor implements IDBStoreAccessor, mappingStrategy.rawExport(this, out, fromBranchID, toBranchID, fromCommitTime, toCommitTime); } - public void rawImport(CDODataInput in, int fromBranchID, int toBranchID, long fromCommitTime, long toCommitTime, - OMMonitor monitor) throws IOException + public void rawImport(CDODataInput in, int fromBranchID, int toBranchID, long fromCommitTime, long toCommitTime, OMMonitor monitor) throws IOException { DBStore store = getStore(); IIDHandler idHandler = store.getIDHandler(); @@ -1219,12 +1202,11 @@ public class DBStoreAccessor extends StoreAccessor implements IDBStoreAccessor, OM.LOG.error(ex); } - getStore().getMappingStrategy().removeMapping(getConnection(), - packageUnits.toArray(new InternalCDOPackageUnit[packageUnits.size()])); + getStore().getMappingStrategy().removeMapping(getConnection(), packageUnits.toArray(new InternalCDOPackageUnit[packageUnits.size()])); } - protected void rawImportPackageUnits(CDODataInput in, long fromCommitTime, long toCommitTime, - Collection<InternalCDOPackageUnit> packageUnits, OMMonitor monitor) throws IOException + protected void rawImportPackageUnits(CDODataInput in, long fromCommitTime, long toCommitTime, Collection<InternalCDOPackageUnit> packageUnits, + OMMonitor monitor) throws IOException { monitor.begin(2); @@ -1258,8 +1240,7 @@ public class DBStoreAccessor extends StoreAccessor implements IDBStoreAccessor, { connection2 = store.getConnection(); - mappingStrategy.createMapping(connection2, - packageUnits.toArray(new InternalCDOPackageUnit[packageUnits.size()]), monitor.fork()); + mappingStrategy.createMapping(connection2, packageUnits.toArray(new InternalCDOPackageUnit[packageUnits.size()]), monitor.fork()); } finally { @@ -1314,14 +1295,12 @@ public class DBStoreAccessor extends StoreAccessor implements IDBStoreAccessor, writeClob(id, size, reader); } - public void rawStore(CDOBranch branch, long timeStamp, long previousTimeStamp, String userID, String comment, - OMMonitor monitor) + public void rawStore(CDOBranch branch, long timeStamp, long previousTimeStamp, String userID, String comment, OMMonitor monitor) { writeCommitInfo(branch, timeStamp, previousTimeStamp, userID, comment, null, monitor); } - public void rawStore(CDOBranch branch, long timeStamp, long previousTimeStamp, String userID, String comment, - CDOBranchPoint mergeSource, OMMonitor monitor) + public void rawStore(CDOBranch branch, long timeStamp, long previousTimeStamp, String userID, String comment, CDOBranchPoint mergeSource, OMMonitor monitor) { writeCommitInfo(branch, timeStamp, previousTimeStamp, userID, comment, mergeSource, monitor); } @@ -1367,14 +1346,12 @@ public class DBStoreAccessor extends StoreAccessor implements IDBStoreAccessor, } } - public LockArea createLockArea(String userID, CDOBranchPoint branchPoint, boolean readOnly, - Map<CDOID, LockGrade> locks) + public LockArea createLockArea(String userID, CDOBranchPoint branchPoint, boolean readOnly, Map<CDOID, LockGrade> locks) { return createLockArea(null, userID, branchPoint, readOnly, locks); } - public LockArea createLockArea(String durableLockingID, String userID, CDOBranchPoint branchPoint, boolean readOnly, - Map<CDOID, LockGrade> locks) + public LockArea createLockArea(String durableLockingID, String userID, CDOBranchPoint branchPoint, boolean readOnly, Map<CDOID, LockGrade> locks) { DurableLockingManager manager = getStore().getDurableLockingManager(); return manager.createLockArea(this, durableLockingID, userID, branchPoint, readOnly, locks); @@ -1434,15 +1411,13 @@ public class DBStoreAccessor extends StoreAccessor implements IDBStoreAccessor, unitMappingTable.readUnitRevisions(this, view, rootID, revisionHandler, monitor); } - public Object initUnit(IView view, CDOID rootID, CDORevisionHandler revisionHandler, Set<CDOID> initializedIDs, - long timeStamp, OMMonitor monitor) + public Object initUnit(IView view, CDOID rootID, CDORevisionHandler revisionHandler, Set<CDOID> initializedIDs, long timeStamp, OMMonitor monitor) { UnitMappingTable unitMappingTable = getStore().getUnitMappingTable(); return unitMappingTable.initUnit(this, timeStamp, view, rootID, revisionHandler, initializedIDs, monitor); } - public void finishUnit(IView view, CDOID rootID, CDORevisionHandler revisionHandler, long timeStamp, - Object initResult, List<CDOID> ids) + public void finishUnit(IView view, CDOID rootID, CDORevisionHandler revisionHandler, long timeStamp, Object initResult, List<CDOID> ids) { UnitMappingTable unitMappingTable = getStore().getUnitMappingTable(); unitMappingTable.finishUnit((BatchedStatement)initResult, rootID, ids, timeStamp); diff --git a/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/DBStoreChunkReader.java b/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/DBStoreChunkReader.java index f3af2ad1db..3ffa059db1 100644 --- a/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/DBStoreChunkReader.java +++ b/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/DBStoreChunkReader.java @@ -74,8 +74,7 @@ public class DBStoreChunkReader extends StoreChunkReader implements IDBStoreChun if (referenceMapping instanceof IListMapping2) { - ((IListMapping2)referenceMapping).addRangedChunkWhere(getAccessor(), getRevision().getID(), builder, fromIndex, - toIndex); + ((IListMapping2)referenceMapping).addRangedChunkWhere(getAccessor(), getRevision().getID(), builder, fromIndex, toIndex); } else { diff --git a/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/DBStoreFactory.java b/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/DBStoreFactory.java index af871ec9f7..694fdca0a9 100644 --- a/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/DBStoreFactory.java +++ b/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/DBStoreFactory.java @@ -64,8 +64,7 @@ public class DBStoreFactory implements IStoreFactory return store; } - private IMappingStrategy getMappingStrategy(String repositoryName, Map<String, String> repositoryProperties, - Element storeConfig) + private IMappingStrategy getMappingStrategy(String repositoryName, Map<String, String> repositoryProperties, Element storeConfig) { NodeList mappingStrategyConfigs = storeConfig.getElementsByTagName("mappingStrategy"); //$NON-NLS-1$ if (mappingStrategyConfigs.getLength() != 1) diff --git a/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/DurableLockingManager.java b/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/DurableLockingManager.java index 444fd7f1aa..db3d62d958 100644 --- a/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/DurableLockingManager.java +++ b/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/DurableLockingManager.java @@ -111,8 +111,8 @@ public class DurableLockingManager extends Lifecycle this.store = store; } - public synchronized LockArea createLockArea(DBStoreAccessor accessor, String durableLockingID, String userID, - CDOBranchPoint branchPoint, boolean readOnly, Map<CDOID, LockGrade> locks) + public synchronized LockArea createLockArea(DBStoreAccessor accessor, String durableLockingID, String userID, CDOBranchPoint branchPoint, boolean readOnly, + Map<CDOID, LockGrade> locks) { if (durableLockingID == null) { @@ -300,14 +300,12 @@ public class DurableLockingManager extends Lifecycle commit(accessor); } - public void lock(DBStoreAccessor accessor, String durableLockingID, LockType type, - Collection<? extends Object> objectsToLock) + public void lock(DBStoreAccessor accessor, String durableLockingID, LockType type, Collection<? extends Object> objectsToLock) { changeLocks(accessor, durableLockingID, type, objectsToLock, true); } - public void unlock(DBStoreAccessor accessor, String durableLockingID, LockType type, - Collection<? extends Object> objectsToUnlock) + public void unlock(DBStoreAccessor accessor, String durableLockingID, LockType type, Collection<? extends Object> objectsToUnlock) { changeLocks(accessor, durableLockingID, type, objectsToUnlock, false); } @@ -366,16 +364,16 @@ public class DurableLockingManager extends Lifecycle }); } - sqlInsertLockArea = "INSERT INTO " + LOCK_AREAS + "(" + LOCK_AREAS_ID + "," + LOCK_AREAS_USER_ID + "," - + LOCK_AREAS_VIEW_BRANCH + "," + LOCK_AREAS_VIEW_TIME + "," + LOCK_AREAS_READ_ONLY + ") VALUES (?, ?, ?, ?, ?)"; - sqlSelectLockArea = "SELECT " + LOCK_AREAS_USER_ID + "," + LOCK_AREAS_VIEW_BRANCH + "," + LOCK_AREAS_VIEW_TIME + "," - + LOCK_AREAS_READ_ONLY + " FROM " + LOCK_AREAS + " WHERE " + LOCK_AREAS_ID + "=?"; - sqlSelectAllLockAreas = "SELECT " + LOCK_AREAS_ID + "," + LOCK_AREAS_USER_ID + "," + LOCK_AREAS_VIEW_BRANCH + "," - + LOCK_AREAS_VIEW_TIME + "," + LOCK_AREAS_READ_ONLY + " FROM " + LOCK_AREAS; + sqlInsertLockArea = "INSERT INTO " + LOCK_AREAS + "(" + LOCK_AREAS_ID + "," + LOCK_AREAS_USER_ID + "," + LOCK_AREAS_VIEW_BRANCH + "," + LOCK_AREAS_VIEW_TIME + + "," + LOCK_AREAS_READ_ONLY + ") VALUES (?, ?, ?, ?, ?)"; + sqlSelectLockArea = "SELECT " + LOCK_AREAS_USER_ID + "," + LOCK_AREAS_VIEW_BRANCH + "," + LOCK_AREAS_VIEW_TIME + "," + LOCK_AREAS_READ_ONLY + " FROM " + + LOCK_AREAS + " WHERE " + LOCK_AREAS_ID + "=?"; + sqlSelectAllLockAreas = "SELECT " + LOCK_AREAS_ID + "," + LOCK_AREAS_USER_ID + "," + LOCK_AREAS_VIEW_BRANCH + "," + LOCK_AREAS_VIEW_TIME + "," + + LOCK_AREAS_READ_ONLY + " FROM " + LOCK_AREAS; sqlSelectLockAreas = sqlSelectAllLockAreas + " WHERE " + LOCK_AREAS_USER_ID + " LIKE ?"; sqlDeleteLockArea = "DELETE FROM " + LOCK_AREAS + " WHERE " + LOCK_AREAS_ID + "=?"; - sqlDeleteLockAreas = "DELETE FROM " + LOCK_AREAS + " WHERE EXISTS (SELECT * FROM " + LOCKS + " WHERE " + LOCKS + "." - + LOCKS_AREA_ID + "=" + LOCK_AREAS + "." + LOCK_AREAS_ID + ")"; + sqlDeleteLockAreas = "DELETE FROM " + LOCK_AREAS + " WHERE EXISTS (SELECT * FROM " + LOCKS + " WHERE " + LOCKS + "." + LOCKS_AREA_ID + "=" + LOCK_AREAS + + "." + LOCK_AREAS_ID + ")"; // Locks locksTable = database.getSchema().getTable(LOCKS); @@ -395,14 +393,10 @@ public class DurableLockingManager extends Lifecycle }); } - sqlSelectLocks = "SELECT " + LOCKS_OBJECT_ID + "," + LOCKS_LOCK_GRADE + " FROM " + LOCKS + " WHERE " + LOCKS_AREA_ID - + "=?"; - sqlSelectLock = "SELECT " + LOCKS_LOCK_GRADE + " FROM " + LOCKS + " WHERE " + LOCKS_AREA_ID + "=? AND " - + LOCKS_OBJECT_ID + "=?"; - sqlInsertLock = "INSERT INTO " + LOCKS + "(" + LOCKS_AREA_ID + "," + LOCKS_OBJECT_ID + "," + LOCKS_LOCK_GRADE - + ") VALUES (?, ?, ?)"; - sqlUpdateLock = "UPDATE " + LOCKS + " SET " + LOCKS_LOCK_GRADE + "=? " + " WHERE " + LOCKS_AREA_ID + "=? AND " - + LOCKS_OBJECT_ID + "=?"; + sqlSelectLocks = "SELECT " + LOCKS_OBJECT_ID + "," + LOCKS_LOCK_GRADE + " FROM " + LOCKS + " WHERE " + LOCKS_AREA_ID + "=?"; + sqlSelectLock = "SELECT " + LOCKS_LOCK_GRADE + " FROM " + LOCKS + " WHERE " + LOCKS_AREA_ID + "=? AND " + LOCKS_OBJECT_ID + "=?"; + sqlInsertLock = "INSERT INTO " + LOCKS + "(" + LOCKS_AREA_ID + "," + LOCKS_OBJECT_ID + "," + LOCKS_LOCK_GRADE + ") VALUES (?, ?, ?)"; + sqlUpdateLock = "UPDATE " + LOCKS + " SET " + LOCKS_LOCK_GRADE + "=? " + " WHERE " + LOCKS_AREA_ID + "=? AND " + LOCKS_OBJECT_ID + "=?"; sqlDeleteLock = "DELETE FROM " + LOCKS + " WHERE " + LOCKS_AREA_ID + "=? AND " + LOCKS_OBJECT_ID + "=?"; sqlDeleteLocks = "DELETE FROM " + LOCKS + " WHERE " + LOCKS_AREA_ID + "=?"; } @@ -425,8 +419,7 @@ public class DurableLockingManager extends Lifecycle } } - private LockArea makeLockArea(DBStoreAccessor accessor, String durableLockingID, String userID, int branchID, - long timeStamp, boolean readOnly) + private LockArea makeLockArea(DBStoreAccessor accessor, String durableLockingID, String userID, int branchID, long timeStamp, boolean readOnly) { CDOBranchPoint branchPoint = branchManager.getBranch(branchID).getPoint(timeStamp); Map<CDOID, LockGrade> lockMap = getLockMap(accessor, durableLockingID); @@ -465,8 +458,7 @@ public class DurableLockingManager extends Lifecycle } } - private void changeLocks(DBStoreAccessor accessor, String durableLockingID, LockType type, - Collection<? extends Object> keys, boolean on) + private void changeLocks(DBStoreAccessor accessor, String durableLockingID, LockType type, Collection<? extends Object> keys, boolean on) { if (keys.isEmpty()) { @@ -475,11 +467,9 @@ public class DurableLockingManager extends Lifecycle String sql = on ? sqlInsertLock : sqlDeleteLock; - IDBPreparedStatement stmtSelect = accessor.getDBConnection().prepareStatement(sqlSelectLock, - ReuseProbability.MEDIUM); + IDBPreparedStatement stmtSelect = accessor.getDBConnection().prepareStatement(sqlSelectLock, ReuseProbability.MEDIUM); IDBPreparedStatement stmtInsertOrDelete = accessor.getDBConnection().prepareStatement(sql, ReuseProbability.MEDIUM); - IDBPreparedStatement stmtUpdate = accessor.getDBConnection().prepareStatement(sqlUpdateLock, - ReuseProbability.MEDIUM); + IDBPreparedStatement stmtUpdate = accessor.getDBConnection().prepareStatement(sqlUpdateLock, ReuseProbability.MEDIUM); ResultSet resultSet = null; try @@ -536,15 +526,13 @@ public class DurableLockingManager extends Lifecycle } } - public void rawExport(Connection connection, CDODataOutput out, long fromCommitTime, long toCommitTime) - throws IOException + public void rawExport(Connection connection, CDODataOutput out, long fromCommitTime, long toCommitTime) throws IOException { DBUtil.serializeTable(out, connection, lockAreasTable, null, null); DBUtil.serializeTable(out, connection, locksTable, null, null); } - public void rawImport(Connection connection, CDODataInput in, long fromCommitTime, long toCommitTime, - OMMonitor monitor) throws IOException + public void rawImport(Connection connection, CDODataInput in, long fromCommitTime, long toCommitTime, OMMonitor monitor) throws IOException { monitor.begin(4); diff --git a/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/ExternalReferenceManager.java b/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/ExternalReferenceManager.java index aaf8426dcb..67cc9e4c31 100644 --- a/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/ExternalReferenceManager.java +++ b/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/ExternalReferenceManager.java @@ -165,15 +165,13 @@ public class ExternalReferenceManager extends Lifecycle } } - public void rawExport(Connection connection, CDODataOutput out, long fromCommitTime, long toCommitTime) - throws IOException + public void rawExport(Connection connection, CDODataOutput out, long fromCommitTime, long toCommitTime) throws IOException { String where = " WHERE " + EXTERNAL_REFS_COMMITTIME + " BETWEEN " + fromCommitTime + " AND " + toCommitTime; DBUtil.serializeTable(out, connection, table, null, where); } - public void rawImport(Connection connection, CDODataInput in, long fromCommitTime, long toCommitTime, - OMMonitor monitor) throws IOException + public void rawImport(Connection connection, CDODataInput in, long fromCommitTime, long toCommitTime, OMMonitor monitor) throws IOException { DBUtil.deserializeTable(in, connection, table, monitor); } @@ -234,8 +232,7 @@ public class ExternalReferenceManager extends Lifecycle } } - sqlInsert = "INSERT INTO " + table + "(" + EXTERNAL_REFS_ID + "," + EXTERNAL_REFS_URI + "," - + EXTERNAL_REFS_COMMITTIME + ") VALUES (?, ?, ?)"; + sqlInsert = "INSERT INTO " + table + "(" + EXTERNAL_REFS_ID + "," + EXTERNAL_REFS_URI + "," + EXTERNAL_REFS_COMMITTIME + ") VALUES (?, ?, ?)"; sqlSelectByURI = "SELECT " + EXTERNAL_REFS_ID + " FROM " + table + " WHERE " + EXTERNAL_REFS_URI + "=?"; sqlSelectByLongID = "SELECT " + EXTERNAL_REFS_URI + " FROM " + table + " WHERE " + EXTERNAL_REFS_ID + "=?"; } diff --git a/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/IObjectTypeMapper.java b/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/IObjectTypeMapper.java index 2b842a360f..3bcb003232 100644 --- a/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/IObjectTypeMapper.java +++ b/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/IObjectTypeMapper.java @@ -46,8 +46,7 @@ public interface IObjectTypeMapper */ public CDOID getMaxID(Connection connection, IIDHandler idHandler); - public void rawExport(Connection connection, CDODataOutput out, long fromCommitTime, long toCommitTime) - throws IOException; + public void rawExport(Connection connection, CDODataOutput out, long fromCommitTime, long toCommitTime) throws IOException; public void rawImport(Connection connection, CDODataInput in, OMMonitor monitor) throws IOException; } diff --git a/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/LongIDHandler.java b/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/LongIDHandler.java index 4d6fa9dc3b..5876d868e8 100644 --- a/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/LongIDHandler.java +++ b/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/LongIDHandler.java @@ -183,8 +183,12 @@ public class LongIDHandler extends Lifecycle implements IIDHandler if (commitTime == CDOBranchPoint.INVALID_DATE) { CommitContext commitContext = StoreThreadLocal.getCommitContext(); - commitTime = commitContext != null ? commitContext.getBranchPoint().getTimeStamp() - : CDOBranchPoint.UNSPECIFIED_DATE; // Happens on rawStore for workspace checkouts + commitTime = commitContext != null ? commitContext.getBranchPoint().getTimeStamp() : CDOBranchPoint.UNSPECIFIED_DATE; // Happens + // on + // rawStore + // for + // workspace + // checkouts } value = externalReferenceManager.mapExternalReference((CDOIDExternal)id, commitTime); @@ -244,14 +248,12 @@ public class LongIDHandler extends Lifecycle implements IIDHandler return externalReferenceManager.unmapURI(accessor, value(id)); } - public void rawExport(Connection connection, CDODataOutput out, long fromCommitTime, long toCommitTime) - throws IOException + public void rawExport(Connection connection, CDODataOutput out, long fromCommitTime, long toCommitTime) throws IOException { externalReferenceManager.rawExport(connection, out, fromCommitTime, toCommitTime); } - public void rawImport(Connection connection, CDODataInput in, long fromCommitTime, long toCommitTime, - OMMonitor monitor) throws IOException + public void rawImport(Connection connection, CDODataInput in, long fromCommitTime, long toCommitTime, OMMonitor monitor) throws IOException { externalReferenceManager.rawImport(connection, in, fromCommitTime, toCommitTime, monitor); } diff --git a/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/MetaDataManager.java b/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/MetaDataManager.java index 88f950bae8..325506119c 100644 --- a/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/MetaDataManager.java +++ b/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/MetaDataManager.java @@ -130,8 +130,7 @@ public class MetaDataManager extends Lifecycle implements IMetaDataManager public Collection<InternalCDOPackageUnit> readPackageUnits(Connection connection) { - return readPackageUnits(connection, CDOBranchPoint.UNSPECIFIED_DATE, CDOBranchPoint.UNSPECIFIED_DATE, - new Monitor()); + return readPackageUnits(connection, CDOBranchPoint.UNSPECIFIED_DATE, CDOBranchPoint.UNSPECIFIED_DATE, new Monitor()); } public final void writePackageUnits(Connection connection, InternalCDOPackageUnit[] packageUnits, OMMonitor monitor) @@ -147,8 +146,7 @@ public class MetaDataManager extends Lifecycle implements IMetaDataManager } } - public void rawExport(Connection connection, CDODataOutput out, long fromCommitTime, long toCommitTime) - throws IOException + public void rawExport(Connection connection, CDODataOutput out, long fromCommitTime, long toCommitTime) throws IOException { // Export package units String where = " WHERE p_u." + CDODBSchema.PACKAGE_UNITS_ID + "<>'" + CDOModelConstants.CORE_PACKAGE_URI + // @@ -158,13 +156,12 @@ public class MetaDataManager extends Lifecycle implements IMetaDataManager DBUtil.serializeTable(out, connection, CDODBSchema.PACKAGE_UNITS, "p_u", where); // Export package infos - String join = ", " + CDODBSchema.PACKAGE_UNITS + " p_u" + where + " AND p_i." + CDODBSchema.PACKAGE_INFOS_UNIT - + "=p_u." + CDODBSchema.PACKAGE_UNITS_ID; + String join = ", " + CDODBSchema.PACKAGE_UNITS + " p_u" + where + " AND p_i." + CDODBSchema.PACKAGE_INFOS_UNIT + "=p_u." + CDODBSchema.PACKAGE_UNITS_ID; DBUtil.serializeTable(out, connection, CDODBSchema.PACKAGE_INFOS, "p_i", join); } - public Collection<InternalCDOPackageUnit> rawImport(Connection connection, CDODataInput in, long fromCommitTime, - long toCommitTime, OMMonitor monitor) throws IOException + public Collection<InternalCDOPackageUnit> rawImport(Connection connection, CDODataInput in, long fromCommitTime, long toCommitTime, OMMonitor monitor) + throws IOException { monitor.begin(3); @@ -239,8 +236,8 @@ public class MetaDataManager extends Lifecycle implements IMetaDataManager try { String sql = "INSERT INTO " + CDODBSchema.PACKAGE_UNITS + " (" + CDODBSchema.PACKAGE_UNITS_ID + ", " //$NON-NLS-1$ //$NON-NLS-2$ - + CDODBSchema.PACKAGE_UNITS_ORIGINAL_TYPE + ", " + CDODBSchema.PACKAGE_UNITS_TIME_STAMP + ", " - + CDODBSchema.PACKAGE_UNITS_PACKAGE_DATA + ") VALUES (?, ?, ?, ?)"; + + CDODBSchema.PACKAGE_UNITS_ORIGINAL_TYPE + ", " + CDODBSchema.PACKAGE_UNITS_TIME_STAMP + ", " + CDODBSchema.PACKAGE_UNITS_PACKAGE_DATA + + ") VALUES (?, ?, ?, ?)"; DBUtil.trace(sql); IDBPreparedStatement stmt = connection.prepareStatement(sql, ReuseProbability.MEDIUM); @@ -351,8 +348,7 @@ public class MetaDataManager extends Lifecycle implements IMetaDataManager } } - private Collection<InternalCDOPackageUnit> readPackageUnits(Connection connection, long fromCommitTime, - long toCommitTime, OMMonitor monitor) + private Collection<InternalCDOPackageUnit> readPackageUnits(Connection connection, long fromCommitTime, long toCommitTime, OMMonitor monitor) { final Map<String, InternalCDOPackageUnit> packageUnits = new HashMap<String, InternalCDOPackageUnit>(); IDBRowHandler unitRowHandler = new IDBRowHandler() @@ -374,14 +370,13 @@ public class MetaDataManager extends Lifecycle implements IMetaDataManager String where = null; if (fromCommitTime != CDOBranchPoint.UNSPECIFIED_DATE) { - where = CDODBSchema.PACKAGE_UNITS_ID + "<>'" + CDOModelConstants.CORE_PACKAGE_URI + "' AND " - + CDODBSchema.PACKAGE_UNITS_ID + "<>'" + CDOModelConstants.RESOURCE_PACKAGE_URI + "' AND " - + CDODBSchema.PACKAGE_UNITS_ID + "<>'" + CDOModelConstants.TYPES_PACKAGE_URI + "' AND " + where = CDODBSchema.PACKAGE_UNITS_ID + "<>'" + CDOModelConstants.CORE_PACKAGE_URI + "' AND " + CDODBSchema.PACKAGE_UNITS_ID + "<>'" + + CDOModelConstants.RESOURCE_PACKAGE_URI + "' AND " + CDODBSchema.PACKAGE_UNITS_ID + "<>'" + CDOModelConstants.TYPES_PACKAGE_URI + "' AND " + CDODBSchema.PACKAGE_UNITS_TIME_STAMP + " BETWEEN " + fromCommitTime + " AND " + toCommitTime; } - DBUtil.select(connection, unitRowHandler, where, CDODBSchema.PACKAGE_UNITS_ID, - CDODBSchema.PACKAGE_UNITS_ORIGINAL_TYPE, CDODBSchema.PACKAGE_UNITS_TIME_STAMP); + DBUtil.select(connection, unitRowHandler, where, CDODBSchema.PACKAGE_UNITS_ID, CDODBSchema.PACKAGE_UNITS_ORIGINAL_TYPE, + CDODBSchema.PACKAGE_UNITS_TIME_STAMP); final Map<String, List<InternalCDOPackageInfo>> packageInfos = new HashMap<String, List<InternalCDOPackageInfo>>(); IDBRowHandler infoRowHandler = new IDBRowHandler() @@ -410,8 +405,7 @@ public class MetaDataManager extends Lifecycle implements IMetaDataManager try { - DBUtil.select(connection, infoRowHandler, CDODBSchema.PACKAGE_INFOS_UNIT, CDODBSchema.PACKAGE_INFOS_URI, - CDODBSchema.PACKAGE_INFOS_PARENT); + DBUtil.select(connection, infoRowHandler, CDODBSchema.PACKAGE_INFOS_UNIT, CDODBSchema.PACKAGE_INFOS_URI, CDODBSchema.PACKAGE_INFOS_PARENT); } finally { diff --git a/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/SQLQueryHandler.java b/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/SQLQueryHandler.java index 59b49a2ca5..8b368a16ea 100644 --- a/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/SQLQueryHandler.java +++ b/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/SQLQueryHandler.java @@ -103,8 +103,8 @@ public class SQLQueryHandler implements IQueryHandler boolean mapQuery = false; IIDHandler idHandler = accessor.getStore().getIDHandler(); - IDBPreparedStatement stmt = accessor.getDBConnection().prepareStatement(query, ResultSet.TYPE_SCROLL_INSENSITIVE, - ResultSet.CONCUR_READ_ONLY, ReuseProbability.MEDIUM); + IDBPreparedStatement stmt = accessor.getDBConnection().prepareStatement(query, ResultSet.TYPE_SCROLL_INSENSITIVE, ResultSet.CONCUR_READ_ONLY, + ReuseProbability.MEDIUM); ResultSet resultSet = null; try @@ -122,8 +122,7 @@ public class SQLQueryHandler implements IQueryHandler } catch (ClassCastException ex) { - throw new IllegalArgumentException("Parameter " + FIRST_RESULT + " must be an integer but it is a " + o - + " class " + o.getClass().getName(), ex); + throw new IllegalArgumentException("Parameter " + FIRST_RESULT + " must be an integer but it is a " + o + " class " + o.getClass().getName(), ex); } } } @@ -138,8 +137,8 @@ public class SQLQueryHandler implements IQueryHandler } catch (ClassCastException ex) { - throw new IllegalArgumentException("Parameter " + QUERY_STATEMENT + " must be an boolean but it is a " + o - + " class " + o.getClass().getName(), ex); + throw new IllegalArgumentException("Parameter " + QUERY_STATEMENT + " must be an boolean but it is a " + o + " class " + o.getClass().getName(), + ex); } } } @@ -154,8 +153,8 @@ public class SQLQueryHandler implements IQueryHandler } catch (ClassCastException ex) { - throw new IllegalArgumentException("Parameter " + CDO_OBJECT_QUERY + " must be a boolean but it is a " + o - + " class " + o.getClass().getName(), ex); + throw new IllegalArgumentException("Parameter " + CDO_OBJECT_QUERY + " must be a boolean but it is a " + o + " class " + o.getClass().getName(), + ex); } } } @@ -170,9 +169,7 @@ public class SQLQueryHandler implements IQueryHandler } catch (ClassCastException ex) { - throw new IllegalArgumentException( - "Parameter " + MAP_QUERY + " must be a boolean but it is a " + o + " class " + o.getClass().getName(), - ex); + throw new IllegalArgumentException("Parameter " + MAP_QUERY + " must be a boolean but it is a " + o + " class " + o.getClass().getName(), ex); } } } diff --git a/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/StringIDHandler.java b/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/StringIDHandler.java index ec9a5e79e2..e08e2e6a96 100644 --- a/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/StringIDHandler.java +++ b/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/StringIDHandler.java @@ -198,14 +198,12 @@ public class StringIDHandler extends Lifecycle implements IIDHandler return value(id); } - public void rawExport(Connection connection, CDODataOutput out, long fromCommitTime, long toCommitTime) - throws IOException + public void rawExport(Connection connection, CDODataOutput out, long fromCommitTime, long toCommitTime) throws IOException { // Do nothing } - public void rawImport(Connection connection, CDODataInput in, long fromCommitTime, long toCommitTime, - OMMonitor monitor) throws IOException + public void rawImport(Connection connection, CDODataInput in, long fromCommitTime, long toCommitTime, OMMonitor monitor) throws IOException { // Do nothing } diff --git a/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/UUIDHandler.java b/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/UUIDHandler.java index 041636e66d..62090bd387 100644 --- a/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/UUIDHandler.java +++ b/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/UUIDHandler.java @@ -187,14 +187,12 @@ public class UUIDHandler extends Lifecycle implements IIDHandler return CDOIDUtil.getString(id); } - public void rawExport(Connection connection, CDODataOutput out, long fromCommitTime, long toCommitTime) - throws IOException + public void rawExport(Connection connection, CDODataOutput out, long fromCommitTime, long toCommitTime) throws IOException { // Do nothing } - public void rawImport(Connection connection, CDODataInput in, long fromCommitTime, long toCommitTime, - OMMonitor monitor) throws IOException + public void rawImport(Connection connection, CDODataInput in, long fromCommitTime, long toCommitTime, OMMonitor monitor) throws IOException { // Do nothing } diff --git a/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/mapping/AbstractMappingStrategy.java b/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/mapping/AbstractMappingStrategy.java index 5762203925..fa26cae563 100644 --- a/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/mapping/AbstractMappingStrategy.java +++ b/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/mapping/AbstractMappingStrategy.java @@ -208,8 +208,7 @@ public abstract class AbstractMappingStrategy extends Lifecycle implements IMapp // -- object id related methods ---------------------------------------- - public void handleRevisions(IDBStoreAccessor accessor, EClass eClass, CDOBranch branch, long timeStamp, - boolean exactTime, CDORevisionHandler handler) + public void handleRevisions(IDBStoreAccessor accessor, EClass eClass, CDOBranch branch, long timeStamp, boolean exactTime, CDORevisionHandler handler) { if (eClass == null) { @@ -437,8 +436,7 @@ public abstract class AbstractMappingStrategy extends Lifecycle implements IMapp return CDO_SET_PREFIX + name; } - return getName(CDO_SET_PREFIX + feature.getName(), TYPE_PREFIX_FEATURE + getUniqueID(feature), - getMaxFieldNameLength()); + return getName(CDO_SET_PREFIX + feature.getName(), TYPE_PREFIX_FEATURE + getUniqueID(feature), getMaxFieldNameLength()); } private String getName(String name, String suffix, int maxLength) diff --git a/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/mapping/CoreTypeMappings.java b/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/mapping/CoreTypeMappings.java index c88acdcd63..0f841b3201 100644 --- a/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/mapping/CoreTypeMappings.java +++ b/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/mapping/CoreTypeMappings.java @@ -62,8 +62,7 @@ public class CoreTypeMappings */ public static class TMEnum extends AbstractTypeMapping { - public static final Factory FACTORY = new Factory( - TypeMappingUtil.createDescriptor(ID_PREFIX + ".Enum", EcorePackage.eINSTANCE.getEEnum(), DBType.INTEGER)); + public static final Factory FACTORY = new Factory(TypeMappingUtil.createDescriptor(ID_PREFIX + ".Enum", EcorePackage.eINSTANCE.getEEnum(), DBType.INTEGER)); @Override public Object getResultSetValue(ResultSet resultSet) throws SQLException @@ -117,11 +116,11 @@ public class CoreTypeMappings */ public static class TMString extends AbstractTypeMapping { - public static final Factory FACTORY_VARCHAR = new Factory(TypeMappingUtil - .createDescriptor(ID_PREFIX + ".StringVarchar", EcorePackage.eINSTANCE.getEString(), DBType.VARCHAR)); + public static final Factory FACTORY_VARCHAR = new Factory( + TypeMappingUtil.createDescriptor(ID_PREFIX + ".StringVarchar", EcorePackage.eINSTANCE.getEString(), DBType.VARCHAR)); - public static final Factory FACTORY_LONG_VARCHAR = new Factory(TypeMappingUtil - .createDescriptor(ID_PREFIX + ".StringLongVarchar", EcorePackage.eINSTANCE.getEString(), DBType.LONGVARCHAR)); + public static final Factory FACTORY_LONG_VARCHAR = new Factory( + TypeMappingUtil.createDescriptor(ID_PREFIX + ".StringLongVarchar", EcorePackage.eINSTANCE.getEString(), DBType.LONGVARCHAR)); public static final Factory FACTORY_CLOB = new Factory( TypeMappingUtil.createDescriptor(ID_PREFIX + ".StringClob", EcorePackage.eINSTANCE.getEString(), DBType.CLOB)); @@ -158,8 +157,8 @@ public class CoreTypeMappings public static final Factory FACTORY_VARCHAR = new Factory( TypeMappingUtil.createDescriptor(ID_PREFIX + ".BlobStream", EtypesPackage.eINSTANCE.getBlob(), DBType.VARCHAR)); - public static final Factory FACTORY_LONG_VARCHAR = new Factory(TypeMappingUtil - .createDescriptor(ID_PREFIX + ".BlobStreamLongVarchar", EtypesPackage.eINSTANCE.getBlob(), DBType.LONGVARCHAR)); + public static final Factory FACTORY_LONG_VARCHAR = new Factory( + TypeMappingUtil.createDescriptor(ID_PREFIX + ".BlobStreamLongVarchar", EtypesPackage.eINSTANCE.getBlob(), DBType.LONGVARCHAR)); @Override protected void doSetValue(PreparedStatement stmt, int index, Object value) throws SQLException @@ -210,8 +209,8 @@ public class CoreTypeMappings public static final Factory FACTORY_VARCHAR = new Factory( TypeMappingUtil.createDescriptor(ID_PREFIX + ".ClobStream", EtypesPackage.eINSTANCE.getClob(), DBType.VARCHAR)); - public static final Factory FACTORY_LONG_VARCHAR = new Factory(TypeMappingUtil - .createDescriptor(ID_PREFIX + ".ClobStreamLongVarchar", EtypesPackage.eINSTANCE.getClob(), DBType.LONGVARCHAR)); + public static final Factory FACTORY_LONG_VARCHAR = new Factory( + TypeMappingUtil.createDescriptor(ID_PREFIX + ".ClobStreamLongVarchar", EtypesPackage.eINSTANCE.getClob(), DBType.LONGVARCHAR)); @Override protected void doSetValue(PreparedStatement stmt, int index, Object value) throws SQLException @@ -262,8 +261,8 @@ public class CoreTypeMappings public static final Factory FACTORY = new Factory( TypeMappingUtil.createDescriptor(ID_PREFIX + ".Short", EcorePackage.eINSTANCE.getEShort(), DBType.SMALLINT)); - public static final Factory FACTORY_OBJECT = new Factory(TypeMappingUtil - .createDescriptor(ID_PREFIX + ".ShortObject", EcorePackage.eINSTANCE.getEShortObject(), DBType.SMALLINT)); + public static final Factory FACTORY_OBJECT = new Factory( + TypeMappingUtil.createDescriptor(ID_PREFIX + ".ShortObject", EcorePackage.eINSTANCE.getEShortObject(), DBType.SMALLINT)); @Override public Object getResultSetValue(ResultSet resultSet) throws SQLException @@ -344,11 +343,10 @@ public class CoreTypeMappings */ public static class TMLong extends AbstractTypeMapping { - public static final Factory FACTORY = new Factory( - TypeMappingUtil.createDescriptor(ID_PREFIX + ".Long", EcorePackage.eINSTANCE.getELong(), DBType.BIGINT)); + public static final Factory FACTORY = new Factory(TypeMappingUtil.createDescriptor(ID_PREFIX + ".Long", EcorePackage.eINSTANCE.getELong(), DBType.BIGINT)); - public static final Factory FACTORY_OBJECT = new Factory(TypeMappingUtil.createDescriptor(ID_PREFIX + ".LongObject", - EcorePackage.eINSTANCE.getELongObject(), DBType.BIGINT)); + public static final Factory FACTORY_OBJECT = new Factory( + TypeMappingUtil.createDescriptor(ID_PREFIX + ".LongObject", EcorePackage.eINSTANCE.getELongObject(), DBType.BIGINT)); @Override public Object getResultSetValue(ResultSet resultSet) throws SQLException @@ -382,8 +380,8 @@ public class CoreTypeMappings public static final Factory FACTORY = new Factory( TypeMappingUtil.createDescriptor(ID_PREFIX + ".Integer", EcorePackage.eINSTANCE.getEInt(), DBType.INTEGER)); - public static final Factory FACTORY_OBJECT = new Factory(TypeMappingUtil - .createDescriptor(ID_PREFIX + ".IntegerObject", EcorePackage.eINSTANCE.getEIntegerObject(), DBType.INTEGER)); + public static final Factory FACTORY_OBJECT = new Factory( + TypeMappingUtil.createDescriptor(ID_PREFIX + ".IntegerObject", EcorePackage.eINSTANCE.getEIntegerObject(), DBType.INTEGER)); @Override public Object getResultSetValue(ResultSet resultSet) throws SQLException @@ -414,11 +412,10 @@ public class CoreTypeMappings */ public static class TMFloat extends AbstractTypeMapping { - public static final Factory FACTORY = new Factory( - TypeMappingUtil.createDescriptor(ID_PREFIX + ".Float", EcorePackage.eINSTANCE.getEFloat(), DBType.FLOAT)); + public static final Factory FACTORY = new Factory(TypeMappingUtil.createDescriptor(ID_PREFIX + ".Float", EcorePackage.eINSTANCE.getEFloat(), DBType.FLOAT)); - public static final Factory FACTORY_OBJECT = new Factory(TypeMappingUtil - .createDescriptor(ID_PREFIX + ".FloatObject", EcorePackage.eINSTANCE.getEFloatObject(), DBType.FLOAT)); + public static final Factory FACTORY_OBJECT = new Factory( + TypeMappingUtil.createDescriptor(ID_PREFIX + ".FloatObject", EcorePackage.eINSTANCE.getEFloatObject(), DBType.FLOAT)); @Override public Object getResultSetValue(ResultSet resultSet) throws SQLException @@ -452,8 +449,8 @@ public class CoreTypeMappings public static final Factory FACTORY = new Factory( TypeMappingUtil.createDescriptor(ID_PREFIX + ".Double", EcorePackage.eINSTANCE.getEDouble(), DBType.DOUBLE)); - public static final Factory FACTORY_OBJECT = new Factory(TypeMappingUtil - .createDescriptor(ID_PREFIX + ".DoubleObject", EcorePackage.eINSTANCE.getEDoubleObject(), DBType.DOUBLE)); + public static final Factory FACTORY_OBJECT = new Factory( + TypeMappingUtil.createDescriptor(ID_PREFIX + ".DoubleObject", EcorePackage.eINSTANCE.getEDoubleObject(), DBType.DOUBLE)); @Override public Object getResultSetValue(ResultSet resultSet) throws SQLException @@ -484,8 +481,8 @@ public class CoreTypeMappings */ public static class TMDate2Timestamp extends AbstractTypeMapping { - public static final Factory FACTORY = new Factory(TypeMappingUtil.createDescriptor(ID_PREFIX + ".Timestamp", - EcorePackage.eINSTANCE.getEDate(), DBType.TIMESTAMP)); + public static final Factory FACTORY = new Factory( + TypeMappingUtil.createDescriptor(ID_PREFIX + ".Timestamp", EcorePackage.eINSTANCE.getEDate(), DBType.TIMESTAMP)); @Override public Object getResultSetValue(ResultSet resultSet) throws SQLException @@ -522,8 +519,7 @@ public class CoreTypeMappings */ public static class TMDate2Date extends AbstractTypeMapping { - public static final Factory FACTORY = new Factory( - TypeMappingUtil.createDescriptor(ID_PREFIX + ".Date", EcorePackage.eINSTANCE.getEDate(), DBType.DATE)); + public static final Factory FACTORY = new Factory(TypeMappingUtil.createDescriptor(ID_PREFIX + ".Date", EcorePackage.eINSTANCE.getEDate(), DBType.DATE)); @Override public Object getResultSetValue(ResultSet resultSet) throws SQLException @@ -554,8 +550,7 @@ public class CoreTypeMappings */ public static class TMDate2Time extends AbstractTypeMapping { - public static final Factory FACTORY = new Factory( - TypeMappingUtil.createDescriptor(ID_PREFIX + ".Time", EcorePackage.eINSTANCE.getEDate(), DBType.TIME)); + public static final Factory FACTORY = new Factory(TypeMappingUtil.createDescriptor(ID_PREFIX + ".Time", EcorePackage.eINSTANCE.getEDate(), DBType.TIME)); @Override public Object getResultSetValue(ResultSet resultSet) throws SQLException @@ -589,8 +584,8 @@ public class CoreTypeMappings public static final Factory FACTORY = new Factory( TypeMappingUtil.createDescriptor(ID_PREFIX + ".Character", EcorePackage.eINSTANCE.getEChar(), DBType.CHAR)); - public static final Factory FACTORY_OBJECT = new Factory(TypeMappingUtil - .createDescriptor(ID_PREFIX + ".CharacterObject", EcorePackage.eINSTANCE.getECharacterObject(), DBType.CHAR)); + public static final Factory FACTORY_OBJECT = new Factory( + TypeMappingUtil.createDescriptor(ID_PREFIX + ".CharacterObject", EcorePackage.eINSTANCE.getECharacterObject(), DBType.CHAR)); @Override public Object getResultSetValue(ResultSet resultSet) throws SQLException @@ -639,11 +634,11 @@ public class CoreTypeMappings */ public static class TMCharacter2Integer extends AbstractTypeMapping { - public static final Factory FACTORY = new Factory(TypeMappingUtil.createDescriptor(ID_PREFIX + ".Character2Integer", - EcorePackage.eINSTANCE.getEChar(), DBType.INTEGER)); + public static final Factory FACTORY = new Factory( + TypeMappingUtil.createDescriptor(ID_PREFIX + ".Character2Integer", EcorePackage.eINSTANCE.getEChar(), DBType.INTEGER)); - public static final Factory FACTORY_OBJECT = new Factory(TypeMappingUtil.createDescriptor( - ID_PREFIX + ".CharacterObject2Integer", EcorePackage.eINSTANCE.getECharacterObject(), DBType.INTEGER)); + public static final Factory FACTORY_OBJECT = new Factory( + TypeMappingUtil.createDescriptor(ID_PREFIX + ".CharacterObject2Integer", EcorePackage.eINSTANCE.getECharacterObject(), DBType.INTEGER)); @Override public Object getResultSetValue(ResultSet resultSet) throws SQLException @@ -689,8 +684,8 @@ public class CoreTypeMappings public static final Factory FACTORY = new Factory( TypeMappingUtil.createDescriptor(ID_PREFIX + ".Byte", EcorePackage.eINSTANCE.getEByte(), DBType.SMALLINT)); - public static final Factory FACTORY_OBJECT = new Factory(TypeMappingUtil.createDescriptor(ID_PREFIX + ".ByteObject", - EcorePackage.eINSTANCE.getEByteObject(), DBType.SMALLINT)); + public static final Factory FACTORY_OBJECT = new Factory( + TypeMappingUtil.createDescriptor(ID_PREFIX + ".ByteObject", EcorePackage.eINSTANCE.getEByteObject(), DBType.SMALLINT)); @Override public Object getResultSetValue(ResultSet resultSet) throws SQLException @@ -721,8 +716,8 @@ public class CoreTypeMappings */ public static class TMBytes extends AbstractTypeMapping { - public static final Factory FACTORY = new Factory(TypeMappingUtil.createDescriptor(ID_PREFIX + ".ByteArray", - EcorePackage.eINSTANCE.getEByteArray(), DBType.BLOB)); + public static final Factory FACTORY = new Factory( + TypeMappingUtil.createDescriptor(ID_PREFIX + ".ByteArray", EcorePackage.eINSTANCE.getEByteArray(), DBType.BLOB)); @Override public Object getResultSetValue(ResultSet resultSet) throws SQLException @@ -753,8 +748,8 @@ public class CoreTypeMappings */ public static class TMBytesVarbinary extends AbstractTypeMapping { - public static final Factory FACTORY = new Factory(TypeMappingUtil - .createDescriptor(ID_PREFIX + ".ByteArrayVarbinary", EcorePackage.eINSTANCE.getEByteArray(), DBType.VARBINARY)); + public static final Factory FACTORY = new Factory( + TypeMappingUtil.createDescriptor(ID_PREFIX + ".ByteArrayVarbinary", EcorePackage.eINSTANCE.getEByteArray(), DBType.VARBINARY)); @Override public Object getResultSetValue(ResultSet resultSet) throws SQLException @@ -788,14 +783,14 @@ public class CoreTypeMappings public static final Factory FACTORY = new Factory( TypeMappingUtil.createDescriptor(ID_PREFIX + ".Boolean", EcorePackage.eINSTANCE.getEBoolean(), DBType.BOOLEAN)); - public static final Factory FACTORY_OBJECT = new Factory(TypeMappingUtil - .createDescriptor(ID_PREFIX + ".BooleanObject", EcorePackage.eINSTANCE.getEBooleanObject(), DBType.BOOLEAN)); + public static final Factory FACTORY_OBJECT = new Factory( + TypeMappingUtil.createDescriptor(ID_PREFIX + ".BooleanObject", EcorePackage.eINSTANCE.getEBooleanObject(), DBType.BOOLEAN)); - public static final Factory FACTORY_SMALLINT = new Factory(TypeMappingUtil - .createDescriptor(ID_PREFIX + ".Boolean_SMALLINT", EcorePackage.eINSTANCE.getEBoolean(), DBType.SMALLINT)); + public static final Factory FACTORY_SMALLINT = new Factory( + TypeMappingUtil.createDescriptor(ID_PREFIX + ".Boolean_SMALLINT", EcorePackage.eINSTANCE.getEBoolean(), DBType.SMALLINT)); - public static final Factory FACTORY_OBJECT_SMALLINT = new Factory(TypeMappingUtil.createDescriptor( - ID_PREFIX + ".BooleanObject_SMALLINT", EcorePackage.eINSTANCE.getEBooleanObject(), DBType.SMALLINT)); + public static final Factory FACTORY_OBJECT_SMALLINT = new Factory( + TypeMappingUtil.createDescriptor(ID_PREFIX + ".BooleanObject_SMALLINT", EcorePackage.eINSTANCE.getEBooleanObject(), DBType.SMALLINT)); @Override public Object getResultSetValue(ResultSet resultSet) throws SQLException @@ -826,11 +821,11 @@ public class CoreTypeMappings */ public static class TMBigInteger extends AbstractTypeMapping { - public static final Factory FACTORY = new Factory(TypeMappingUtil.createDescriptor(ID_PREFIX + ".BigInteger", - EcorePackage.eINSTANCE.getEBigInteger(), DBType.VARCHAR)); + public static final Factory FACTORY = new Factory( + TypeMappingUtil.createDescriptor(ID_PREFIX + ".BigInteger", EcorePackage.eINSTANCE.getEBigInteger(), DBType.VARCHAR)); - public static final Factory FACTORY_LONG_VARCHAR = new Factory(TypeMappingUtil.createDescriptor( - ID_PREFIX + ".BigIntegerLongVarChar", EcorePackage.eINSTANCE.getEBigInteger(), DBType.LONGVARCHAR)); + public static final Factory FACTORY_LONG_VARCHAR = new Factory( + TypeMappingUtil.createDescriptor(ID_PREFIX + ".BigIntegerLongVarChar", EcorePackage.eINSTANCE.getEBigInteger(), DBType.LONGVARCHAR)); @Override protected Object getResultSetValue(ResultSet resultSet) throws SQLException @@ -874,11 +869,11 @@ public class CoreTypeMappings */ public static class TMBigDecimal extends AbstractTypeMapping { - public static final Factory FACTORY = new Factory(TypeMappingUtil.createDescriptor(ID_PREFIX + ".BigDecimal", - EcorePackage.eINSTANCE.getEBigDecimal(), DBType.VARCHAR)); + public static final Factory FACTORY = new Factory( + TypeMappingUtil.createDescriptor(ID_PREFIX + ".BigDecimal", EcorePackage.eINSTANCE.getEBigDecimal(), DBType.VARCHAR)); - public static final Factory FACTORY_LONG_VARCHAR = new Factory(TypeMappingUtil.createDescriptor( - ID_PREFIX + ".BigDecimalLongVarchar", EcorePackage.eINSTANCE.getEBigDecimal(), DBType.LONGVARCHAR)); + public static final Factory FACTORY_LONG_VARCHAR = new Factory( + TypeMappingUtil.createDescriptor(ID_PREFIX + ".BigDecimalLongVarchar", EcorePackage.eINSTANCE.getEBigDecimal(), DBType.LONGVARCHAR)); @Override protected Object getResultSetValue(ResultSet resultSet) throws SQLException @@ -922,8 +917,8 @@ public class CoreTypeMappings */ public static class TMJavaClass extends AbstractTypeMapping { - public static final Factory FACTORY_VARCHAR = new Factory(TypeMappingUtil - .createDescriptor(ID_PREFIX + ".JavaClassVarchar", EcorePackage.eINSTANCE.getEJavaClass(), DBType.VARCHAR)); + public static final Factory FACTORY_VARCHAR = new Factory( + TypeMappingUtil.createDescriptor(ID_PREFIX + ".JavaClassVarchar", EcorePackage.eINSTANCE.getEJavaClass(), DBType.VARCHAR)); @Override public Object getResultSetValue(ResultSet resultSet) throws SQLException @@ -954,8 +949,8 @@ public class CoreTypeMappings */ public static class TMJavaObject extends AbstractTypeMapping { - public static final Factory FACTORY = new Factory(TypeMappingUtil.createDescriptor(ID_PREFIX + ".JavaObjectBlob", - EcorePackage.eINSTANCE.getEJavaObject(), DBType.BLOB)); + public static final Factory FACTORY = new Factory( + TypeMappingUtil.createDescriptor(ID_PREFIX + ".JavaObjectBlob", EcorePackage.eINSTANCE.getEJavaObject(), DBType.BLOB)); @Override public Object getResultSetValue(ResultSet resultSet) throws SQLException @@ -986,14 +981,14 @@ public class CoreTypeMappings */ public static class TMCustom extends AbstractTypeMapping { - public static final Factory FACTORY_VARCHAR = new Factory(TypeMappingUtil - .createDescriptor(ID_PREFIX + ".CustomVarchar", EcorePackage.eINSTANCE.getEDataType(), DBType.VARCHAR)); + public static final Factory FACTORY_VARCHAR = new Factory( + TypeMappingUtil.createDescriptor(ID_PREFIX + ".CustomVarchar", EcorePackage.eINSTANCE.getEDataType(), DBType.VARCHAR)); - public static final Factory FACTORY_LONG_VARCHAR = new Factory(TypeMappingUtil - .createDescriptor(ID_PREFIX + ".CustomLongVarchar", EcorePackage.eINSTANCE.getEDataType(), DBType.LONGVARCHAR)); + public static final Factory FACTORY_LONG_VARCHAR = new Factory( + TypeMappingUtil.createDescriptor(ID_PREFIX + ".CustomLongVarchar", EcorePackage.eINSTANCE.getEDataType(), DBType.LONGVARCHAR)); - public static final Factory FACTORY_CLOB = new Factory(TypeMappingUtil.createDescriptor(ID_PREFIX + ".CustomClob", - EcorePackage.eINSTANCE.getEDataType(), DBType.CLOB)); + public static final Factory FACTORY_CLOB = new Factory( + TypeMappingUtil.createDescriptor(ID_PREFIX + ".CustomClob", EcorePackage.eINSTANCE.getEDataType(), DBType.CLOB)); @Override protected Object getResultSetValue(ResultSet resultSet) throws SQLException diff --git a/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/mapping/TypeMappingRegistry.java b/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/mapping/TypeMappingRegistry.java index 1116d42499..ee15e965c5 100644 --- a/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/mapping/TypeMappingRegistry.java +++ b/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/mapping/TypeMappingRegistry.java @@ -108,8 +108,7 @@ public class TypeMappingRegistry implements ITypeMapping.Registry, ITypeMapping. registerColumnTypeModifier("postgresql", new ColumnTypeModifier() { @Override - public DBType modify(Provider provider, IMappingStrategy mappingStrategy, EStructuralFeature feature, - DBType dbType) + public DBType modify(Provider provider, IMappingStrategy mappingStrategy, EStructuralFeature feature, DBType dbType) { EClassifier classifier = feature.getEType(); if (classifier == EcorePackage.eINSTANCE.getEChar()) @@ -307,8 +306,7 @@ public class TypeMappingRegistry implements ITypeMapping.Registry, ITypeMapping. { EClassifier type = getEType(feature); throw new IllegalStateException(MessageFormat.format(Messages.getString("TypeMappingRegistry.1"), - feature.getEContainingClass().getName() + "." + feature.getName(), - type.getEPackage().getName() + "." + type.getName(), dbType.getKeyword())); + feature.getEContainingClass().getName() + "." + feature.getName(), type.getEPackage().getName() + "." + type.getName(), dbType.getKeyword())); } IFactory factory = getContainer().getFactory(ITypeMapping.Factory.PRODUCT_GROUP, descriptor.getFactoryType()); @@ -359,8 +357,7 @@ public class TypeMappingRegistry implements ITypeMapping.Registry, ITypeMapping. dbType = DBType.getTypeByKeyword(typeKeyword); if (dbType == null) { - throw new IllegalArgumentException( - "Unsupported columnType (" + typeKeyword + ") annotation of feature " + feature.getName()); + throw new IllegalArgumentException("Unsupported columnType (" + typeKeyword + ") annotation of feature " + feature.getName()); } } else @@ -391,8 +388,7 @@ public class TypeMappingRegistry implements ITypeMapping.Registry, ITypeMapping. try { - columnTypeModifier = (ColumnTypeModifier)IPluginContainer.INSTANCE - .getElement(ColumnTypeModifier.Factory.PRODUCT_GROUP, factoryType, null); + columnTypeModifier = (ColumnTypeModifier)IPluginContainer.INSTANCE.getElement(ColumnTypeModifier.Factory.PRODUCT_GROUP, factoryType, null); } catch (FactoryNotFoundException ex) { diff --git a/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/mapping/TypeMappingUtil.java b/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/mapping/TypeMappingUtil.java index ecd8776752..4b9a3c31a3 100644 --- a/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/mapping/TypeMappingUtil.java +++ b/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/mapping/TypeMappingUtil.java @@ -68,8 +68,7 @@ public class TypeMappingUtil if (!matcher.matches()) { - throw new FactoryTypeParserException( - MessageFormat.format(Messages.getString("FactoryTypeParserException.1"), factoryType)); + throw new FactoryTypeParserException(MessageFormat.format(Messages.getString("FactoryTypeParserException.1"), factoryType)); } String id = matcher.group(1); @@ -80,22 +79,19 @@ public class TypeMappingUtil EPackage ePackage = EPackage.Registry.INSTANCE.getEPackage(packageUri); if (ePackage == null) { - throw new FactoryTypeParserException( - MessageFormat.format(Messages.getString("FactoryTypeParserException.2"), packageUri, factoryType)); + throw new FactoryTypeParserException(MessageFormat.format(Messages.getString("FactoryTypeParserException.2"), packageUri, factoryType)); } EClassifier eClassifier = ePackage.getEClassifier(classifierName); if (eClassifier == null) { - throw new FactoryTypeParserException( - MessageFormat.format(Messages.getString("FactoryTypeParserException.3"), classifierName, factoryType)); + throw new FactoryTypeParserException(MessageFormat.format(Messages.getString("FactoryTypeParserException.3"), classifierName, factoryType)); } DBType dbType = DBType.getTypeByKeyword(typeKeyword); if (dbType == null) { - throw new FactoryTypeParserException( - MessageFormat.format(Messages.getString("FactoryTypeParserException.4"), dbType, factoryType)); + throw new FactoryTypeParserException(MessageFormat.format(Messages.getString("FactoryTypeParserException.4"), dbType, factoryType)); } return new TypeMappingDescriptor(id, factoryType, eClassifier, dbType); diff --git a/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/mapping/horizontal/AbstractBasicListTableMapping.java b/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/mapping/horizontal/AbstractBasicListTableMapping.java index a5672188b8..d872901630 100644 --- a/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/mapping/horizontal/AbstractBasicListTableMapping.java +++ b/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/mapping/horizontal/AbstractBasicListTableMapping.java @@ -31,8 +31,7 @@ public abstract class AbstractBasicListTableMapping implements IListMapping3, IM private EStructuralFeature feature; - public AbstractBasicListTableMapping(IMappingStrategy mappingStrategy, EClass containingClass, - EStructuralFeature feature) + public AbstractBasicListTableMapping(IMappingStrategy mappingStrategy, EClass containingClass, EStructuralFeature feature) { this.mappingStrategy = mappingStrategy; this.containingClass = containingClass; @@ -61,8 +60,7 @@ public abstract class AbstractBasicListTableMapping implements IListMapping3, IM builder.append(index); } - public void addRangedChunkWhere(IDBStoreAccessor accessor, CDOID cdoid, StringBuilder builder, int fromIndex, - int toIndex) + public void addRangedChunkWhere(IDBStoreAccessor accessor, CDOID cdoid, StringBuilder builder, int fromIndex, int toIndex) { builder.append(LIST_IDX); builder.append(" BETWEEN "); //$NON-NLS-1$ diff --git a/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/mapping/horizontal/AbstractFeatureMapTableMapping.java b/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/mapping/horizontal/AbstractFeatureMapTableMapping.java index d1e66300c2..ff69901e7a 100644 --- a/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/mapping/horizontal/AbstractFeatureMapTableMapping.java +++ b/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/mapping/horizontal/AbstractFeatureMapTableMapping.java @@ -313,8 +313,8 @@ public abstract class AbstractFeatureMapTableMapping extends AbstractBasicListTa if (TRACER.isEnabled()) { - TRACER.format("Reading list values for feature {0}.{1} of {2}v{3}", getContainingClass().getName(), - getFeature().getName(), revision.getID(), revision.getVersion()); + TRACER.format("Reading list values for feature {0}.{1} of {2}v{3}", getContainingClass().getName(), getFeature().getName(), revision.getID(), + revision.getVersion()); } String sql = sqlSelectChunksPrefix + sqlOrderByIndex; @@ -360,8 +360,8 @@ public abstract class AbstractFeatureMapTableMapping extends AbstractBasicListTa if (TRACER.isEnabled()) { - TRACER.format("Reading list values done for feature {0}.{1} of {2}v{3}", getContainingClass().getName(), - getFeature().getName(), revision.getID(), revision.getVersion()); + TRACER.format("Reading list values done for feature {0}.{1} of {2}v{3}", getContainingClass().getName(), getFeature().getName(), revision.getID(), + revision.getVersion()); } } @@ -381,8 +381,8 @@ public abstract class AbstractFeatureMapTableMapping extends AbstractBasicListTa { if (TRACER.isEnabled()) { - TRACER.format("Reading list chunk values for feature {0}.{1} of {2}v{3}", getContainingClass().getName(), - getFeature().getName(), chunkReader.getRevision().getID(), chunkReader.getRevision().getVersion()); + TRACER.format("Reading list chunk values for feature {0}.{1} of {2}v{3}", getContainingClass().getName(), getFeature().getName(), + chunkReader.getRevision().getID(), chunkReader.getRevision().getVersion()); } StringBuilder builder = new StringBuilder(sqlSelectChunksPrefix); @@ -422,8 +422,7 @@ public abstract class AbstractFeatureMapTableMapping extends AbstractBasicListTa if (TRACER.isEnabled()) { - TRACER.format("Current chunk no. {0} is [start = {1}, size = {2}]", chunkIndex - 1, chunk.getStartIndex(), - chunkSize); + TRACER.format("Current chunk no. {0} is [start = {1}, size = {2}]", chunkIndex - 1, chunk.getStartIndex(), chunkSize); } } @@ -447,8 +446,7 @@ public abstract class AbstractFeatureMapTableMapping extends AbstractBasicListTa if (TRACER.isEnabled()) { - TRACER.format("Reading list chunk values done for feature {0}.{1} of {2}", getContainingClass().getName(), - getFeature(), chunkReader.getRevision()); + TRACER.format("Reading list chunk values done for feature {0}.{1} of {2}", getContainingClass().getName(), getFeature(), chunkReader.getRevision()); } } catch (SQLException ex) @@ -580,8 +578,7 @@ public abstract class AbstractFeatureMapTableMapping extends AbstractBasicListTa return metaDataManager.getMetaID(feature, timeStamp); } - public final boolean queryXRefs(IDBStoreAccessor accessor, String mainTableName, String mainTableWhere, - QueryXRefsContext context, String idString) + public final boolean queryXRefs(IDBStoreAccessor accessor, String mainTableName, String mainTableWhere, QueryXRefsContext context, String idString) { /* * must never be called (a feature map is not associated with an EReference feature, so XRefs are nor supported diff --git a/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/mapping/horizontal/AbstractHorizontalClassMapping.java b/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/mapping/horizontal/AbstractHorizontalClassMapping.java index 3c73413a1e..8cce38f001 100644 --- a/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/mapping/horizontal/AbstractHorizontalClassMapping.java +++ b/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/mapping/horizontal/AbstractHorizontalClassMapping.java @@ -289,8 +289,7 @@ public abstract class AbstractHorizontalClassMapping implements IClassMapping, I * @return <code>true</code> if the revision has been read successfully.<br> * <code>false</code> if the revision does not exist in the DB. */ - protected final boolean readValuesFromStatement(PreparedStatement stmt, InternalCDORevision revision, - IDBStoreAccessor accessor) + protected final boolean readValuesFromStatement(PreparedStatement stmt, InternalCDORevision revision, IDBStoreAccessor accessor) { ResultSet resultSet = null; @@ -333,8 +332,7 @@ public abstract class AbstractHorizontalClassMapping implements IClassMapping, I * @return <code>true</code> if the revision has been read successfully.<br> * <code>false</code> if the revision does not exist in the DB. */ - protected final boolean readValuesFromResultSet(ResultSet resultSet, IIDHandler idHandler, - InternalCDORevision revision, boolean forUnit) + protected final boolean readValuesFromResultSet(ResultSet resultSet, IIDHandler idHandler, InternalCDORevision revision, boolean forUnit) { try { @@ -514,14 +512,12 @@ public abstract class AbstractHorizontalClassMapping implements IClassMapping, I } } - public void writeRevision(IDBStoreAccessor accessor, InternalCDORevision revision, boolean mapType, boolean revise, - OMMonitor monitor) + public void writeRevision(IDBStoreAccessor accessor, InternalCDORevision revision, boolean mapType, boolean revise, OMMonitor monitor) { // If the repository's root resource ID is not yet set, then this must be the initial initRootResource() // commit. The duplicate check is certainly not needed in this case, and it appears that Mysql has problems // with it (Table definition has changed, please retry transaction), see bug 482886. - boolean duplicateResourcesCheckNeeded = revision.isResourceNode() - && mappingStrategy.getStore().getRepository().getRootResourceID() != null; + boolean duplicateResourcesCheckNeeded = revision.isResourceNode() && mappingStrategy.getStore().getRepository().getRootResourceID() != null; monitor.begin(duplicateResourcesCheckNeeded ? 10 : 9); Async async = null; @@ -612,8 +608,7 @@ public abstract class AbstractHorizontalClassMapping implements IClassMapping, I } } - public void handleRevisions(IDBStoreAccessor accessor, CDOBranch branch, long timeStamp, boolean exactTime, - CDORevisionHandler handler) + public void handleRevisions(IDBStoreAccessor accessor, CDOBranch branch, long timeStamp, boolean exactTime, CDORevisionHandler handler) { // branch parameter is ignored, because either it is null or main branch. // this does not make any difference for non-branching store. @@ -683,8 +678,8 @@ public abstract class AbstractHorizontalClassMapping implements IClassMapping, I if (version >= CDOBranchVersion.FIRST_VERSION) { - InternalCDORevision revision = (InternalCDORevision)revisionManager.getRevisionByVersion(id, - branchManager.getMainBranch().getVersion(version), CDORevision.UNCHUNKED, true); + InternalCDORevision revision = (InternalCDORevision)revisionManager.getRevisionByVersion(id, branchManager.getMainBranch().getVersion(version), + CDORevision.UNCHUNKED, true); if (!handler.handleRevision(revision)) { @@ -773,8 +768,7 @@ public abstract class AbstractHorizontalClassMapping implements IClassMapping, I } } - public void detachObject(IDBStoreAccessor accessor, CDOID id, int version, CDOBranch branch, long timeStamp, - OMMonitor monitor) + public void detachObject(IDBStoreAccessor accessor, CDOID id, int version, CDOBranch branch, long timeStamp, OMMonitor monitor) { Async async = null; monitor.begin(1 + listMappings.size()); @@ -852,8 +846,7 @@ public abstract class AbstractHorizontalClassMapping implements IClassMapping, I } } - protected abstract void rawDeleteAttributes(IDBStoreAccessor accessor, CDOID id, CDOBranch branch, int version, - OMMonitor fork); + protected abstract void rawDeleteAttributes(IDBStoreAccessor accessor, CDOID id, CDOBranch branch, int version, OMMonitor fork); public final boolean queryXRefs(IDBStoreAccessor accessor, QueryXRefsContext context, String idString) { @@ -892,8 +885,7 @@ public abstract class AbstractHorizontalClassMapping implements IClassMapping, I return true; } - protected final boolean queryScalarXRefs(IDBStoreAccessor accessor, List<EReference> scalarRefs, - QueryXRefsContext context, String idString) + protected final boolean queryScalarXRefs(IDBStoreAccessor accessor, List<EReference> scalarRefs, QueryXRefsContext context, String idString) { String tableName = table.getName(); String where = getListXRefsWhere(context); @@ -969,8 +961,7 @@ public abstract class AbstractHorizontalClassMapping implements IClassMapping, I protected abstract String getListXRefsWhere(QueryXRefsContext context); - protected abstract void detachAttributes(IDBStoreAccessor accessor, CDOID id, int version, CDOBranch branch, - long timeStamp, OMMonitor fork); + protected abstract void detachAttributes(IDBStoreAccessor accessor, CDOID id, int version, CDOBranch branch, long timeStamp, OMMonitor fork); protected abstract void reviseOldRevision(IDBStoreAccessor accessor, CDOID id, CDOBranch branch, long timeStamp); 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 8e3d98a136..1e914d1ff7 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 @@ -171,8 +171,8 @@ public abstract class AbstractHorizontalMappingStrategy extends AbstractMappingS } } - public void rawExport(IDBStoreAccessor accessor, CDODataOutput out, int fromBranchID, int toBranchID, - long fromCommitTime, long toCommitTime) throws IOException + public void rawExport(IDBStoreAccessor accessor, CDODataOutput out, int fromBranchID, int toBranchID, long fromCommitTime, long toCommitTime) + throws IOException { StringBuilder builder = new StringBuilder(); builder.append(" WHERE a_t."); //$NON-NLS-1$ @@ -205,8 +205,7 @@ public abstract class AbstractHorizontalMappingStrategy extends AbstractMappingS objectTypeMapper.rawExport(connection, out, fromCommitTime, toCommitTime); } - protected void rawExportList(CDODataOutput out, IDBConnection connection, IListMapping listMapping, - IDBTable attrTable, String attrSuffix) throws IOException + protected void rawExportList(CDODataOutput out, IDBConnection connection, IListMapping listMapping, IDBTable attrTable, String attrSuffix) throws IOException { for (IDBTable table : listMapping.getDBTables()) { @@ -226,8 +225,7 @@ public abstract class AbstractHorizontalMappingStrategy extends AbstractMappingS return getListJoin(attrTable, listTable); } - public void rawImport(IDBStoreAccessor accessor, CDODataInput in, long fromCommitTime, long toCommitTime, - OMMonitor monitor) throws IOException + public void rawImport(IDBStoreAccessor accessor, CDODataInput in, long fromCommitTime, long toCommitTime, OMMonitor monitor) throws IOException { int size = in.readInt(); if (size == 0) @@ -310,8 +308,7 @@ public abstract class AbstractHorizontalMappingStrategy extends AbstractMappingS } } - protected void rawImportUnreviseNewRevisions(IDBConnection connection, IDBTable table, long fromCommitTime, - long toCommitTime, OMMonitor monitor) + protected void rawImportUnreviseNewRevisions(IDBConnection connection, IDBTable table, long fromCommitTime, long toCommitTime, OMMonitor monitor) { throw new UnsupportedOperationException("Must be overridden"); } @@ -321,8 +318,7 @@ public abstract class AbstractHorizontalMappingStrategy extends AbstractMappingS throw new UnsupportedOperationException("Must be overridden"); } - protected void rawImportList(CDODataInput in, IDBConnection connection, IListMapping listMapping, OMMonitor monitor) - throws IOException + protected void rawImportList(CDODataInput in, IDBConnection connection, IListMapping listMapping, OMMonitor monitor) throws IOException { Collection<IDBTable> tables = listMapping.getDBTables(); int size = tables.size(); @@ -487,8 +483,8 @@ public abstract class AbstractHorizontalMappingStrategy extends AbstractMappingS final String prefix = "SELECT MIN(t." + ATTRIBUTES_ID + ") FROM " + CDODBSchema.CDO_OBJECTS + " o, "; - final String suffix = " t WHERE t." + ATTRIBUTES_BRANCH + "<0 AND t." + ATTRIBUTES_ID + "=o." + ATTRIBUTES_ID - + " AND t." + ATTRIBUTES_CREATED + "=o." + ATTRIBUTES_CREATED; + final String suffix = " t WHERE t." + ATTRIBUTES_BRANCH + "<0 AND t." + ATTRIBUTES_ID + "=o." + ATTRIBUTES_ID + " AND t." + ATTRIBUTES_CREATED + "=o." + + ATTRIBUTES_CREATED; getStore().visitAllTables(connection, new IDBStore.TableVisitor() { diff --git a/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/mapping/horizontal/AbstractListTableMapping.java b/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/mapping/horizontal/AbstractListTableMapping.java index f3aba7f88f..9bb39a2e4f 100644 --- a/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/mapping/horizontal/AbstractListTableMapping.java +++ b/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/mapping/horizontal/AbstractListTableMapping.java @@ -405,8 +405,8 @@ public abstract class AbstractListTableMapping extends AbstractBasicListTableMap { if (TRACER.isEnabled()) { - TRACER.format("Writing value for feature {0}.{1} index {2} of {3}v{4} : {5}", getContainingClass().getName(), - getFeature().getName(), idx, revision.getID(), revision.getVersion(), value); + TRACER.format("Writing value for feature {0}.{1} index {2} of {3}v{4} : {5}", getContainingClass().getName(), getFeature().getName(), idx, + revision.getID(), revision.getVersion(), value); } IDBPreparedStatement stmt = accessor.getDBConnection().prepareStatement(sqlInsertEntry, ReuseProbability.HIGH); @@ -429,8 +429,7 @@ public abstract class AbstractListTableMapping extends AbstractBasicListTableMap } } - public boolean queryXRefs(IDBStoreAccessor accessor, String mainTableName, String mainTableWhere, - QueryXRefsContext context, String idString) + public boolean queryXRefs(IDBStoreAccessor accessor, String mainTableName, String mainTableWhere, QueryXRefsContext context, String idString) { String tableName = table.getName(); String listJoin = getMappingStrategy().getListJoin("a_t", "l_t"); diff --git a/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/mapping/horizontal/AuditFeatureMapTableMappingWithRanges.java b/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/mapping/horizontal/AuditFeatureMapTableMappingWithRanges.java index b7efd3104c..83578ca65e 100644 --- a/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/mapping/horizontal/AuditFeatureMapTableMappingWithRanges.java +++ b/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/mapping/horizontal/AuditFeatureMapTableMappingWithRanges.java @@ -85,8 +85,7 @@ import java.util.Map; * @author Lothar Werzinger * @since 3.0 */ -public class AuditFeatureMapTableMappingWithRanges extends AbstractBasicListTableMapping - implements IListMappingDeltaSupport +public class AuditFeatureMapTableMappingWithRanges extends AbstractBasicListTableMapping implements IListMappingDeltaSupport { private static final ContextTracer TRACER = new ContextTracer(OM.DEBUG, AuditFeatureMapTableMappingWithRanges.class); @@ -136,8 +135,7 @@ public class AuditFeatureMapTableMappingWithRanges extends AbstractBasicListTabl private String sqlDeleteList; - public AuditFeatureMapTableMappingWithRanges(IMappingStrategy mappingStrategy, EClass eClass, - EStructuralFeature feature) + public AuditFeatureMapTableMappingWithRanges(IMappingStrategy mappingStrategy, EClass eClass, EStructuralFeature feature) { super(mappingStrategy, eClass, feature); initDBTypes(); @@ -646,8 +644,7 @@ public class AuditFeatureMapTableMappingWithRanges extends AbstractBasicListTabl public void clearList(IDBStoreAccessor accessor, CDOID id, int oldVersion, int newVersion) { IIDHandler idHandler = getMappingStrategy().getStore().getIDHandler(); - IDBPreparedStatement stmtDeleteTemp = accessor.getDBConnection().prepareStatement(sqlDeleteList, - ReuseProbability.HIGH); + IDBPreparedStatement stmtDeleteTemp = accessor.getDBConnection().prepareStatement(sqlDeleteList, ReuseProbability.HIGH); IDBPreparedStatement stmtClear = accessor.getDBConnection().prepareStatement(sqlClearList, ReuseProbability.HIGH); try @@ -693,8 +690,8 @@ public class AuditFeatureMapTableMappingWithRanges extends AbstractBasicListTabl CDOBranch main = getMappingStrategy().getStore().getRepository().getBranchManager().getMainBranch(); // get revision from cache to find out version number - CDORevision revision = getMappingStrategy().getStore().getRepository().getRevisionManager().getRevision(id, - main.getHead(), /* chunksize = */0, CDORevision.DEPTH_NONE, true); + CDORevision revision = getMappingStrategy().getStore().getRepository().getRevisionManager().getRevision(id, main.getHead(), + /* chunksize = */0, CDORevision.DEPTH_NONE, true); // set cdo_revision_removed for all list items (so we have no NULL values) clearList(accessor, id, revision.getVersion(), FINAL_VERSION); @@ -706,12 +703,12 @@ public class AuditFeatureMapTableMappingWithRanges extends AbstractBasicListTabl throw new UnsupportedOperationException("Raw deletion does not work in range-based mappings"); } - public void processDelta(final IDBStoreAccessor accessor, final CDOID id, final int branchId, int oldVersion, - final int newVersion, long created, CDOListFeatureDelta delta) + public void processDelta(final IDBStoreAccessor accessor, final CDOID id, final int branchId, int oldVersion, final int newVersion, long created, + CDOListFeatureDelta delta) { IRepository repo = accessor.getStore().getRepository(); - InternalCDORevision originalRevision = (InternalCDORevision)repo.getRevisionManager().getRevision(id, - repo.getBranchManager().getMainBranch().getHead(), /* chunksize = */0, CDORevision.DEPTH_NONE, true); + InternalCDORevision originalRevision = (InternalCDORevision)repo.getRevisionManager().getRevision(id, repo.getBranchManager().getMainBranch().getHead(), + /* chunksize = */0, CDORevision.DEPTH_NONE, true); int oldListSize = originalRevision.getList(getFeature()).size(); @@ -751,8 +748,7 @@ public class AuditFeatureMapTableMappingWithRanges extends AbstractBasicListTabl private long timestamp; - public ListDeltaVisitor(IDBStoreAccessor accessor, InternalCDORevision originalRevision, int oldVersion, - int newVersion, long timestamp) + public ListDeltaVisitor(IDBStoreAccessor accessor, InternalCDORevision originalRevision, int oldVersion, int newVersion, long timestamp) { this.accessor = accessor; this.originalRevision = originalRevision; @@ -886,8 +882,7 @@ public class AuditFeatureMapTableMappingWithRanges extends AbstractBasicListTabl throw new ImplementationError("Should not be called"); //$NON-NLS-1$ } - private void moveOneUp(IDBStoreAccessor accessor, CDOID id, int oldVersion, int newVersion, int startIndex, - int endIndex) + private void moveOneUp(IDBStoreAccessor accessor, CDOID id, int oldVersion, int newVersion, int startIndex, int endIndex) { IIDHandler idHandler = getMappingStrategy().getStore().getIDHandler(); IDBPreparedStatement stmt = accessor.getDBConnection().prepareStatement(sqlUpdateIndex, ReuseProbability.HIGH); @@ -954,8 +949,7 @@ public class AuditFeatureMapTableMappingWithRanges extends AbstractBasicListTabl } } - private void moveOneDown(IDBStoreAccessor accessor, CDOID id, int oldVersion, int newVersion, int startIndex, - int endIndex) + private void moveOneDown(IDBStoreAccessor accessor, CDOID id, int oldVersion, int newVersion, int startIndex, int endIndex) { IIDHandler idHandler = getMappingStrategy().getStore().getIDHandler(); IDBPreparedStatement stmt = accessor.getDBConnection().prepareStatement(sqlUpdateIndex, ReuseProbability.HIGH); @@ -1190,8 +1184,7 @@ public class AuditFeatureMapTableMappingWithRanges extends AbstractBasicListTabl } } - public final boolean queryXRefs(IDBStoreAccessor accessor, String mainTableName, String mainTableWhere, - QueryXRefsContext context, String idString) + public final boolean queryXRefs(IDBStoreAccessor accessor, String mainTableName, String mainTableWhere, QueryXRefsContext context, String idString) { // must never be called (a feature map is not associated with an EReference feature, so XRefs are nor supported // here) diff --git a/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/mapping/horizontal/AuditListTableMappingWithRanges.java b/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/mapping/horizontal/AuditListTableMappingWithRanges.java index d01923dbe2..a3d6b6720b 100644 --- a/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/mapping/horizontal/AuditListTableMappingWithRanges.java +++ b/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/mapping/horizontal/AuditListTableMappingWithRanges.java @@ -78,8 +78,7 @@ import java.util.List; * @author Stefan Winkler * @author Lothar Werzinger */ -public class AuditListTableMappingWithRanges extends AbstractBasicListTableMapping - implements IListMappingDeltaSupport, IListMappingUnitSupport +public class AuditListTableMappingWithRanges extends AbstractBasicListTableMapping implements IListMappingDeltaSupport, IListMappingUnitSupport { private static final ContextTracer TRACER = new ContextTracer(OM.DEBUG, AuditListTableMappingWithRanges.class); @@ -90,8 +89,7 @@ public class AuditListTableMappingWithRanges extends AbstractBasicListTableMappi private static final String SQL_ORDER_BY_INDEX = " ORDER BY " + LIST_IDX; - private static final boolean CHECK_UNIT_ENTRIES = Boolean - .getBoolean("org.eclipse.emf.cdo.server.db.checkUnitEntries"); + private static final boolean CHECK_UNIT_ENTRIES = Boolean.getBoolean("org.eclipse.emf.cdo.server.db.checkUnitEntries"); /** * The table of this mapping. @@ -149,8 +147,7 @@ public class AuditListTableMappingWithRanges extends AbstractBasicListTableMappi table.addField(LIST_IDX, DBType.INTEGER, true); // TODO think about indexes - table.addIndex(Type.NON_UNIQUE, LIST_REVISION_ID, LIST_REVISION_VERSION_ADDED, LIST_REVISION_VERSION_REMOVED, - LIST_IDX); + table.addIndex(Type.NON_UNIQUE, LIST_REVISION_ID, LIST_REVISION_VERSION_ADDED, LIST_REVISION_VERSION_REMOVED, LIST_IDX); typeMapping.createDBField(table, LIST_VALUE); } @@ -295,8 +292,8 @@ public class AuditListTableMappingWithRanges extends AbstractBasicListTableMappi " AND " + ATTRIBUTES_CREATED + "<=?" + // " AND (" + ATTRIBUTES_REVISED + "=0 OR " + ATTRIBUTES_REVISED + ">=?)" + // " AND cdo_list." + LIST_REVISION_VERSION_ADDED + "<=" + ATTRIBUTES_VERSION + // - " AND (cdo_list." + LIST_REVISION_VERSION_REMOVED + " IS NULL OR cdo_list." + LIST_REVISION_VERSION_REMOVED - + ">" + ATTRIBUTES_VERSION + ") ORDER BY cdo_list." + LIST_REVISION_ID + ", cdo_list." + LIST_IDX; + " AND (cdo_list." + LIST_REVISION_VERSION_REMOVED + " IS NULL OR cdo_list." + LIST_REVISION_VERSION_REMOVED + ">" + ATTRIBUTES_VERSION + + ") ORDER BY cdo_list." + LIST_REVISION_ID + ", cdo_list." + LIST_IDX; } } @@ -364,8 +361,7 @@ public class AuditListTableMappingWithRanges extends AbstractBasicListTableMappi if (TRACER.isEnabled()) { TRACER.format("Reading {4} list values done for feature {0}.{1} of {2}v{3}", //$NON-NLS-1$ - getContainingClass().getName(), getFeature().getName(), revision.getID(), revision.getVersion(), - list.size()); + getContainingClass().getName(), getFeature().getName(), revision.getID(), revision.getVersion(), list.size()); } } catch (SQLException ex) @@ -451,8 +447,7 @@ public class AuditListTableMappingWithRanges extends AbstractBasicListTableMappi if (TRACER.isEnabled()) { TRACER.format("Reading list chunk values done for feature() {0}.{1} of {2}v{3}", //$NON-NLS-1$ - getContainingClass().getName(), getFeature().getName(), chunkReader.getRevision().getID(), - chunkReader.getRevision().getVersion()); + getContainingClass().getName(), getFeature().getName(), chunkReader.getRevision().getID(), chunkReader.getRevision().getVersion()); } } catch (SQLException ex) @@ -487,8 +482,7 @@ public class AuditListTableMappingWithRanges extends AbstractBasicListTableMappi if (TRACER.isEnabled()) { TRACER.format("Writing value for feature {0}.{1} index {2} of {3}v{4} : {5}", //$NON-NLS-1$ - getContainingClass().getName(), getFeature().getName(), index, revision.getID(), revision.getVersion(), - value); + getContainingClass().getName(), getFeature().getName(), index, revision.getID(), revision.getVersion(), value); } addEntry(accessor, revision.getID(), revision.getVersion(), index, value); @@ -505,8 +499,7 @@ public class AuditListTableMappingWithRanges extends AbstractBasicListTableMappi public void clearList(IDBStoreAccessor accessor, CDOID id, int oldVersion, int newVersion) { IIDHandler idHandler = getMappingStrategy().getStore().getIDHandler(); - IDBPreparedStatement stmtDeleteTemp = accessor.getDBConnection().prepareStatement(sqlDeleteList, - ReuseProbability.HIGH); + IDBPreparedStatement stmtDeleteTemp = accessor.getDBConnection().prepareStatement(sqlDeleteList, ReuseProbability.HIGH); IDBPreparedStatement stmtClear = accessor.getDBConnection().prepareStatement(sqlClearList, ReuseProbability.HIGH); try @@ -552,8 +545,8 @@ public class AuditListTableMappingWithRanges extends AbstractBasicListTableMappi CDOBranch main = getMappingStrategy().getStore().getRepository().getBranchManager().getMainBranch(); // get revision from cache to find out version number - CDORevision revision = getMappingStrategy().getStore().getRepository().getRevisionManager().getRevision(id, - main.getHead(), /* chunksize = */0, CDORevision.DEPTH_NONE, true); + CDORevision revision = getMappingStrategy().getStore().getRepository().getRevisionManager().getRevision(id, main.getHead(), + /* chunksize = */0, CDORevision.DEPTH_NONE, true); // set cdo_revision_removed for all list items (so we have no NULL values) clearList(accessor, id, revision.getVersion(), FINAL_VERSION); @@ -565,19 +558,16 @@ public class AuditListTableMappingWithRanges extends AbstractBasicListTableMappi throw new UnsupportedOperationException("Raw deletion does not work in range-based mappings"); } - public ResultSet queryUnitEntries(IDBStoreAccessor accessor, IIDHandler idHandler, long timeStamp, CDOID rootID) - throws SQLException + public ResultSet queryUnitEntries(IDBStoreAccessor accessor, IIDHandler idHandler, long timeStamp, CDOID rootID) throws SQLException { - IDBPreparedStatement stmt = accessor.getDBConnection().prepareStatement(sqlSelectUnitEntries, - ReuseProbability.MEDIUM); + IDBPreparedStatement stmt = accessor.getDBConnection().prepareStatement(sqlSelectUnitEntries, ReuseProbability.MEDIUM); idHandler.setCDOID(stmt, 1, rootID); stmt.setLong(2, timeStamp); stmt.setLong(3, timeStamp); return stmt.executeQuery(); } - public void readUnitEntries(ResultSet resultSet, IIDHandler idHandler, CDOID id, MoveableList<Object> list) - throws SQLException + public void readUnitEntries(ResultSet resultSet, IIDHandler idHandler, CDOID id, MoveableList<Object> list) throws SQLException { int size = list.size(); for (int i = 0; i < size; i++) @@ -745,8 +735,7 @@ public class AuditListTableMappingWithRanges extends AbstractBasicListTableMappi return result; } - public final boolean queryXRefs(IDBStoreAccessor accessor, String mainTableName, String mainTableWhere, - QueryXRefsContext context, String idString) + public final boolean queryXRefs(IDBStoreAccessor accessor, String mainTableName, String mainTableWhere, QueryXRefsContext context, String idString) { String tableName = getTable().getName(); @@ -821,12 +810,12 @@ public class AuditListTableMappingWithRanges extends AbstractBasicListTableMappi } } - public void processDelta(final IDBStoreAccessor accessor, final CDOID id, final int branchId, int oldVersion, - final int newVersion, long created, CDOListFeatureDelta delta) + public void processDelta(final IDBStoreAccessor accessor, final CDOID id, final int branchId, int oldVersion, final int newVersion, long created, + CDOListFeatureDelta delta) { IRepository repo = accessor.getStore().getRepository(); - InternalCDORevision originalRevision = (InternalCDORevision)repo.getRevisionManager().getRevision(id, - repo.getBranchManager().getMainBranch().getHead(), /* chunksize = */0, CDORevision.DEPTH_NONE, true); + InternalCDORevision originalRevision = (InternalCDORevision)repo.getRevisionManager().getRevision(id, repo.getBranchManager().getMainBranch().getHead(), + /* chunksize = */0, CDORevision.DEPTH_NONE, true); int oldListSize = originalRevision.getList(getFeature()).size(); @@ -869,8 +858,7 @@ public class AuditListTableMappingWithRanges extends AbstractBasicListTableMappi private int lastRemovedIndex; - public ListDeltaVisitor(IDBStoreAccessor accessor, InternalCDORevision originalRevision, int oldVersion, - int newVersion) + public ListDeltaVisitor(IDBStoreAccessor accessor, InternalCDORevision originalRevision, int oldVersion, int newVersion) { this.accessor = accessor; id = originalRevision.getID(); @@ -1039,8 +1027,7 @@ public class AuditListTableMappingWithRanges extends AbstractBasicListTableMappi } } - private void moveOneUp(IDBStoreAccessor accessor, CDOID id, int oldVersion, int newVersion, int startIndex, - int endIndex) + private void moveOneUp(IDBStoreAccessor accessor, CDOID id, int oldVersion, int newVersion, int startIndex, int endIndex) { IIDHandler idHandler = getMappingStrategy().getStore().getIDHandler(); IDBPreparedStatement stmt = accessor.getDBConnection().prepareStatement(sqlUpdateIndex, ReuseProbability.HIGH); @@ -1107,8 +1094,7 @@ public class AuditListTableMappingWithRanges extends AbstractBasicListTableMappi } } - private void moveOneDown(IDBStoreAccessor accessor, CDOID id, int oldVersion, int newVersion, int startIndex, - int endIndex) + private void moveOneDown(IDBStoreAccessor accessor, CDOID id, int oldVersion, int newVersion, int startIndex, int endIndex) { IIDHandler idHandler = getMappingStrategy().getStore().getIDHandler(); IDBPreparedStatement stmt = accessor.getDBConnection().prepareStatement(sqlUpdateIndex, ReuseProbability.HIGH); diff --git a/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/mapping/horizontal/BranchingFeatureMapTableMappingWithRanges.java b/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/mapping/horizontal/BranchingFeatureMapTableMappingWithRanges.java index 93cda8157d..fe217ca460 100644 --- a/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/mapping/horizontal/BranchingFeatureMapTableMappingWithRanges.java +++ b/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/mapping/horizontal/BranchingFeatureMapTableMappingWithRanges.java @@ -83,11 +83,9 @@ import java.util.Map; * @author Lothar Werzinger * @since 3.0 */ -public class BranchingFeatureMapTableMappingWithRanges extends AbstractBasicListTableMapping - implements IListMappingDeltaSupport +public class BranchingFeatureMapTableMappingWithRanges extends AbstractBasicListTableMapping implements IListMappingDeltaSupport { - private static final ContextTracer TRACER = new ContextTracer(OM.DEBUG, - BranchingFeatureMapTableMappingWithRanges.class); + private static final ContextTracer TRACER = new ContextTracer(OM.DEBUG, BranchingFeatureMapTableMappingWithRanges.class); /** * Used to clean up lists for detached objects. @@ -133,8 +131,7 @@ public class BranchingFeatureMapTableMappingWithRanges extends AbstractBasicList private String sqlClearList; - public BranchingFeatureMapTableMappingWithRanges(IMappingStrategy mappingStrategy, EClass eClass, - EStructuralFeature feature) + public BranchingFeatureMapTableMappingWithRanges(IMappingStrategy mappingStrategy, EClass eClass, EStructuralFeature feature) { super(mappingStrategy, eClass, feature); initDBTypes(); @@ -572,8 +569,7 @@ public class BranchingFeatureMapTableMappingWithRanges extends AbstractBasicList // read missing indexes from missingValueStartIndex to currentIndex if (baseReader == null) { - baseReader = createBaseChunkReader(chunkReader.getAccessor(), chunkReader.getRevision().getID(), - chunkReader.getRevision().getBranch().getID()); + baseReader = createBaseChunkReader(chunkReader.getAccessor(), chunkReader.getRevision().getID(), chunkReader.getRevision().getBranch().getID()); } if (TRACER.isEnabled()) @@ -626,8 +622,7 @@ public class BranchingFeatureMapTableMappingWithRanges extends AbstractBasicList // read missing indexes from missingValueStartIndex to last chunk index if (baseReader == null) { - baseReader = createBaseChunkReader(chunkReader.getAccessor(), chunkReader.getRevision().getID(), - chunkReader.getRevision().getBranch().getID()); + baseReader = createBaseChunkReader(chunkReader.getAccessor(), chunkReader.getRevision().getID(), chunkReader.getRevision().getBranch().getID()); } baseReader.addRangedChunk(missingValueStartIndex, chunk.getStartIndex() + chunk.size()); } @@ -705,8 +700,7 @@ public class BranchingFeatureMapTableMappingWithRanges extends AbstractBasicList getFeature(), idx, revision, value); } - addEntry(accessor, revision.getID(), revision.getBranch().getID(), revision.getVersion(), idx, value, - revision.getTimeStamp()); + addEntry(accessor, revision.getID(), revision.getBranch().getID(), revision.getVersion(), idx, value, revision.getTimeStamp()); } /** @@ -786,8 +780,7 @@ public class BranchingFeatureMapTableMappingWithRanges extends AbstractBasicList * @param id * the id of the revision from which to remove all items */ - public void clearList(IDBStoreAccessor accessor, CDOID id, int branchId, int oldVersion, int newVersion, - int lastIndex, long timestamp) + public void clearList(IDBStoreAccessor accessor, CDOID id, int branchId, int oldVersion, int newVersion, int lastIndex, long timestamp) { // check for each index if the value exists in the current branch for (int i = 0; i <= lastIndex; i++) @@ -795,8 +788,7 @@ public class BranchingFeatureMapTableMappingWithRanges extends AbstractBasicList if (getValue(accessor, id, branchId, i, false) == null) { // if not, add a historic entry for missing ones. - addHistoricEntry(accessor, id, branchId, 0, newVersion, i, getValueFromBase(accessor, id, branchId, i), - timestamp); + addHistoricEntry(accessor, id, branchId, 0, newVersion, i, getValueFromBase(accessor, id, branchId, i), timestamp); } } @@ -836,8 +828,7 @@ public class BranchingFeatureMapTableMappingWithRanges extends AbstractBasicList TRACER.format("objectDetached {1}", revision); //$NON-NLS-1$ } - clearList(accessor, id, branchId, revision.getVersion(), FINAL_VERSION, revision.getList(getFeature()).size() - 1, - revised); + clearList(accessor, id, branchId, revision.getVersion(), FINAL_VERSION, revision.getList(getFeature()).size() - 1, revised); } @Override @@ -846,8 +837,8 @@ public class BranchingFeatureMapTableMappingWithRanges extends AbstractBasicList throw new UnsupportedOperationException("Raw deletion does not work in range-based mappings"); } - public void processDelta(final IDBStoreAccessor accessor, final CDOID id, final int branchId, int oldVersion, - final int newVersion, long created, CDOListFeatureDelta delta) + public void processDelta(final IDBStoreAccessor accessor, final CDOID id, final int branchId, int oldVersion, final int newVersion, long created, + CDOListFeatureDelta delta) { List<CDOFeatureDelta> listChanges = delta.getListChanges(); if (listChanges.size() == 0) @@ -866,8 +857,7 @@ public class BranchingFeatureMapTableMappingWithRanges extends AbstractBasicList } // let the visitor collect the changes - ListDeltaVisitor visitor = new ListDeltaVisitor(accessor, originalRevision, branchId, oldVersion, newVersion, - created); + ListDeltaVisitor visitor = new ListDeltaVisitor(accessor, originalRevision, branchId, oldVersion, newVersion, created); if (TRACER.isEnabled()) { @@ -911,8 +901,7 @@ public class BranchingFeatureMapTableMappingWithRanges extends AbstractBasicList private long timestamp; - public ListDeltaVisitor(IDBStoreAccessor accessor, InternalCDORevision originalRevision, int targetBranchID, - int oldVersion, int newVersion, long timestamp) + public ListDeltaVisitor(IDBStoreAccessor accessor, InternalCDORevision originalRevision, int targetBranchID, int oldVersion, int newVersion, long timestamp) { this.accessor = accessor; this.originalRevision = originalRevision; @@ -1047,8 +1036,7 @@ public class BranchingFeatureMapTableMappingWithRanges extends AbstractBasicList throw new ImplementationError("Should not be called"); //$NON-NLS-1$ } - private void moveOneUp(IDBStoreAccessor accessor, CDOID id, int branchId, int oldVersion, int newVersion, - int startIndex, int endIndex) + private void moveOneUp(IDBStoreAccessor accessor, CDOID id, int branchId, int oldVersion, int newVersion, int startIndex, int endIndex) { IIDHandler idHandler = getMappingStrategy().getStore().getIDHandler(); IDBPreparedStatement stmt = accessor.getDBConnection().prepareStatement(sqlUpdateIndex, ReuseProbability.HIGH); @@ -1130,8 +1118,7 @@ public class BranchingFeatureMapTableMappingWithRanges extends AbstractBasicList } } - private void moveOneDown(IDBStoreAccessor accessor, CDOID id, int branchId, int oldVersion, int newVersion, - int startIndex, int endIndex) + private void moveOneDown(IDBStoreAccessor accessor, CDOID id, int branchId, int oldVersion, int newVersion, int startIndex, int endIndex) { IIDHandler idHandler = getMappingStrategy().getStore().getIDHandler(); IDBPreparedStatement stmt = accessor.getDBConnection().prepareStatement(sqlUpdateIndex, ReuseProbability.HIGH); @@ -1208,8 +1195,7 @@ public class BranchingFeatureMapTableMappingWithRanges extends AbstractBasicList } } - private void addEntry(IDBStoreAccessor accessor, CDOID id, int branchId, int version, int index, Object value, - long timestamp) + private void addEntry(IDBStoreAccessor accessor, CDOID id, int branchId, int version, int index, Object value, long timestamp) { if (TRACER.isEnabled()) { @@ -1263,14 +1249,13 @@ public class BranchingFeatureMapTableMappingWithRanges extends AbstractBasicList } } - private void addHistoricEntry(IDBStoreAccessor accessor, CDOID id, int branchId, int versionAdded, int versionRemoved, - int index, Object value, long timestamp) + private void addHistoricEntry(IDBStoreAccessor accessor, CDOID id, int branchId, int versionAdded, int versionRemoved, int index, Object value, + long timestamp) { if (TRACER.isEnabled()) { TRACER.format("Adding historic value for feature {0}.{1} index {2} of {3}:{4}v{5}-v{6} : {7}", //$NON-NLS-1$ - getContainingClass().getName(), getFeature().getName(), index, id, branchId, versionAdded, versionRemoved, - value); + getContainingClass().getName(), getFeature().getName(), index, id, branchId, versionAdded, versionRemoved, value); } FeatureMap.Entry entry = (FeatureMap.Entry)value; @@ -1320,8 +1305,7 @@ public class BranchingFeatureMapTableMappingWithRanges extends AbstractBasicList } } - private void removeEntry(IDBStoreAccessor accessor, CDOID id, int branchId, int oldVersion, int newVersion, int index, - long timestamp) + private void removeEntry(IDBStoreAccessor accessor, CDOID id, int branchId, int oldVersion, int newVersion, int index, long timestamp) { if (TRACER.isEnabled()) { @@ -1493,8 +1477,7 @@ public class BranchingFeatureMapTableMappingWithRanges extends AbstractBasicList return accessor.createChunkReader(baseRevision, getFeature()); } - public final boolean queryXRefs(IDBStoreAccessor accessor, String mainTableName, String mainTableWhere, - QueryXRefsContext context, String idString) + public final boolean queryXRefs(IDBStoreAccessor accessor, String mainTableName, String mainTableWhere, QueryXRefsContext context, String idString) { // must never be called (a feature map is not associated with an EReference feature, so XRefs are nor supported // here) diff --git a/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/mapping/horizontal/BranchingListTableMappingWithRanges.java b/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/mapping/horizontal/BranchingListTableMappingWithRanges.java index e4e3946197..6712872391 100644 --- a/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/mapping/horizontal/BranchingListTableMappingWithRanges.java +++ b/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/mapping/horizontal/BranchingListTableMappingWithRanges.java @@ -81,8 +81,7 @@ import java.util.List; * @author Stefan Winkler * @author Lothar Werzinger */ -public class BranchingListTableMappingWithRanges extends AbstractBasicListTableMapping - implements IListMappingDeltaSupport +public class BranchingListTableMappingWithRanges extends AbstractBasicListTableMapping implements IListMappingDeltaSupport { private static final ContextTracer TRACER = new ContextTracer(OM.DEBUG, BranchingListTableMappingWithRanges.class); @@ -118,8 +117,7 @@ public class BranchingListTableMappingWithRanges extends AbstractBasicListTableM private String sqlClearList; - public BranchingListTableMappingWithRanges(IMappingStrategy mappingStrategy, EClass eClass, - EStructuralFeature feature) + public BranchingListTableMappingWithRanges(IMappingStrategy mappingStrategy, EClass eClass, EStructuralFeature feature) { super(mappingStrategy, eClass, feature); initTable(); @@ -147,8 +145,7 @@ public class BranchingListTableMappingWithRanges extends AbstractBasicListTableM table.addField(LIST_IDX, DBType.INTEGER, true); // TODO think about indexes - table.addIndex(Type.NON_UNIQUE, LIST_REVISION_ID, LIST_REVISION_BRANCH, LIST_REVISION_VERSION_ADDED, - LIST_REVISION_VERSION_REMOVED, LIST_IDX); + table.addIndex(Type.NON_UNIQUE, LIST_REVISION_ID, LIST_REVISION_BRANCH, LIST_REVISION_VERSION_ADDED, LIST_REVISION_VERSION_REMOVED, LIST_IDX); typeMapping.createDBField(table, LIST_VALUE); } @@ -595,8 +592,8 @@ public class BranchingListTableMappingWithRanges extends AbstractBasicListTableM { if (TRACER.isEnabled()) { - TRACER.format("Copying base chunk reader value {0} at index {1} to current chunk reader at index {2}.", - baseChunk.get(i), baseChunk.getStartIndex() + i, thisChunk.getStartIndex() + i + offset); + TRACER.format("Copying base chunk reader value {0} at index {1} to current chunk reader at index {2}.", baseChunk.get(i), + baseChunk.getStartIndex() + i, thisChunk.getStartIndex() + i + offset); } thisChunk.add(i + offset, baseChunk.get(i)); @@ -647,8 +644,7 @@ public class BranchingListTableMappingWithRanges extends AbstractBasicListTableM * the id of the revision from which to remove all items * @param lastIndex */ - public void clearList(IDBStoreAccessor accessor, CDOID id, int branchId, int oldVersion, int newVersion, - int lastIndex) + public void clearList(IDBStoreAccessor accessor, CDOID id, int branchId, int oldVersion, int newVersion, int lastIndex) { // check for each index if the value exists in the current branch for (int i = 0; i <= lastIndex; i++) @@ -713,8 +709,8 @@ public class BranchingListTableMappingWithRanges extends AbstractBasicListTableM throw new UnsupportedOperationException("Raw deletion does not work in range-based mappings"); } - public void processDelta(final IDBStoreAccessor accessor, final CDOID id, final int branchId, final int oldVersion, - final int newVersion, long created, CDOListFeatureDelta delta) + public void processDelta(final IDBStoreAccessor accessor, final CDOID id, final int branchId, final int oldVersion, final int newVersion, long created, + CDOListFeatureDelta delta) { List<CDOFeatureDelta> listChanges = delta.getListChanges(); if (listChanges.size() == 0) @@ -781,8 +777,7 @@ public class BranchingListTableMappingWithRanges extends AbstractBasicListTableM private int lastRemovedIndex; - public ListDeltaVisitor(IDBStoreAccessor accessor, InternalCDORevision originalRevision, int targetBranchID, - int oldVersion, int newVersion) + public ListDeltaVisitor(IDBStoreAccessor accessor, InternalCDORevision originalRevision, int targetBranchID, int oldVersion, int newVersion) { this.accessor = accessor; id = originalRevision.getID(); @@ -952,8 +947,7 @@ public class BranchingListTableMappingWithRanges extends AbstractBasicListTableM } } - private void moveOneUp(IDBStoreAccessor accessor, CDOID id, int branchId, int oldVersion, int newVersion, - int startIndex, int endIndex) + private void moveOneUp(IDBStoreAccessor accessor, CDOID id, int branchId, int oldVersion, int newVersion, int startIndex, int endIndex) { IIDHandler idHandler = getMappingStrategy().getStore().getIDHandler(); IDBPreparedStatement stmt = accessor.getDBConnection().prepareStatement(sqlUpdateIndex, ReuseProbability.HIGH); @@ -1036,8 +1030,7 @@ public class BranchingListTableMappingWithRanges extends AbstractBasicListTableM } } - private void moveOneDown(IDBStoreAccessor accessor, CDOID id, int branchId, int oldVersion, int newVersion, - int startIndex, int endIndex) + private void moveOneDown(IDBStoreAccessor accessor, CDOID id, int branchId, int oldVersion, int newVersion, int startIndex, int endIndex) { IIDHandler idHandler = getMappingStrategy().getStore().getIDHandler(); IDBPreparedStatement stmt = accessor.getDBConnection().prepareStatement(sqlUpdateIndex, ReuseProbability.HIGH); @@ -1158,14 +1151,12 @@ public class BranchingListTableMappingWithRanges extends AbstractBasicListTableM } } - private void addHistoricEntry(IDBStoreAccessor accessor, CDOID id, int branchId, int versionAdded, int versionRemoved, - int index, Object value) + private void addHistoricEntry(IDBStoreAccessor accessor, CDOID id, int branchId, int versionAdded, int versionRemoved, int index, Object value) { if (TRACER.isEnabled()) { TRACER.format("Adding historic value for feature {0}.{1} index {2} of {3}:{4}v{5}-v{6} : {7}", //$NON-NLS-1$ - getContainingClass().getName(), getFeature().getName(), index, id, branchId, versionAdded, versionRemoved, - value); + getContainingClass().getName(), getFeature().getName(), index, id, branchId, versionAdded, versionRemoved, value); } IIDHandler idHandler = getMappingStrategy().getStore().getIDHandler(); @@ -1384,8 +1375,7 @@ public class BranchingListTableMappingWithRanges extends AbstractBasicListTableM return accessor.createChunkReader(baseRevision, getFeature()); } - public final boolean queryXRefs(IDBStoreAccessor accessor, String mainTableName, String mainTableWhere, - QueryXRefsContext context, String idString) + public final boolean queryXRefs(IDBStoreAccessor accessor, String mainTableName, String mainTableWhere, QueryXRefsContext context, String idString) { String tableName = getTable().getName(); diff --git a/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/mapping/horizontal/DelegatingObjectTypeMapper.java b/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/mapping/horizontal/DelegatingObjectTypeMapper.java index d17ebbe6fd..4af378d9a9 100644 --- a/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/mapping/horizontal/DelegatingObjectTypeMapper.java +++ b/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/mapping/horizontal/DelegatingObjectTypeMapper.java @@ -88,8 +88,7 @@ public abstract class DelegatingObjectTypeMapper extends AbstractObjectTypeMappe return delegate.getMaxID(connection, idHandler); } - public void rawExport(Connection connection, CDODataOutput out, long fromCommitTime, long toCommitTime) - throws IOException + public void rawExport(Connection connection, CDODataOutput out, long fromCommitTime, long toCommitTime) throws IOException { delegate.rawExport(connection, out, fromCommitTime, toCommitTime); } diff --git a/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/mapping/horizontal/HorizontalAuditClassMapping.java b/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/mapping/horizontal/HorizontalAuditClassMapping.java index aedfcefdaf..f6f73b7caa 100644 --- a/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/mapping/horizontal/HorizontalAuditClassMapping.java +++ b/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/mapping/horizontal/HorizontalAuditClassMapping.java @@ -86,8 +86,7 @@ public class HorizontalAuditClassMapping extends AbstractHorizontalClassMapping { private static final ContextTracer TRACER = new ContextTracer(OM.DEBUG, HorizontalAuditClassMapping.class); - private static final ContextTracer TRACER_UNITS = new ContextTracer(OM.DEBUG_UNITS, - HorizontalAuditClassMapping.class); + private static final ContextTracer TRACER_UNITS = new ContextTracer(OM.DEBUG_UNITS, HorizontalAuditClassMapping.class); private String sqlInsertAttributes; @@ -333,8 +332,7 @@ public class HorizontalAuditClassMapping extends AbstractHorizontalClassMapping public boolean readRevisionByVersion(IDBStoreAccessor accessor, InternalCDORevision revision, int listChunk) { IIDHandler idHandler = getMappingStrategy().getStore().getIDHandler(); - IDBPreparedStatement stmt = accessor.getDBConnection().prepareStatement(sqlSelectAttributesByVersion, - ReuseProbability.HIGH); + IDBPreparedStatement stmt = accessor.getDBConnection().prepareStatement(sqlSelectAttributesByVersion, ReuseProbability.HIGH); try { @@ -362,8 +360,8 @@ public class HorizontalAuditClassMapping extends AbstractHorizontalClassMapping } } - public IDBPreparedStatement createResourceQueryStatement(IDBStoreAccessor accessor, CDOID folderId, String name, - boolean exactMatch, CDOBranchPoint branchPoint) + public IDBPreparedStatement createResourceQueryStatement(IDBStoreAccessor accessor, CDOID folderId, String name, boolean exactMatch, + CDOBranchPoint branchPoint) { EStructuralFeature nameFeature = EresourcePackage.eINSTANCE.getCDOResourceNode_Name(); long timeStamp = branchPoint.getTimeStamp(); @@ -412,8 +410,7 @@ public class HorizontalAuditClassMapping extends AbstractHorizontalClassMapping } IIDHandler idHandler = getMappingStrategy().getStore().getIDHandler(); - IDBPreparedStatement stmt = accessor.getDBConnection().prepareStatement(builder.toString(), - ReuseProbability.MEDIUM); + IDBPreparedStatement stmt = accessor.getDBConnection().prepareStatement(builder.toString(), ReuseProbability.MEDIUM); try { @@ -522,8 +519,7 @@ public class HorizontalAuditClassMapping extends AbstractHorizontalClassMapping } @Override - protected void detachAttributes(IDBStoreAccessor accessor, CDOID id, int version, CDOBranch branch, long timeStamp, - OMMonitor mon) + protected void detachAttributes(IDBStoreAccessor accessor, CDOID id, int version, CDOBranch branch, long timeStamp, OMMonitor mon) { IIDHandler idHandler = getMappingStrategy().getStore().getIDHandler(); IDBPreparedStatement stmt = accessor.getDBConnection().prepareStatement(sqlInsertAttributes, ReuseProbability.HIGH); @@ -579,8 +575,7 @@ public class HorizontalAuditClassMapping extends AbstractHorizontalClassMapping @Override protected void rawDeleteAttributes(IDBStoreAccessor accessor, CDOID id, CDOBranch branch, int version, OMMonitor fork) { - IDBPreparedStatement stmt = accessor.getDBConnection().prepareStatement(sqlRawDeleteAttributes, - ReuseProbability.HIGH); + IDBPreparedStatement stmt = accessor.getDBConnection().prepareStatement(sqlRawDeleteAttributes, ReuseProbability.HIGH); try { @@ -621,8 +616,7 @@ public class HorizontalAuditClassMapping extends AbstractHorizontalClassMapping } } - public void writeRevisionDelta(IDBStoreAccessor accessor, InternalCDORevisionDelta delta, long created, - OMMonitor monitor) + public void writeRevisionDelta(IDBStoreAccessor accessor, InternalCDORevisionDelta delta, long created, OMMonitor monitor) { Async async = null; monitor.begin(); @@ -681,8 +675,7 @@ public class HorizontalAuditClassMapping extends AbstractHorizontalClassMapping return builder.toString(); } - public void readUnitRevisions(IDBStoreAccessor accessor, CDOBranchPoint branchPoint, CDOID rootID, - CDORevisionHandler revisionHandler) throws SQLException + public void readUnitRevisions(IDBStoreAccessor accessor, CDOBranchPoint branchPoint, CDOID rootID, CDORevisionHandler revisionHandler) throws SQLException { DBStore store = (DBStore)getMappingStrategy().getStore(); InternalRepository repository = store.getRepository(); @@ -732,8 +725,8 @@ public class HorizontalAuditClassMapping extends AbstractHorizontalClassMapping if (start1 != CDOBranchPoint.UNSPECIFIED_DATE) { - TRACER_UNITS.format("Read {0} revisions of unit {1}: {2} millis + {3} millis", eClass.getName(), rootID, - start2 - start1, System.currentTimeMillis() - start2); + TRACER_UNITS.format("Read {0} revisions of unit {1}: {2} millis + {3} millis", eClass.getName(), rootID, start2 - start1, + System.currentTimeMillis() - start2); } } finally @@ -771,8 +764,7 @@ public class HorizontalAuditClassMapping extends AbstractHorizontalClassMapping private Throwable exception; - public AsnychronousListFiller(IDBStoreAccessor accessor, long timeStamp, CDOID rootID, - CDORevisionHandler revisionHandler) + public AsnychronousListFiller(IDBStoreAccessor accessor, long timeStamp, CDOID rootID, CDORevisionHandler revisionHandler) { this.accessor = accessor; this.timeStamp = timeStamp; @@ -938,8 +930,8 @@ public class HorizontalAuditClassMapping extends AbstractHorizontalClassMapping TRACER.format("FeatureDeltaWriter: old version: {0}, new version: {1}", oldVersion, oldVersion + 1); //$NON-NLS-1$ } - InternalCDORevision originalRevision = (InternalCDORevision)accessor.getStore().getRepository() - .getRevisionManager().getRevisionByVersion(id, delta, 0, true); + InternalCDORevision originalRevision = (InternalCDORevision)accessor.getStore().getRepository().getRevisionManager().getRevisionByVersion(id, delta, 0, + true); newRevision = originalRevision.copy(); diff --git a/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/mapping/horizontal/HorizontalBranchingClassMapping.java b/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/mapping/horizontal/HorizontalBranchingClassMapping.java index 56955a5406..61ef33195d 100644 --- a/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/mapping/horizontal/HorizontalBranchingClassMapping.java +++ b/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/mapping/horizontal/HorizontalBranchingClassMapping.java @@ -76,8 +76,7 @@ import java.util.Set; * @author Stefan Winkler * @since 3.0 */ -public class HorizontalBranchingClassMapping extends AbstractHorizontalClassMapping - implements IClassMappingAuditSupport, IClassMappingDeltaSupport +public class HorizontalBranchingClassMapping extends AbstractHorizontalClassMapping implements IClassMappingAuditSupport, IClassMappingDeltaSupport { /** * @author Stefan Winkler @@ -394,8 +393,7 @@ public class HorizontalBranchingClassMapping extends AbstractHorizontalClassMapp public boolean readRevisionByVersion(IDBStoreAccessor accessor, InternalCDORevision revision, int listChunk) { IIDHandler idHandler = getMappingStrategy().getStore().getIDHandler(); - IDBPreparedStatement stmt = accessor.getDBConnection().prepareStatement(sqlSelectAttributesByVersion, - ReuseProbability.HIGH); + IDBPreparedStatement stmt = accessor.getDBConnection().prepareStatement(sqlSelectAttributesByVersion, ReuseProbability.HIGH); boolean success = false; try @@ -425,8 +423,8 @@ public class HorizontalBranchingClassMapping extends AbstractHorizontalClassMapp return success; } - public IDBPreparedStatement createResourceQueryStatement(IDBStoreAccessor accessor, CDOID folderId, String name, - boolean exactMatch, CDOBranchPoint branchPoint) + public IDBPreparedStatement createResourceQueryStatement(IDBStoreAccessor accessor, CDOID folderId, String name, boolean exactMatch, + CDOBranchPoint branchPoint) { EStructuralFeature nameFeature = EresourcePackage.eINSTANCE.getCDOResourceNode_Name(); @@ -479,8 +477,7 @@ public class HorizontalBranchingClassMapping extends AbstractHorizontalClassMapp } IIDHandler idHandler = getMappingStrategy().getStore().getIDHandler(); - IDBPreparedStatement stmt = accessor.getDBConnection().prepareStatement(builder.toString(), - ReuseProbability.MEDIUM); + IDBPreparedStatement stmt = accessor.getDBConnection().prepareStatement(builder.toString(), ReuseProbability.MEDIUM); try { @@ -590,8 +587,7 @@ public class HorizontalBranchingClassMapping extends AbstractHorizontalClassMapp } @Override - protected void detachAttributes(IDBStoreAccessor accessor, CDOID id, int version, CDOBranch branch, long timeStamp, - OMMonitor mon) + protected void detachAttributes(IDBStoreAccessor accessor, CDOID id, int version, CDOBranch branch, long timeStamp, OMMonitor mon) { IIDHandler idHandler = getMappingStrategy().getStore().getIDHandler(); IDBPreparedStatement stmt = accessor.getDBConnection().prepareStatement(sqlInsertAttributes, ReuseProbability.HIGH); @@ -649,8 +645,7 @@ public class HorizontalBranchingClassMapping extends AbstractHorizontalClassMapp protected void rawDeleteAttributes(IDBStoreAccessor accessor, CDOID id, CDOBranch branch, int version, OMMonitor fork) { IIDHandler idHandler = getMappingStrategy().getStore().getIDHandler(); - IDBPreparedStatement stmt = accessor.getDBConnection().prepareStatement(sqlRawDeleteAttributes, - ReuseProbability.HIGH); + IDBPreparedStatement stmt = accessor.getDBConnection().prepareStatement(sqlRawDeleteAttributes, ReuseProbability.HIGH); try { @@ -693,8 +688,7 @@ public class HorizontalBranchingClassMapping extends AbstractHorizontalClassMapp } @Override - public void writeRevision(IDBStoreAccessor accessor, InternalCDORevision revision, boolean mapType, boolean revise, - OMMonitor monitor) + public void writeRevision(IDBStoreAccessor accessor, InternalCDORevision revision, boolean mapType, boolean revise, OMMonitor monitor) { Async async = null; monitor.begin(10); @@ -793,8 +787,7 @@ public class HorizontalBranchingClassMapping extends AbstractHorizontalClassMapp } @Override - public void handleRevisions(IDBStoreAccessor accessor, CDOBranch branch, long timeStamp, boolean exactTime, - CDORevisionHandler handler) + public void handleRevisions(IDBStoreAccessor accessor, CDOBranch branch, long timeStamp, boolean exactTime, CDORevisionHandler handler) { StringBuilder builder = new StringBuilder(sqlSelectForHandle); boolean whereAppend = false; @@ -874,8 +867,7 @@ public class HorizontalBranchingClassMapping extends AbstractHorizontalClassMapp { int branchID = resultSet.getInt(3); CDOBranchVersion branchVersion = branchManager.getBranch(branchID).getVersion(Math.abs(version)); - InternalCDORevision revision = (InternalCDORevision)revisionManager.getRevisionByVersion(id, branchVersion, - CDORevision.UNCHUNKED, true); + InternalCDORevision revision = (InternalCDORevision)revisionManager.getRevisionByVersion(id, branchVersion, CDORevision.UNCHUNKED, true); if (!handler.handleRevision(revision)) { @@ -1003,8 +995,7 @@ public class HorizontalBranchingClassMapping extends AbstractHorizontalClassMapp return builder.toString(); } - public void writeRevisionDelta(IDBStoreAccessor accessor, InternalCDORevisionDelta delta, long created, - OMMonitor monitor) + public void writeRevisionDelta(IDBStoreAccessor accessor, InternalCDORevisionDelta delta, long created, OMMonitor monitor) { monitor.begin(); @@ -1042,8 +1033,7 @@ public class HorizontalBranchingClassMapping extends AbstractHorizontalClassMapp } } - private void doCopyOnBranch(IDBStoreAccessor accessor, InternalCDORevisionDelta delta, long created, - OMMonitor monitor) + private void doCopyOnBranch(IDBStoreAccessor accessor, InternalCDORevisionDelta delta, long created, OMMonitor monitor) { monitor.begin(2); try diff --git a/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/mapping/horizontal/HorizontalBranchingMappingStrategy.java b/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/mapping/horizontal/HorizontalBranchingMappingStrategy.java index 93f4e6e99c..6b8ec94ac9 100644 --- a/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/mapping/horizontal/HorizontalBranchingMappingStrategy.java +++ b/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/mapping/horizontal/HorizontalBranchingMappingStrategy.java @@ -105,20 +105,18 @@ public class HorizontalBranchingMappingStrategy extends AbstractHorizontalMappin @Override protected void rawImportReviseOldRevisions(IDBConnection connection, IDBTable table, OMMonitor monitor) { - String sqlUpdate = "UPDATE " + table + " SET " + ATTRIBUTES_REVISED + "=? WHERE " + ATTRIBUTES_ID + "=? AND " - + ATTRIBUTES_BRANCH + "=? AND " + ATTRIBUTES_VERSION + "=?"; + String sqlUpdate = "UPDATE " + table + " SET " + ATTRIBUTES_REVISED + "=? WHERE " + ATTRIBUTES_ID + "=? AND " + ATTRIBUTES_BRANCH + "=? AND " + + ATTRIBUTES_VERSION + "=?"; - String sqlQuery = "SELECT cdo1." + ATTRIBUTES_ID + ", cdo1." + ATTRIBUTES_BRANCH + ", cdo1." + ATTRIBUTES_VERSION - + ", cdo2." + ATTRIBUTES_CREATED + " FROM " + table + " cdo1, " + table + " cdo2 WHERE cdo1." + ATTRIBUTES_ID - + "=cdo2." + ATTRIBUTES_ID + " AND cdo1." + ATTRIBUTES_BRANCH + "=cdo2." + ATTRIBUTES_BRANCH + " AND (cdo1." - + ATTRIBUTES_VERSION + "=cdo2." + ATTRIBUTES_VERSION + "-1 OR (cdo1." + ATTRIBUTES_VERSION + "+cdo2." - + ATTRIBUTES_VERSION + "=-1 AND cdo1." + ATTRIBUTES_VERSION + ">cdo2." + ATTRIBUTES_VERSION + ")) AND cdo1." - + ATTRIBUTES_REVISED + "=0"; + String sqlQuery = "SELECT cdo1." + ATTRIBUTES_ID + ", cdo1." + ATTRIBUTES_BRANCH + ", cdo1." + ATTRIBUTES_VERSION + ", cdo2." + ATTRIBUTES_CREATED + + " FROM " + table + " cdo1, " + table + " cdo2 WHERE cdo1." + ATTRIBUTES_ID + "=cdo2." + ATTRIBUTES_ID + " AND cdo1." + ATTRIBUTES_BRANCH + "=cdo2." + + ATTRIBUTES_BRANCH + " AND (cdo1." + ATTRIBUTES_VERSION + "=cdo2." + ATTRIBUTES_VERSION + "-1 OR (cdo1." + ATTRIBUTES_VERSION + "+cdo2." + + ATTRIBUTES_VERSION + "=-1 AND cdo1." + ATTRIBUTES_VERSION + ">cdo2." + ATTRIBUTES_VERSION + ")) AND cdo1." + ATTRIBUTES_REVISED + "=0"; IIDHandler idHandler = getStore().getIDHandler(); IDBPreparedStatement stmtUpdate = connection.prepareStatement(sqlUpdate, ReuseProbability.MEDIUM); - IDBPreparedStatement stmtQuery = connection.prepareStatement(sqlQuery, ResultSet.TYPE_SCROLL_INSENSITIVE, - ResultSet.CONCUR_READ_ONLY, ReuseProbability.MEDIUM); + IDBPreparedStatement stmtQuery = connection.prepareStatement(sqlQuery, ResultSet.TYPE_SCROLL_INSENSITIVE, ResultSet.CONCUR_READ_ONLY, + ReuseProbability.MEDIUM); ResultSet resultSet = null; try @@ -171,12 +169,10 @@ public class HorizontalBranchingMappingStrategy extends AbstractHorizontalMappin } @Override - protected void rawImportUnreviseNewRevisions(IDBConnection connection, IDBTable table, long fromCommitTime, - long toCommitTime, OMMonitor monitor) + protected void rawImportUnreviseNewRevisions(IDBConnection connection, IDBTable table, long fromCommitTime, long toCommitTime, OMMonitor monitor) { - String sql = "UPDATE " + table + " SET " + ATTRIBUTES_REVISED + "=0 WHERE " + ATTRIBUTES_BRANCH + ">=0 AND " - + ATTRIBUTES_CREATED + "<=" + toCommitTime + " AND " + ATTRIBUTES_REVISED + ">" + toCommitTime + " AND " - + ATTRIBUTES_VERSION + ">0"; + String sql = "UPDATE " + table + " SET " + ATTRIBUTES_REVISED + "=0 WHERE " + ATTRIBUTES_BRANCH + ">=0 AND " + ATTRIBUTES_CREATED + "<=" + toCommitTime + + " AND " + ATTRIBUTES_REVISED + ">" + toCommitTime + " AND " + ATTRIBUTES_VERSION + ">0"; IDBPreparedStatement stmt = connection.prepareStatement(sql, ReuseProbability.MEDIUM); diff --git a/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/mapping/horizontal/HorizontalBranchingMappingStrategyWithRanges.java b/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/mapping/horizontal/HorizontalBranchingMappingStrategyWithRanges.java index dcd53673b1..23270d73f6 100644 --- a/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/mapping/horizontal/HorizontalBranchingMappingStrategyWithRanges.java +++ b/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/mapping/horizontal/HorizontalBranchingMappingStrategyWithRanges.java @@ -84,8 +84,7 @@ public class HorizontalBranchingMappingStrategyWithRanges extends HorizontalBran } @Override - protected void rawExportList(CDODataOutput out, IDBConnection connection, IListMapping listMapping, - IDBTable attrTable, String attrSuffix) throws IOException + protected void rawExportList(CDODataOutput out, IDBConnection connection, IListMapping listMapping, IDBTable attrTable, String attrSuffix) throws IOException { super.rawExportList(out, connection, listMapping, attrTable, attrSuffix); @@ -95,8 +94,7 @@ public class HorizontalBranchingMappingStrategyWithRanges extends HorizontalBran } } - private void rawExportListPostProcess(CDODataOutput out, IDBConnection connection, IDBTable attrTable, - String attrSuffix, IDBTable table) throws IOException + private void rawExportListPostProcess(CDODataOutput out, IDBConnection connection, IDBTable attrTable, String attrSuffix, IDBTable table) throws IOException { StringBuilder builder = new StringBuilder(); builder.append("SELECT l_t."); @@ -122,8 +120,7 @@ public class HorizontalBranchingMappingStrategyWithRanges extends HorizontalBran String sql = DBUtil.trace(builder.toString()); IIDHandler idHandler = getStore().getIDHandler(); - IDBPreparedStatement stmt = connection.prepareStatement(sql, ResultSet.TYPE_SCROLL_INSENSITIVE, - ResultSet.CONCUR_READ_ONLY, ReuseProbability.MEDIUM); + IDBPreparedStatement stmt = connection.prepareStatement(sql, ResultSet.TYPE_SCROLL_INSENSITIVE, ResultSet.CONCUR_READ_ONLY, ReuseProbability.MEDIUM); ResultSet resultSet = null; try @@ -165,8 +162,7 @@ public class HorizontalBranchingMappingStrategyWithRanges extends HorizontalBran } @Override - protected void rawImportList(CDODataInput in, IDBConnection connection, IListMapping listMapping, OMMonitor monitor) - throws IOException + protected void rawImportList(CDODataInput in, IDBConnection connection, IListMapping listMapping, OMMonitor monitor) throws IOException { Collection<IDBTable> tables = listMapping.getDBTables(); int size = tables.size(); @@ -192,8 +188,7 @@ public class HorizontalBranchingMappingStrategyWithRanges extends HorizontalBran } } - private void rawImportListPostProcess(CDODataInput in, IDBConnection connection, IDBTable table, OMMonitor monitor) - throws IOException + private void rawImportListPostProcess(CDODataInput in, IDBConnection connection, IDBTable table, OMMonitor monitor) throws IOException { int size = in.readInt(); if (size == 0) @@ -278,8 +273,7 @@ public class HorizontalBranchingMappingStrategyWithRanges extends HorizontalBran return modifyListJoin2(attrTable, listTable, join, forRawExport, false); } - private String modifyListJoin2(String attrTable, String listTable, String join, boolean forRawExport, - boolean forPostProcess) + private String modifyListJoin2(String attrTable, String listTable, String join, boolean forRawExport, boolean forPostProcess) { join += " AND " + listTable + "."; @@ -343,8 +337,7 @@ public class HorizontalBranchingMappingStrategyWithRanges extends HorizontalBran private IDBPreparedStatement stmt; - public void handleRow(ExtendedDataInput in, Connection connection, IDBField[] fields, Object[] values) - throws SQLException, IOException + public void handleRow(ExtendedDataInput in, Connection connection, IDBField[] fields, Object[] values) throws SQLException, IOException { int versionAdded = DBUtil.asInt(values[2]); if (versionAdded == CDOBranchVersion.FIRST_VERSION) diff --git a/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/mapping/horizontal/HorizontalMappingStrategy.java b/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/mapping/horizontal/HorizontalMappingStrategy.java index 3e601ae5e5..cebe25675f 100644 --- a/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/mapping/horizontal/HorizontalMappingStrategy.java +++ b/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/mapping/horizontal/HorizontalMappingStrategy.java @@ -204,8 +204,7 @@ public class HorizontalMappingStrategy extends Lifecycle implements IMappingStra delegate.repairAfterCrash(dbAdapter, connection); } - public void handleRevisions(IDBStoreAccessor accessor, EClass eClass, CDOBranch branch, long timeStamp, - boolean exactTime, CDORevisionHandler handler) + public void handleRevisions(IDBStoreAccessor accessor, EClass eClass, CDOBranch branch, long timeStamp, boolean exactTime, CDORevisionHandler handler) { delegate.handleRevisions(accessor, eClass, branch, timeStamp, exactTime, handler); } @@ -215,14 +214,13 @@ public class HorizontalMappingStrategy extends Lifecycle implements IMappingStra return delegate.readChangeSet(accessor, monitor, segments); } - public void rawExport(IDBStoreAccessor accessor, CDODataOutput out, int lastReplicatedBranchID, int lastBranchID, - long lastReplicatedCommitTime, long lastCommitTime) throws IOException + public void rawExport(IDBStoreAccessor accessor, CDODataOutput out, int lastReplicatedBranchID, int lastBranchID, long lastReplicatedCommitTime, + long lastCommitTime) throws IOException { delegate.rawExport(accessor, out, lastReplicatedBranchID, lastBranchID, lastReplicatedCommitTime, lastCommitTime); } - public void rawImport(IDBStoreAccessor accessor, CDODataInput in, long fromCommitTime, long toCommitTime, - OMMonitor monitor) throws IOException + public void rawImport(IDBStoreAccessor accessor, CDODataInput in, long fromCommitTime, long toCommitTime, OMMonitor monitor) throws IOException { delegate.rawImport(accessor, in, fromCommitTime, toCommitTime, monitor); } diff --git a/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/mapping/horizontal/HorizontalNonAuditClassMapping.java b/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/mapping/horizontal/HorizontalNonAuditClassMapping.java index fce0989336..73ff927688 100644 --- a/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/mapping/horizontal/HorizontalNonAuditClassMapping.java +++ b/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/mapping/horizontal/HorizontalNonAuditClassMapping.java @@ -282,8 +282,8 @@ public class HorizontalNonAuditClassMapping extends AbstractHorizontalClassMappi return accessor.getDBConnection().prepareStatement(sqlSelectAllObjectIDs, ReuseProbability.HIGH); } - public IDBPreparedStatement createResourceQueryStatement(IDBStoreAccessor accessor, CDOID folderId, String name, - boolean exactMatch, CDOBranchPoint branchPoint) + public IDBPreparedStatement createResourceQueryStatement(IDBStoreAccessor accessor, CDOID folderId, String name, boolean exactMatch, + CDOBranchPoint branchPoint) { long timeStamp = branchPoint.getTimeStamp(); if (timeStamp != CDORevision.UNSPECIFIED_DATE) @@ -320,8 +320,7 @@ public class HorizontalNonAuditClassMapping extends AbstractHorizontalClassMappi } IIDHandler idHandler = getMappingStrategy().getStore().getIDHandler(); - IDBPreparedStatement stmt = accessor.getDBConnection().prepareStatement(builder.toString(), - ReuseProbability.MEDIUM); + IDBPreparedStatement stmt = accessor.getDBConnection().prepareStatement(builder.toString(), ReuseProbability.MEDIUM); try { @@ -361,8 +360,7 @@ public class HorizontalNonAuditClassMapping extends AbstractHorizontalClassMappi DBStore store = (DBStore)getMappingStrategy().getStore(); IIDHandler idHandler = store.getIDHandler(); IDBPreparedStatement stmtVersion = null; - IDBPreparedStatement stmtAttributes = accessor.getDBConnection().prepareStatement(sqlSelectCurrentAttributes, - ReuseProbability.HIGH); + IDBPreparedStatement stmtAttributes = accessor.getDBConnection().prepareStatement(sqlSelectCurrentAttributes, ReuseProbability.HIGH); try { @@ -449,8 +447,7 @@ public class HorizontalNonAuditClassMapping extends AbstractHorizontalClassMappi } @Override - protected void detachAttributes(IDBStoreAccessor accessor, CDOID id, int version, CDOBranch branch, long timeStamp, - OMMonitor monitor) + protected void detachAttributes(IDBStoreAccessor accessor, CDOID id, int version, CDOBranch branch, long timeStamp, OMMonitor monitor) { rawDelete(accessor, id, version, branch, monitor); @@ -459,8 +456,7 @@ public class HorizontalNonAuditClassMapping extends AbstractHorizontalClassMappi } @Override - protected void rawDeleteAttributes(IDBStoreAccessor accessor, CDOID id, CDOBranch branch, int version, - OMMonitor monitor) + protected void rawDeleteAttributes(IDBStoreAccessor accessor, CDOID id, CDOBranch branch, int version, OMMonitor monitor) { IIDHandler idHandler = getMappingStrategy().getStore().getIDHandler(); IDBPreparedStatement stmt = accessor.getDBConnection().prepareStatement(sqlDelete, ReuseProbability.HIGH); @@ -480,8 +476,7 @@ public class HorizontalNonAuditClassMapping extends AbstractHorizontalClassMappi } } - public void writeRevisionDelta(IDBStoreAccessor accessor, InternalCDORevisionDelta delta, long created, - OMMonitor monitor) + public void writeRevisionDelta(IDBStoreAccessor accessor, InternalCDORevisionDelta delta, long created, OMMonitor monitor) { Async async = null; monitor.begin(); @@ -719,8 +714,7 @@ public class HorizontalNonAuditClassMapping extends AbstractHorizontalClassMappi return builder.toString(); } - private int setUpdateAttributeValues(List<Pair<ITypeMapping, Object>> attributeChanges, IDBPreparedStatement stmt, - int col) throws SQLException + private int setUpdateAttributeValues(List<Pair<ITypeMapping, Object>> attributeChanges, IDBPreparedStatement stmt, int col) throws SQLException { for (Pair<ITypeMapping, Object> change : attributeChanges) { @@ -751,8 +745,7 @@ public class HorizontalNonAuditClassMapping extends AbstractHorizontalClassMappi return col; } - private int setUpdateListSizeChanges(List<Pair<EStructuralFeature, Integer>> attributeChanges, - IDBPreparedStatement stmt, int col) throws SQLException + private int setUpdateListSizeChanges(List<Pair<EStructuralFeature, Integer>> attributeChanges, IDBPreparedStatement stmt, int col) throws SQLException { for (Pair<EStructuralFeature, Integer> change : listSizeChanges) { diff --git a/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/mapping/horizontal/NonAuditFeatureMapTableMapping.java b/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/mapping/horizontal/NonAuditFeatureMapTableMapping.java index 8c340622a1..546176c59b 100644 --- a/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/mapping/horizontal/NonAuditFeatureMapTableMapping.java +++ b/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/mapping/horizontal/NonAuditFeatureMapTableMapping.java @@ -382,8 +382,8 @@ public class NonAuditFeatureMapTableMapping extends AbstractFeatureMapTableMappi private void move1down(IDBStoreAccessor accessor, CDOID id, int index, int upperIndex) { IIDHandler idHandler = getMappingStrategy().getStore().getIDHandler(); - IDBPreparedStatement stmt = accessor.getDBConnection() - .prepareStatement(upperIndex == UNBOUNDED_MOVE ? sqlMoveDown : sqlMoveDownWithLimit, ReuseProbability.HIGH); + IDBPreparedStatement stmt = accessor.getDBConnection().prepareStatement(upperIndex == UNBOUNDED_MOVE ? sqlMoveDown : sqlMoveDownWithLimit, + ReuseProbability.HIGH); try { @@ -413,8 +413,8 @@ public class NonAuditFeatureMapTableMapping extends AbstractFeatureMapTableMappi private void move1up(IDBStoreAccessor accessor, CDOID id, int index, int upperIndex) { IIDHandler idHandler = getMappingStrategy().getStore().getIDHandler(); - IDBPreparedStatement stmt = accessor.getDBConnection() - .prepareStatement(upperIndex == UNBOUNDED_MOVE ? sqlMoveUp : sqlMoveUpWithLimit, ReuseProbability.HIGH); + IDBPreparedStatement stmt = accessor.getDBConnection().prepareStatement(upperIndex == UNBOUNDED_MOVE ? sqlMoveUp : sqlMoveUpWithLimit, + ReuseProbability.HIGH); try { @@ -512,8 +512,8 @@ public class NonAuditFeatureMapTableMapping extends AbstractFeatureMapTableMappi } } - public void processDelta(final IDBStoreAccessor accessor, final CDOID id, final int branchId, int oldVersion, - final int newVersion, final long created, CDOListFeatureDelta listDelta) + public void processDelta(final IDBStoreAccessor accessor, final CDOID id, final int branchId, int oldVersion, final int newVersion, final long created, + CDOListFeatureDelta listDelta) { CDOFeatureDeltaVisitor visitor = new CDOFeatureDeltaVisitor() { 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 e1e0f76ce9..6ea798e995 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 @@ -188,8 +188,7 @@ public class NonAuditListTableMapping extends AbstractListTableMapping implement } @Override - public void addRangedChunkWhere(IDBStoreAccessor accessor, CDOID cdoid, StringBuilder builder, int fromIndex, - int toIndex) + public void addRangedChunkWhere(IDBStoreAccessor accessor, CDOID cdoid, StringBuilder builder, int fromIndex, int toIndex) { int offset = getCurrentIndexOffset(accessor, cdoid); super.addRangedChunkWhere(accessor, cdoid, builder, fromIndex + offset, toIndex + offset); @@ -250,8 +249,7 @@ public class NonAuditListTableMapping extends AbstractListTableMapping implement public int getCurrentIndexOffset(IDBStoreAccessor accessor, CDOID id) { IIDHandler idHandler = getMappingStrategy().getStore().getIDHandler(); - IDBPreparedStatement stmt = accessor.getDBConnection().prepareStatement(sqlReadCurrentIndexOffset, - ReuseProbability.HIGH); + IDBPreparedStatement stmt = accessor.getDBConnection().prepareStatement(sqlReadCurrentIndexOffset, ReuseProbability.HIGH); ResultSet rset = null; try @@ -278,8 +276,8 @@ public class NonAuditListTableMapping extends AbstractListTableMapping implement } } - public void processDelta(final IDBStoreAccessor accessor, final CDOID id, int branchId, int oldVersion, - final int newVersion, long created, CDOListFeatureDelta delta) + public void processDelta(final IDBStoreAccessor accessor, final CDOID id, int branchId, int oldVersion, final int newVersion, long created, + CDOListFeatureDelta delta) { int oldListSize = delta.getOriginSize(); @@ -1189,8 +1187,7 @@ public class NonAuditListTableMapping extends AbstractListTableMapping implement @Override public String toString() { - return MessageFormat.format( - "Manipulation[type={0}, sourceIndex={1}, tempIndex={2}, destinationIndex={3}, value={4}]", formatType(type), + return MessageFormat.format("Manipulation[type={0}, sourceIndex={1}, tempIndex={2}, destinationIndex={3}, value={4}]", formatType(type), formatIndex(sourceIndex), formatIndex(tempIndex), formatIndex(destinationIndex), formatValue(value)); } diff --git a/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/mapping/horizontal/ObjectTypeTable.java b/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/mapping/horizontal/ObjectTypeTable.java index d25b197739..b91dca65e4 100644 --- a/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/mapping/horizontal/ObjectTypeTable.java +++ b/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/mapping/horizontal/ObjectTypeTable.java @@ -197,8 +197,7 @@ public class ObjectTypeTable extends AbstractObjectTypeMapper implements IMappin } } - public void rawExport(Connection connection, CDODataOutput out, long fromCommitTime, long toCommitTime) - throws IOException + public void rawExport(Connection connection, CDODataOutput out, long fromCommitTime, long toCommitTime) throws IOException { String where = " WHERE " + ATTRIBUTES_CREATED + " BETWEEN " + fromCommitTime + " AND " + toCommitTime; DBUtil.serializeTable(out, connection, table, null, where); @@ -242,8 +241,7 @@ public class ObjectTypeTable extends AbstractObjectTypeMapper implements IMappin } sqlSelect = "SELECT " + ATTRIBUTES_CLASS + " FROM " + table + " WHERE " + ATTRIBUTES_ID + "=?"; - sqlInsert = "INSERT INTO " + table + "(" + ATTRIBUTES_ID + "," + ATTRIBUTES_CLASS + "," + ATTRIBUTES_CREATED - + ") VALUES (?, ?, ?)"; + sqlInsert = "INSERT INTO " + table + "(" + ATTRIBUTES_ID + "," + ATTRIBUTES_CLASS + "," + ATTRIBUTES_CREATED + ") VALUES (?, ?, ?)"; sqlDelete = "DELETE FROM " + table + " WHERE " + ATTRIBUTES_ID + "=?"; } diff --git a/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/mapping/horizontal/UnitMappingTable.java b/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/mapping/horizontal/UnitMappingTable.java index 48735012df..1f2e956bdb 100644 --- a/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/mapping/horizontal/UnitMappingTable.java +++ b/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/mapping/horizontal/UnitMappingTable.java @@ -70,15 +70,13 @@ public class UnitMappingTable extends Lifecycle implements IMappingConstants private static final String SQL_SELECT_ROOTS = "SELECT DISTINCT " + UNITS_UNIT + " FROM " + UNITS; - private static final String SQL_INSERT_MAPPINGS = "INSERT INTO " + UNITS + " (" + UNITS_ELEM + ", " + UNITS_UNIT - + ") VALUES (?, ?)"; + private static final String SQL_INSERT_MAPPINGS = "INSERT INTO " + UNITS + " (" + UNITS_ELEM + ", " + UNITS_UNIT + ") VALUES (?, ?)"; // private static final String SQL_SELECT_SIZE = "SELECT COUNT(" + UNITS_ELEM + ") FROM " + UNITS + " WHERE " // + UNITS_UNIT + "=?"; - private static final String SQL_SELECT_CLASSES = "SELECT " + ATTRIBUTES_CLASS + ", COUNT(" + UNITS_ELEM + ") FROM " - + UNITS + ", " + CDODBSchema.CDO_OBJECTS + " WHERE " + UNITS_ELEM + "=" + ATTRIBUTES_ID + " AND " + UNITS_UNIT - + "=? GROUP BY " + ATTRIBUTES_CLASS; + private static final String SQL_SELECT_CLASSES = "SELECT " + ATTRIBUTES_CLASS + ", COUNT(" + UNITS_ELEM + ") FROM " + UNITS + ", " + CDODBSchema.CDO_OBJECTS + + " WHERE " + UNITS_ELEM + "=" + ATTRIBUTES_ID + " AND " + UNITS_UNIT + "=? GROUP BY " + ATTRIBUTES_CLASS; private static final int WRITE_UNIT_MAPPING_BATCH_SIZE = 100000; @@ -125,8 +123,7 @@ public class UnitMappingTable extends Lifecycle implements IMappingConstants return rootIDs; } - public void readUnitRevisions(IDBStoreAccessor accessor, IView view, CDOID rootID, CDORevisionHandler revisionHandler, - OMMonitor monitor) + public void readUnitRevisions(IDBStoreAccessor accessor, IView view, CDOID rootID, CDORevisionHandler revisionHandler, OMMonitor monitor) { IDBStore store = mappingStrategy.getStore(); IIDHandler idHandler = store.getIDHandler(); @@ -180,13 +177,12 @@ public class UnitMappingTable extends Lifecycle implements IMappingConstants } } - public BatchedStatement initUnit(IDBStoreAccessor accessor, long timeStamp, IView view, CDOID rootID, - CDORevisionHandler revisionHandler, Set<CDOID> initializedIDs, OMMonitor monitor) + public BatchedStatement initUnit(IDBStoreAccessor accessor, long timeStamp, IView view, CDOID rootID, CDORevisionHandler revisionHandler, + Set<CDOID> initializedIDs, OMMonitor monitor) { IIDHandler idHandler = mappingStrategy.getStore().getIDHandler(); IDBConnection connection = accessor.getDBConnection(); - BatchedStatement stmt = DBUtil.batched(connection.prepareStatement(SQL_INSERT_MAPPINGS, ReuseProbability.HIGH), - WRITE_UNIT_MAPPING_BATCH_SIZE); + BatchedStatement stmt = DBUtil.batched(connection.prepareStatement(SQL_INSERT_MAPPINGS, ReuseProbability.HIGH), WRITE_UNIT_MAPPING_BATCH_SIZE); try { @@ -205,9 +201,8 @@ public class UnitMappingTable extends Lifecycle implements IMappingConstants } } - private void initUnit(BatchedStatement stmt, IView view, CDOID rootID, CDORevisionHandler revisionHandler, - Set<CDOID> initializedIDs, long timeStamp, IIDHandler idHandler, CDORevision revision, OMMonitor monitor) - throws SQLException + private void initUnit(BatchedStatement stmt, IView view, CDOID rootID, CDORevisionHandler revisionHandler, Set<CDOID> initializedIDs, long timeStamp, + IIDHandler idHandler, CDORevision revision, OMMonitor monitor) throws SQLException { revisionHandler.handleRevision(revision); @@ -262,8 +257,7 @@ public class UnitMappingTable extends Lifecycle implements IMappingConstants { IIDHandler idHandler = mappingStrategy.getStore().getIDHandler(); IDBConnection connection = accessor.getDBConnection(); - BatchedStatement stmt = DBUtil.batched(connection.prepareStatement(SQL_INSERT_MAPPINGS, ReuseProbability.HIGH), - WRITE_UNIT_MAPPING_BATCH_SIZE); + BatchedStatement stmt = DBUtil.batched(connection.prepareStatement(SQL_INSERT_MAPPINGS, ReuseProbability.HIGH), WRITE_UNIT_MAPPING_BATCH_SIZE); try { @@ -284,8 +278,7 @@ public class UnitMappingTable extends Lifecycle implements IMappingConstants } } - private void writeUnitMapping(BatchedStatement stmt, CDOID rootID, long timeStamp, IIDHandler idHandler, CDOID id) - throws SQLException + private void writeUnitMapping(BatchedStatement stmt, CDOID rootID, long timeStamp, IIDHandler idHandler, CDOID id) throws SQLException { idHandler.setCDOID(stmt, 1, id); idHandler.setCDOID(stmt, 2, rootID); |