Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEike Stepper2012-10-30 06:04:11 +0000
committerEike Stepper2012-10-30 06:04:11 +0000
commitdba1cf4ec4f47020d1354297b57ba2617729790c (patch)
treef2d9e35f797527981e068bdfb3eadcbefbd56007 /plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf
parentd3fd5cce836a3542504238bf953d53c554b0c52d (diff)
downloadcdo-dba1cf4ec4f47020d1354297b57ba2617729790c.tar.gz
cdo-dba1cf4ec4f47020d1354297b57ba2617729790c.tar.xz
cdo-dba1cf4ec4f47020d1354297b57ba2617729790c.zip
[393111] [DB] Oracle SQL doesn't allow "AS" keyword for table alias
https://bugs.eclipse.org/bugs/show_bug.cgi?id=393111
Diffstat (limited to 'plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf')
-rw-r--r--plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/mapping/horizontal/AbstractHorizontalMappingStrategy.java16
-rw-r--r--plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/mapping/horizontal/AbstractListTableMapping.java14
-rw-r--r--plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/mapping/horizontal/AuditListTableMappingWithRanges.java15
-rw-r--r--plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/mapping/horizontal/BranchingListTableMappingWithRanges.java14
4 files changed, 30 insertions, 29 deletions
diff --git a/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/mapping/horizontal/AbstractHorizontalMappingStrategy.java b/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/mapping/horizontal/AbstractHorizontalMappingStrategy.java
index 6c220e0511..5c053c6c80 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
@@ -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);
}
}
@@ -453,12 +453,12 @@ public abstract class AbstractHorizontalMappingStrategy extends AbstractMappingS
String dbName = getStore().getRepository().getName();
- final String prefix = "SELECT MIN(t." + CDODBSchema.ATTRIBUTES_ID + ") FROM " + dbName + "."
- + CDODBSchema.CDO_OBJECTS + " AS o, " + dbName + ".";
+ final String prefix = "SELECT MIN(\"t\"." + CDODBSchema.ATTRIBUTES_ID + ") FROM " + dbName + "."
+ + CDODBSchema.CDO_OBJECTS + " \"o\", " + dbName + ".";
- final String suffix = " AS t WHERE t." + CDODBSchema.ATTRIBUTES_BRANCH + "<0 AND t." + CDODBSchema.ATTRIBUTES_ID
- + "=o." + CDODBSchema.ATTRIBUTES_ID + " AND t." + CDODBSchema.ATTRIBUTES_CREATED + "=o."
- + CDODBSchema.ATTRIBUTES_CREATED;
+ 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 a979c05a9f..6474201855 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(" AS l_t, ");//$NON-NLS-1$
+ builder.append(" \"l_t\", ");//$NON-NLS-1$
builder.append(mainTableName);
- builder.append(" AS 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 a1470fb530..7c547c8dc2 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,22 @@ 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(" AS l_t, ");//$NON-NLS-1$
+ builder.append(" \"l_t\", ");//$NON-NLS-1$
builder.append(mainTableName);
- builder.append(" AS 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\".");//$NON-NLS-1$
+ builder.append(mainTableWhere);
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/BranchingListTableMappingWithRanges.java b/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/mapping/horizontal/BranchingListTableMappingWithRanges.java
index 80a3e3a1ad..32320da6d0 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
@@ -1391,21 +1391,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(" AS l_t, ");//$NON-NLS-1$
+ builder.append(" \"l_t\", ");//$NON-NLS-1$
builder.append(mainTableName);
- builder.append(" AS 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);

Back to the top