diff options
author | Eike Stepper | 2012-11-16 08:01:18 +0000 |
---|---|---|
committer | Eike Stepper | 2012-11-16 08:01:18 +0000 |
commit | 224519d27971545c15ad050aa8a1aee382e3c00b (patch) | |
tree | 607e3a1c14c8618e9498497ac1bacf7f6e606550 | |
parent | 1b73d8be682c402c31ab52fe56305b43ac44bdc6 (diff) | |
download | cdo-224519d27971545c15ad050aa8a1aee382e3c00b.tar.gz cdo-224519d27971545c15ad050aa8a1aee382e3c00b.tar.xz cdo-224519d27971545c15ad050aa8a1aee382e3c00b.zip |
[393111] [DB] Oracle SQL doesn't allow "AS" keyword for table alias
https://bugs.eclipse.org/bugs/show_bug.cgi?id=393111
5 files changed, 33 insertions, 33 deletions
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 2eb77d09e1..2e84b7ad9b 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 @@ -259,7 +259,7 @@ public class DBStoreAccessor extends StoreAccessor implements IDBStoreAccessor, TRACER.format("Selecting revision {0} from {1}", id, branchVersion); //$NON-NLS-1$ } - // if audit support is present, just use the audit method + // If audit support is present, just use the audit method success = ((IClassMappingAuditSupport)mapping).readRevisionByVersion(this, revision, listChunk); if (success && revision.getVersion() < CDOBranchVersion.FIRST_VERSION - 1) { @@ -271,7 +271,7 @@ public class DBStoreAccessor extends StoreAccessor implements IDBStoreAccessor, } else { - // if audit support is not present, we still have to provide a method + // If audit support is not present, we still have to provide a method // to readRevisionByVersion because TransactionCommitContext.computeDirtyObject // needs to lookup the base revision for a change. Hence we emulate this // behavior by getting the current revision and asserting that the version 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 6a1d3fa791..d148138d94 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 @@ -165,7 +165,7 @@ public abstract class AbstractHorizontalMappingStrategy extends AbstractMappingS long fromCommitTime, long toCommitTime) throws IOException { StringBuilder builder = new StringBuilder(); - builder.append(" WHERE \"a_t\"."); //$NON-NLS-1$ + builder.append(" WHERE a_t."); //$NON-NLS-1$ builder.append(CDODBSchema.ATTRIBUTES_CREATED); builder.append(" BETWEEN "); //$NON-NLS-1$ builder.append(fromCommitTime); @@ -184,7 +184,7 @@ public abstract class AbstractHorizontalMappingStrategy extends AbstractMappingS out.writeCDOClassifierRef(eClass); IDBTable table = classMapping.getDBTables().get(0); - DBUtil.serializeTable(out, connection, table, "\"a_t\"", attrSuffix); + DBUtil.serializeTable(out, connection, table, "a_t", attrSuffix); for (IListMapping listMapping : classMapping.getListMappings()) { @@ -200,14 +200,14 @@ public abstract class AbstractHorizontalMappingStrategy extends AbstractMappingS { for (IDBTable table : listMapping.getDBTables()) { - String listSuffix = ", " + attrTable + " \"a_t\"" + attrSuffix; - String listJoin = getListJoinForRawExport("\"a_t\"", "\"l_t\""); + String listSuffix = ", " + attrTable + " a_t" + attrSuffix; + String listJoin = getListJoinForRawExport("a_t", "l_t"); if (listJoin != null) { listSuffix += listJoin; } - DBUtil.serializeTable(out, connection, table, "\"l_t\"", listSuffix); + DBUtil.serializeTable(out, connection, table, "l_t", listSuffix); } } @@ -451,12 +451,12 @@ public abstract class AbstractHorizontalMappingStrategy extends AbstractMappingS final IIDHandler idHandler = getStore().getIDHandler(); final CDOID[] min = { idHandler.getMaxCDOID() }; - final String prefix = "SELECT MIN(\"t\"." + CDODBSchema.ATTRIBUTES_ID + ") FROM " + CDODBSchema.CDO_OBJECTS - + " \"o\", "; + final String prefix = "SELECT MIN(t." + CDODBSchema.ATTRIBUTES_ID + ") FROM " + CDODBSchema.CDO_OBJECTS + + " o, "; - final String suffix = " \"t\" WHERE \"t\"." + CDODBSchema.ATTRIBUTES_BRANCH + "<0 AND \"t\"." - + CDODBSchema.ATTRIBUTES_ID + "=\"o\"." + CDODBSchema.ATTRIBUTES_ID + " AND \"t\"." - + CDODBSchema.ATTRIBUTES_CREATED + "=\"o\"." + CDODBSchema.ATTRIBUTES_CREATED; + final String suffix = " t WHERE t." + CDODBSchema.ATTRIBUTES_BRANCH + "<0 AND t." + + CDODBSchema.ATTRIBUTES_ID + "=o." + CDODBSchema.ATTRIBUTES_ID + " AND t." + + CDODBSchema.ATTRIBUTES_CREATED + "=o." + CDODBSchema.ATTRIBUTES_CREATED; 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 6474201855..0f3ff31c19 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 @@ -384,21 +384,21 @@ public abstract class AbstractListTableMapping extends BasicAbstractListTableMap QueryXRefsContext context, String idString) { String tableName = getTable().getName(); - String listJoin = getMappingStrategy().getListJoin("\"a_t\"", "\"l_t\""); + String listJoin = getMappingStrategy().getListJoin("a_t", "l_t"); StringBuilder builder = new StringBuilder(); - builder.append("SELECT \"l_t\"."); //$NON-NLS-1$ + builder.append("SELECT l_t."); //$NON-NLS-1$ builder.append(CDODBSchema.LIST_REVISION_ID); - builder.append(", \"l_t\"."); //$NON-NLS-1$ + builder.append(", l_t."); //$NON-NLS-1$ builder.append(CDODBSchema.LIST_VALUE); - builder.append(", \"l_t\"."); //$NON-NLS-1$ + builder.append(", l_t."); //$NON-NLS-1$ builder.append(CDODBSchema.LIST_IDX); builder.append(" FROM "); //$NON-NLS-1$ builder.append(tableName); - builder.append(" \"l_t\", ");//$NON-NLS-1$ + builder.append(" l_t, ");//$NON-NLS-1$ builder.append(mainTableName); - builder.append(" \"a_t\" WHERE ");//$NON-NLS-1$ - builder.append("\"a_t\"." + mainTableWhere);//$NON-NLS-1$ + builder.append(" a_t WHERE ");//$NON-NLS-1$ + builder.append("a_t." + mainTableWhere);//$NON-NLS-1$ builder.append(listJoin); builder.append(" AND "); //$NON-NLS-1$ builder.append(CDODBSchema.LIST_VALUE); 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 7c547c8dc2..0d679b4f30 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 @@ -1052,21 +1052,21 @@ public class AuditListTableMappingWithRanges extends BasicAbstractListTableMappi { String tableName = getTable().getName(); - String listJoin = getMappingStrategy().getListJoin("\"a_t\"", "\"l_t\""); + String listJoin = getMappingStrategy().getListJoin("a_t", "l_t"); StringBuilder builder = new StringBuilder(); - builder.append("SELECT \"l_t\"."); //$NON-NLS-1$ + builder.append("SELECT l_t."); //$NON-NLS-1$ builder.append(CDODBSchema.LIST_REVISION_ID); - builder.append(", \"l_t\"."); //$NON-NLS-1$ + builder.append(", l_t."); //$NON-NLS-1$ builder.append(CDODBSchema.LIST_VALUE); - builder.append(", \"l_t\"."); //$NON-NLS-1$ + builder.append(", l_t."); //$NON-NLS-1$ builder.append(CDODBSchema.LIST_IDX); builder.append(" FROM "); //$NON-NLS-1$ builder.append(tableName); - builder.append(" \"l_t\", ");//$NON-NLS-1$ + builder.append(" l_t, ");//$NON-NLS-1$ builder.append(mainTableName); - builder.append(" \"a_t\" WHERE ");//$NON-NLS-1$ - builder.append("\"a_t\".");//$NON-NLS-1$ + builder.append(" a_t WHERE ");//$NON-NLS-1$ + builder.append("a_t.");//$NON-NLS-1$ builder.append(mainTableWhere); builder.append(listJoin); builder.append(" AND "); //$NON-NLS-1$ 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 3b92ce2c1b..4a1901a848 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 @@ -1396,21 +1396,21 @@ public class BranchingListTableMappingWithRanges extends BasicAbstractListTableM { String tableName = getTable().getName(); - String listJoin = getMappingStrategy().getListJoin("\"a_t\"", "\"l_t\""); + String listJoin = getMappingStrategy().getListJoin("a_t", "l_t"); StringBuilder builder = new StringBuilder(); - builder.append("SELECT \"l_t\"."); //$NON-NLS-1$ + builder.append("SELECT l_t."); //$NON-NLS-1$ builder.append(CDODBSchema.LIST_REVISION_ID); - builder.append(", \"l_t\"."); //$NON-NLS-1$ + builder.append(", l_t."); //$NON-NLS-1$ builder.append(CDODBSchema.LIST_VALUE); - builder.append(", \"l_t\"."); //$NON-NLS-1$ + builder.append(", l_t."); //$NON-NLS-1$ builder.append(CDODBSchema.LIST_IDX); builder.append(" FROM "); //$NON-NLS-1$ builder.append(tableName); - builder.append(" \"l_t\", ");//$NON-NLS-1$ + builder.append(" l_t, ");//$NON-NLS-1$ builder.append(mainTableName); - builder.append(" \"a_t\" WHERE ");//$NON-NLS-1$ - builder.append("\"a_t\"." + mainTableWhere);//$NON-NLS-1$ + builder.append(" a_t WHERE ");//$NON-NLS-1$ + builder.append("a_t." + mainTableWhere);//$NON-NLS-1$ builder.append(listJoin); builder.append(" AND "); //$NON-NLS-1$ builder.append(CDODBSchema.LIST_VALUE); |