diff options
author | Andre Dietisheim | 2009-06-20 13:46:41 +0000 |
---|---|---|
committer | Andre Dietisheim | 2009-06-20 13:46:41 +0000 |
commit | 6b243611ce24466ed4aa618c21a655b3973ecc33 (patch) | |
tree | 7f8aeefa323989493a67b5634fd08ee98e93f43c /plugins/org.eclipse.emf.cdo.common.db | |
parent | cda384e8e4537d83060df7cf24559561acc4507c (diff) | |
download | cdo-6b243611ce24466ed4aa618c21a655b3973ecc33.tar.gz cdo-6b243611ce24466ed4aa618c21a655b3973ecc33.tar.xz cdo-6b243611ce24466ed4aa618c21a655b3973ecc33.zip |
apidoc cleanup
Diffstat (limited to 'plugins/org.eclipse.emf.cdo.common.db')
3 files changed, 9 insertions, 105 deletions
diff --git a/plugins/org.eclipse.emf.cdo.common.db/src/org/eclipse/emf/cdo/common/internal/db/AbstractPreparedStatementFactory.java b/plugins/org.eclipse.emf.cdo.common.db/src/org/eclipse/emf/cdo/common/internal/db/AbstractPreparedStatementFactory.java deleted file mode 100644 index 41f4ccf4e3..0000000000 --- a/plugins/org.eclipse.emf.cdo.common.db/src/org/eclipse/emf/cdo/common/internal/db/AbstractPreparedStatementFactory.java +++ /dev/null @@ -1,73 +0,0 @@ -/*************************************************************************** - * Copyright (c) 2004 - 2009 Eike Stepper (Berlin, Germany) and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Andre Dietisheim - initial API and implementation - * Eike Stepper - maintenance - **************************************************************************/ -package org.eclipse.emf.cdo.common.internal.db; - -import org.eclipse.emf.cdo.common.internal.db.bundle.OM; -import org.eclipse.emf.cdo.spi.common.revision.InternalCDORevision; - -import org.eclipse.net4j.db.DBUtil; -import org.eclipse.net4j.util.CheckUtil; -import org.eclipse.net4j.util.om.trace.ContextTracer; - -import java.sql.Connection; -import java.sql.PreparedStatement; -import java.sql.SQLException; - -/** - * @author Andre Dietisheim - */ -public abstract class AbstractPreparedStatementFactory implements IPreparedStatementFactory -{ - private static final ContextTracer TRACER = new ContextTracer(OM.DEBUG, AbstractPreparedStatementFactory.class); - - private PreparedStatement preparedStatement; - - public AbstractPreparedStatementFactory() - { - } - - public PreparedStatement getPreparedStatement(InternalCDORevision revision, Connection connection) throws Exception - { - PreparedStatement preparedStatement = getPreparedStatement(connection); - setParameters(revision, preparedStatement); - TRACER.trace(getSQL()); - return preparedStatement; - } - - public void close() - { - DBUtil.close(preparedStatement); - } - - protected synchronized PreparedStatement getPreparedStatement(Connection connection) throws SQLException - { - if (preparedStatement == null) - { - preparedStatement = createPreparedStatement(getSQL(), connection); - } - else - { - CheckUtil.checkArg(preparedStatement.getConnection() == connection, "Wrong connection"); - } - - return preparedStatement; - } - - protected abstract String getSQL(); - - protected abstract void setParameters(InternalCDORevision revision, PreparedStatement statement) throws Exception; - - private PreparedStatement createPreparedStatement(String sql, Connection connection) throws SQLException - { - return connection.prepareStatement(sql); - } -} diff --git a/plugins/org.eclipse.emf.cdo.common.db/src/org/eclipse/emf/cdo/common/internal/db/IPreparedStatementFactory.java b/plugins/org.eclipse.emf.cdo.common.db/src/org/eclipse/emf/cdo/common/internal/db/IPreparedStatementFactory.java deleted file mode 100644 index 47fe35c87a..0000000000 --- a/plugins/org.eclipse.emf.cdo.common.db/src/org/eclipse/emf/cdo/common/internal/db/IPreparedStatementFactory.java +++ /dev/null @@ -1,27 +0,0 @@ -/*************************************************************************** - * Copyright (c) 2004 - 2009 Eike Stepper (Berlin, Germany) and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Andre Dietisheim - initial API and implementation - * Eike Stepper - maintenance - **************************************************************************/ -package org.eclipse.emf.cdo.common.internal.db; - -import org.eclipse.emf.cdo.spi.common.revision.InternalCDORevision; - -import java.sql.Connection; -import java.sql.PreparedStatement; - -/** - * @author Andre Dietisheim - */ -public interface IPreparedStatementFactory -{ - public PreparedStatement getPreparedStatement(InternalCDORevision revision, Connection connection) throws Exception; - - public void close(); -} diff --git a/plugins/org.eclipse.emf.cdo.common.db/src/org/eclipse/emf/cdo/common/internal/db/cache/DBRevisionCache.java b/plugins/org.eclipse.emf.cdo.common.db/src/org/eclipse/emf/cdo/common/internal/db/cache/DBRevisionCache.java index 6a64d9eb9b..f237c027c6 100644 --- a/plugins/org.eclipse.emf.cdo.common.db/src/org/eclipse/emf/cdo/common/internal/db/cache/DBRevisionCache.java +++ b/plugins/org.eclipse.emf.cdo.common.db/src/org/eclipse/emf/cdo/common/internal/db/cache/DBRevisionCache.java @@ -153,8 +153,6 @@ public class DBRevisionCache extends Lifecycle implements CDORevisionCache /** * Gets the {@link CDOID} of a resource within this cache. The resource is picked if it matches the given folderID, * name and timestamp - * <p> - * TODO Use prepared statement! * * @param folderID * the folder id @@ -227,7 +225,7 @@ public class DBRevisionCache extends Lifecycle implements CDORevisionCache } /** - * Gets the revision with the highest version for a given {@link CDOID}. TODO Use prepared statement! + * Gets the revision with the highest version for a given {@link CDOID}. * * @param id * the id to match @@ -293,7 +291,7 @@ public class DBRevisionCache extends Lifecycle implements CDORevisionCache /** * Gets an {@link InternalCDORevision} that matches the given timestamp (it is >= created timestamp AND <= revised - * timestamp of the revision). TODO Use prepared statement! + * timestamp of the revision). * * @param id * the id @@ -355,7 +353,13 @@ public class DBRevisionCache extends Lifecycle implements CDORevisionCache } /** - * TODO Use prepared statement! + * Gets a {@link InternalCDORevision} by a given id and version. + * + * @param id + * the id to match the revision against + * @param version + * the version to match the revision against + * @return the revision by version */ public InternalCDORevision getRevisionByVersion(final CDOID id, final int version) { |