Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEike Stepper2013-03-10 03:54:00 -0400
committerEike Stepper2013-03-10 03:54:00 -0400
commitc7f0291806277ee4978c4445097e23bf7604b879 (patch)
tree6683f87a229e21e20c7f9376a0b0d9d7de634023
parent35f2316585607417e99e5dd5fe93541e1b9089d1 (diff)
downloadcdo-committers/estepper/net4j-db3.tar.gz
cdo-committers/estepper/net4j-db3.tar.xz
cdo-committers/estepper/net4j-db3.zip
[401763] Make CDO Server more robust against data dictionary changes committers/estepper/net4j-db3
https://bugs.eclipse.org/bugs/show_bug.cgi?id=401763
-rw-r--r--plugins/org.eclipse.net4j.db/src/org/eclipse/net4j/db/ddl/IDBSchemaElement.java5
-rw-r--r--plugins/org.eclipse.net4j.db/src/org/eclipse/net4j/db/ddl/delta/IDBDelta.java4
-rw-r--r--plugins/org.eclipse.net4j.db/src/org/eclipse/net4j/internal/db/ddl/DelegatingDBField.java213
-rw-r--r--plugins/org.eclipse.net4j.db/src/org/eclipse/net4j/internal/db/ddl/DelegatingDBIndex.java226
-rw-r--r--plugins/org.eclipse.net4j.db/src/org/eclipse/net4j/internal/db/ddl/DelegatingDBIndexField.java163
-rw-r--r--plugins/org.eclipse.net4j.db/src/org/eclipse/net4j/internal/db/ddl/DelegatingDBSchema.java259
-rw-r--r--plugins/org.eclipse.net4j.db/src/org/eclipse/net4j/internal/db/ddl/DelegatingDBSchemaElement.java21
-rw-r--r--plugins/org.eclipse.net4j.db/src/org/eclipse/net4j/internal/db/ddl/DelegatingDBTable.java281
8 files changed, 1165 insertions, 7 deletions
diff --git a/plugins/org.eclipse.net4j.db/src/org/eclipse/net4j/db/ddl/IDBSchemaElement.java b/plugins/org.eclipse.net4j.db/src/org/eclipse/net4j/db/ddl/IDBSchemaElement.java
index ac45e373ee..527cd9352d 100644
--- a/plugins/org.eclipse.net4j.db/src/org/eclipse/net4j/db/ddl/IDBSchemaElement.java
+++ b/plugins/org.eclipse.net4j.db/src/org/eclipse/net4j/db/ddl/IDBSchemaElement.java
@@ -12,8 +12,6 @@ package org.eclipse.net4j.db.ddl;
import org.eclipse.net4j.util.container.IContainer;
-import java.io.Serializable;
-
/**
* Specifies a hierachical namespace for elements in a {@link IDBSchema DB schema}.
*
@@ -21,8 +19,7 @@ import java.io.Serializable;
* @noimplement This interface is not intended to be implemented by clients.
* @noextend This interface is not intended to be extended by clients.
*/
-public interface IDBSchemaElement extends IDBNamedElement, IContainer<IDBSchemaElement>, Comparable<IDBSchemaElement>,
- Serializable
+public interface IDBSchemaElement extends IDBNamedElement, IContainer<IDBSchemaElement>, Comparable<IDBSchemaElement>
{
/**
* @since 4.2
diff --git a/plugins/org.eclipse.net4j.db/src/org/eclipse/net4j/db/ddl/delta/IDBDelta.java b/plugins/org.eclipse.net4j.db/src/org/eclipse/net4j/db/ddl/delta/IDBDelta.java
index 578946ab91..b8cb44251f 100644
--- a/plugins/org.eclipse.net4j.db/src/org/eclipse/net4j/db/ddl/delta/IDBDelta.java
+++ b/plugins/org.eclipse.net4j.db/src/org/eclipse/net4j/db/ddl/delta/IDBDelta.java
@@ -15,15 +15,13 @@ import org.eclipse.net4j.db.ddl.IDBSchema;
import org.eclipse.net4j.db.ddl.IDBSchemaElement;
import org.eclipse.net4j.util.container.IContainer;
-import java.io.Serializable;
-
/**
* @since 4.2
* @author Eike Stepper
* @noextend This interface is not intended to be extended by clients.
* @noimplement This interface is not intended to be implemented by clients.
*/
-public interface IDBDelta extends IDBNamedElement, IContainer<IDBDelta>, Comparable<IDBDelta>, Serializable
+public interface IDBDelta extends IDBNamedElement, IContainer<IDBDelta>, Comparable<IDBDelta>
{
public DeltaType getDeltaType();
diff --git a/plugins/org.eclipse.net4j.db/src/org/eclipse/net4j/internal/db/ddl/DelegatingDBField.java b/plugins/org.eclipse.net4j.db/src/org/eclipse/net4j/internal/db/ddl/DelegatingDBField.java
new file mode 100644
index 0000000000..a14a7b6dc5
--- /dev/null
+++ b/plugins/org.eclipse.net4j.db/src/org/eclipse/net4j/internal/db/ddl/DelegatingDBField.java
@@ -0,0 +1,213 @@
+/*
+ * Copyright (c) 2004 - 2012 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:
+ * Eike Stepper - initial API and implementation
+ */
+package org.eclipse.net4j.internal.db.ddl;
+
+import org.eclipse.net4j.db.DBType;
+import org.eclipse.net4j.db.ddl.IDBSchema;
+import org.eclipse.net4j.db.ddl.IDBSchemaElement;
+import org.eclipse.net4j.db.ddl.IDBSchemaVisitor;
+import org.eclipse.net4j.db.ddl.IDBTable;
+import org.eclipse.net4j.spi.db.ddl.InternalDBField;
+import org.eclipse.net4j.util.event.IListener;
+
+import java.io.IOException;
+import java.io.Writer;
+import java.util.Properties;
+
+/**
+ * @author Eike Stepper
+ */
+public class DelegatingDBField extends DelegatingDBSchemaElement implements InternalDBField
+{
+ private final InternalDBField delegate;
+
+ public DelegatingDBField(InternalDBField delegate)
+ {
+ this.delegate = delegate;
+ }
+
+ @Override
+ public InternalDBField getDelegate()
+ {
+ return delegate;
+ }
+
+ public int getPosition()
+ {
+ return delegate.getPosition();
+ }
+
+ public String getName()
+ {
+ return delegate.getName();
+ }
+
+ public void setPosition(int position)
+ {
+ delegate.setPosition(position);
+ }
+
+ public Properties getProperties()
+ {
+ return delegate.getProperties();
+ }
+
+ public Exception getConstructionStackTrace()
+ {
+ return delegate.getConstructionStackTrace();
+ }
+
+ public String dumpToString()
+ {
+ return delegate.dumpToString();
+ }
+
+ public SchemaElementType getSchemaElementType()
+ {
+ return delegate.getSchemaElementType();
+ }
+
+ public IDBTable getParent()
+ {
+ return delegate.getParent();
+ }
+
+ public void dump()
+ {
+ delegate.dump();
+ }
+
+ public void dump(Writer writer) throws IOException
+ {
+ delegate.dump(writer);
+ }
+
+ public IDBSchema getSchema()
+ {
+ return delegate.getSchema();
+ }
+
+ public IDBTable getTable()
+ {
+ return delegate.getTable();
+ }
+
+ public DBType getType()
+ {
+ return delegate.getType();
+ }
+
+ public boolean isEmpty()
+ {
+ return delegate.isEmpty();
+ }
+
+ public void setType(DBType type)
+ {
+ delegate.setType(type);
+ }
+
+ public void addListener(IListener listener)
+ {
+ delegate.addListener(listener);
+ }
+
+ public IDBSchemaElement[] getElements()
+ {
+ return delegate.getElements();
+ }
+
+ public int getPrecision()
+ {
+ return delegate.getPrecision();
+ }
+
+ @Deprecated
+ public void setName(String name)
+ {
+ delegate.setName(name);
+ }
+
+ public void setPrecision(int precision)
+ {
+ delegate.setPrecision(precision);
+ }
+
+ public int getScale()
+ {
+ return delegate.getScale();
+ }
+
+ public void setScale(int scale)
+ {
+ delegate.setScale(scale);
+ }
+
+ public <T extends IDBSchemaElement> T getElement(Class<T> type, String name)
+ {
+ return delegate.getElement(type, name);
+ }
+
+ public boolean isNotNull()
+ {
+ return delegate.isNotNull();
+ }
+
+ public void setNotNull(boolean notNull)
+ {
+ delegate.setNotNull(notNull);
+ }
+
+ public String getFullName()
+ {
+ return delegate.getFullName();
+ }
+
+ public void accept(IDBSchemaVisitor visitor)
+ {
+ delegate.accept(visitor);
+ }
+
+ public String formatPrecision()
+ {
+ return delegate.formatPrecision();
+ }
+
+ public String formatPrecisionAndScale()
+ {
+ return delegate.formatPrecisionAndScale();
+ }
+
+ public void removeListener(IListener listener)
+ {
+ delegate.removeListener(listener);
+ }
+
+ public void remove()
+ {
+ delegate.remove();
+ }
+
+ public boolean hasListeners()
+ {
+ return delegate.hasListeners();
+ }
+
+ public IListener[] getListeners()
+ {
+ return delegate.getListeners();
+ }
+
+ public int compareTo(IDBSchemaElement o)
+ {
+ return delegate.compareTo(o);
+ }
+}
diff --git a/plugins/org.eclipse.net4j.db/src/org/eclipse/net4j/internal/db/ddl/DelegatingDBIndex.java b/plugins/org.eclipse.net4j.db/src/org/eclipse/net4j/internal/db/ddl/DelegatingDBIndex.java
new file mode 100644
index 0000000000..82e796a139
--- /dev/null
+++ b/plugins/org.eclipse.net4j.db/src/org/eclipse/net4j/internal/db/ddl/DelegatingDBIndex.java
@@ -0,0 +1,226 @@
+/*
+ * Copyright (c) 2004 - 2012 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:
+ * Eike Stepper - initial API and implementation
+ */
+package org.eclipse.net4j.internal.db.ddl;
+
+import org.eclipse.net4j.db.ddl.IDBField;
+import org.eclipse.net4j.db.ddl.IDBIndexField;
+import org.eclipse.net4j.db.ddl.IDBSchema;
+import org.eclipse.net4j.db.ddl.IDBSchemaElement;
+import org.eclipse.net4j.db.ddl.IDBSchemaVisitor;
+import org.eclipse.net4j.db.ddl.IDBTable;
+import org.eclipse.net4j.db.ddl.SchemaElementNotFoundException;
+import org.eclipse.net4j.spi.db.ddl.InternalDBIndex;
+import org.eclipse.net4j.util.event.IListener;
+
+import java.io.IOException;
+import java.io.Writer;
+import java.util.Properties;
+
+/**
+ * @author Eike Stepper
+ */
+public class DelegatingDBIndex extends DelegatingDBSchemaElement implements InternalDBIndex
+{
+ private final InternalDBIndex delegate;
+
+ public DelegatingDBIndex(InternalDBIndex delegate)
+ {
+ this.delegate = delegate;
+ }
+
+ @Override
+ public InternalDBIndex getDelegate()
+ {
+ return delegate;
+ }
+
+ public String getName()
+ {
+ return delegate.getName();
+ }
+
+ public IDBTable getParent()
+ {
+ return delegate.getParent();
+ }
+
+ public Properties getProperties()
+ {
+ return delegate.getProperties();
+ }
+
+ public IDBTable getTable()
+ {
+ return delegate.getTable();
+ }
+
+ public Type getType()
+ {
+ return delegate.getType();
+ }
+
+ public void setType(Type type)
+ {
+ delegate.setType(type);
+ }
+
+ public String dumpToString()
+ {
+ return delegate.dumpToString();
+ }
+
+ public void removeIndexField(IDBIndexField indexFieldToRemove)
+ {
+ delegate.removeIndexField(indexFieldToRemove);
+ }
+
+ public SchemaElementType getSchemaElementType()
+ {
+ return delegate.getSchemaElementType();
+ }
+
+ public void dump()
+ {
+ delegate.dump();
+ }
+
+ public void dump(Writer writer) throws IOException
+ {
+ delegate.dump(writer);
+ }
+
+ @Deprecated
+ public int getPosition()
+ {
+ return delegate.getPosition();
+ }
+
+ public IDBSchema getSchema()
+ {
+ return delegate.getSchema();
+ }
+
+ public IDBIndexField addIndexField(IDBField field)
+ {
+ return delegate.addIndexField(field);
+ }
+
+ public boolean isEmpty()
+ {
+ return delegate.isEmpty();
+ }
+
+ public void addListener(IListener listener)
+ {
+ delegate.addListener(listener);
+ }
+
+ public IDBSchemaElement[] getElements()
+ {
+ return delegate.getElements();
+ }
+
+ public IDBIndexField addIndexField(String name) throws SchemaElementNotFoundException
+ {
+ return delegate.addIndexField(name);
+ }
+
+ @Deprecated
+ public void setName(String name)
+ {
+ delegate.setName(name);
+ }
+
+ public String getFullName()
+ {
+ return delegate.getFullName();
+ }
+
+ public IDBIndexField getIndexFieldSafe(String name) throws SchemaElementNotFoundException
+ {
+ return delegate.getIndexFieldSafe(name);
+ }
+
+ public <T extends IDBSchemaElement> T getElement(Class<T> type, String name)
+ {
+ return delegate.getElement(type, name);
+ }
+
+ public void accept(IDBSchemaVisitor visitor)
+ {
+ delegate.accept(visitor);
+ }
+
+ public IDBIndexField getIndexField(String name)
+ {
+ return delegate.getIndexField(name);
+ }
+
+ public void removeListener(IListener listener)
+ {
+ delegate.removeListener(listener);
+ }
+
+ public void remove()
+ {
+ delegate.remove();
+ }
+
+ public IDBIndexField getIndexField(int position)
+ {
+ return delegate.getIndexField(position);
+ }
+
+ public boolean hasListeners()
+ {
+ return delegate.hasListeners();
+ }
+
+ public IDBField getFieldSafe(String name) throws SchemaElementNotFoundException
+ {
+ return delegate.getFieldSafe(name);
+ }
+
+ public IDBField getField(String name)
+ {
+ return delegate.getField(name);
+ }
+
+ public IDBField getField(int position)
+ {
+ return delegate.getField(position);
+ }
+
+ public IListener[] getListeners()
+ {
+ return delegate.getListeners();
+ }
+
+ public int getFieldCount()
+ {
+ return delegate.getFieldCount();
+ }
+
+ public IDBIndexField[] getIndexFields()
+ {
+ return delegate.getIndexFields();
+ }
+
+ public IDBField[] getFields()
+ {
+ return delegate.getFields();
+ }
+
+ public int compareTo(IDBSchemaElement o)
+ {
+ return delegate.compareTo(o);
+ }
+}
diff --git a/plugins/org.eclipse.net4j.db/src/org/eclipse/net4j/internal/db/ddl/DelegatingDBIndexField.java b/plugins/org.eclipse.net4j.db/src/org/eclipse/net4j/internal/db/ddl/DelegatingDBIndexField.java
new file mode 100644
index 0000000000..6c241a2ed1
--- /dev/null
+++ b/plugins/org.eclipse.net4j.db/src/org/eclipse/net4j/internal/db/ddl/DelegatingDBIndexField.java
@@ -0,0 +1,163 @@
+/*
+ * Copyright (c) 2004 - 2012 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:
+ * Eike Stepper - initial API and implementation
+ */
+package org.eclipse.net4j.internal.db.ddl;
+
+import org.eclipse.net4j.db.ddl.IDBField;
+import org.eclipse.net4j.db.ddl.IDBIndex;
+import org.eclipse.net4j.db.ddl.IDBSchema;
+import org.eclipse.net4j.db.ddl.IDBSchemaElement;
+import org.eclipse.net4j.db.ddl.IDBSchemaVisitor;
+import org.eclipse.net4j.spi.db.ddl.InternalDBIndexField;
+import org.eclipse.net4j.util.event.IListener;
+
+import java.io.IOException;
+import java.io.Writer;
+import java.util.Properties;
+
+/**
+ * @author Eike Stepper
+ */
+public class DelegatingDBIndexField extends DelegatingDBSchemaElement implements InternalDBIndexField
+{
+ private final InternalDBIndexField delegate;
+
+ public DelegatingDBIndexField(InternalDBIndexField delegate)
+ {
+ this.delegate = delegate;
+ }
+
+ @Override
+ public InternalDBIndexField getDelegate()
+ {
+ return delegate;
+ }
+
+ public int getPosition()
+ {
+ return delegate.getPosition();
+ }
+
+ public String getName()
+ {
+ return delegate.getName();
+ }
+
+ public Properties getProperties()
+ {
+ return delegate.getProperties();
+ }
+
+ public void setPosition(int position)
+ {
+ delegate.setPosition(position);
+ }
+
+ public IDBIndex getParent()
+ {
+ return delegate.getParent();
+ }
+
+ public String dumpToString()
+ {
+ return delegate.dumpToString();
+ }
+
+ public SchemaElementType getSchemaElementType()
+ {
+ return delegate.getSchemaElementType();
+ }
+
+ public void dump()
+ {
+ delegate.dump();
+ }
+
+ public IDBIndex getIndex()
+ {
+ return delegate.getIndex();
+ }
+
+ public void dump(Writer writer) throws IOException
+ {
+ delegate.dump(writer);
+ }
+
+ public IDBField getField()
+ {
+ return delegate.getField();
+ }
+
+ public IDBSchema getSchema()
+ {
+ return delegate.getSchema();
+ }
+
+ public boolean isEmpty()
+ {
+ return delegate.isEmpty();
+ }
+
+ public void addListener(IListener listener)
+ {
+ delegate.addListener(listener);
+ }
+
+ public IDBSchemaElement[] getElements()
+ {
+ return delegate.getElements();
+ }
+
+ @Deprecated
+ public void setName(String name)
+ {
+ delegate.setName(name);
+ }
+
+ public String getFullName()
+ {
+ return delegate.getFullName();
+ }
+
+ public <T extends IDBSchemaElement> T getElement(Class<T> type, String name)
+ {
+ return delegate.getElement(type, name);
+ }
+
+ public void accept(IDBSchemaVisitor visitor)
+ {
+ delegate.accept(visitor);
+ }
+
+ public void removeListener(IListener listener)
+ {
+ delegate.removeListener(listener);
+ }
+
+ public void remove()
+ {
+ delegate.remove();
+ }
+
+ public boolean hasListeners()
+ {
+ return delegate.hasListeners();
+ }
+
+ public IListener[] getListeners()
+ {
+ return delegate.getListeners();
+ }
+
+ public int compareTo(IDBSchemaElement o)
+ {
+ return delegate.compareTo(o);
+ }
+}
diff --git a/plugins/org.eclipse.net4j.db/src/org/eclipse/net4j/internal/db/ddl/DelegatingDBSchema.java b/plugins/org.eclipse.net4j.db/src/org/eclipse/net4j/internal/db/ddl/DelegatingDBSchema.java
new file mode 100644
index 0000000000..6c64baeac7
--- /dev/null
+++ b/plugins/org.eclipse.net4j.db/src/org/eclipse/net4j/internal/db/ddl/DelegatingDBSchema.java
@@ -0,0 +1,259 @@
+/*
+ * Copyright (c) 2004 - 2012 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:
+ * Eike Stepper - initial API and implementation
+ */
+package org.eclipse.net4j.internal.db.ddl;
+
+import org.eclipse.net4j.db.DBException;
+import org.eclipse.net4j.db.IDBAdapter;
+import org.eclipse.net4j.db.IDBConnectionProvider;
+import org.eclipse.net4j.db.ddl.IDBField;
+import org.eclipse.net4j.db.ddl.IDBIndex.Type;
+import org.eclipse.net4j.db.ddl.IDBSchema;
+import org.eclipse.net4j.db.ddl.IDBSchemaElement;
+import org.eclipse.net4j.db.ddl.IDBSchemaVisitor;
+import org.eclipse.net4j.db.ddl.IDBTable;
+import org.eclipse.net4j.db.ddl.SchemaElementNotFoundException;
+import org.eclipse.net4j.db.ddl.delta.IDBSchemaDelta;
+import org.eclipse.net4j.spi.db.ddl.InternalDBSchema;
+import org.eclipse.net4j.util.event.IListener;
+
+import javax.sql.DataSource;
+
+import java.io.IOException;
+import java.io.PrintStream;
+import java.io.Writer;
+import java.sql.Connection;
+import java.util.Properties;
+import java.util.Set;
+
+/**
+ * @author Eike Stepper
+ */
+public class DelegatingDBSchema extends DelegatingDBSchemaElement implements InternalDBSchema
+{
+ private final InternalDBSchema delegate;
+
+ public DelegatingDBSchema(InternalDBSchema delegate)
+ {
+ this.delegate = delegate;
+ }
+
+ @Override
+ public InternalDBSchema getDelegate()
+ {
+ return delegate;
+ }
+
+ public String getName()
+ {
+ return delegate.getName();
+ }
+
+ public Properties getProperties()
+ {
+ return delegate.getProperties();
+ }
+
+ public String dumpToString()
+ {
+ return delegate.dumpToString();
+ }
+
+ public void dump()
+ {
+ delegate.dump();
+ }
+
+ public void dump(Writer writer) throws IOException
+ {
+ delegate.dump(writer);
+ }
+
+ public SchemaElementType getSchemaElementType()
+ {
+ return delegate.getSchemaElementType();
+ }
+
+ public IDBTable addTable(String name)
+ {
+ return delegate.addTable(name);
+ }
+
+ public IDBSchema getSchema()
+ {
+ return delegate.getSchema();
+ }
+
+ public boolean isEmpty()
+ {
+ return delegate.isEmpty();
+ }
+
+ public IDBTable removeTable(String name)
+ {
+ return delegate.removeTable(name);
+ }
+
+ public void addListener(IListener listener)
+ {
+ delegate.addListener(listener);
+ }
+
+ public IDBSchemaElement getParent()
+ {
+ return delegate.getParent();
+ }
+
+ public IDBSchemaElement[] getElements()
+ {
+ return delegate.getElements();
+ }
+
+ public String createIndexName(IDBTable table, Type type, IDBField[] fields, int position)
+ {
+ return delegate.createIndexName(table, type, fields, position);
+ }
+
+ @Deprecated
+ public void setName(String name)
+ {
+ delegate.setName(name);
+ }
+
+ public boolean isLocked()
+ {
+ return delegate.isLocked();
+ }
+
+ public boolean lock()
+ {
+ return delegate.lock();
+ }
+
+ public <T extends IDBSchemaElement> T findElement(IDBSchemaElement prototype)
+ {
+ return delegate.findElement(prototype);
+ }
+
+ public boolean unlock()
+ {
+ return delegate.unlock();
+ }
+
+ public String getFullName()
+ {
+ return delegate.getFullName();
+ }
+
+ public void assertUnlocked() throws DBException
+ {
+ delegate.assertUnlocked();
+ }
+
+ public <T extends IDBSchemaElement> T getElement(Class<T> type, String name)
+ {
+ return delegate.getElement(type, name);
+ }
+
+ public void accept(IDBSchemaVisitor visitor)
+ {
+ delegate.accept(visitor);
+ }
+
+ public void removeListener(IListener listener)
+ {
+ delegate.removeListener(listener);
+ }
+
+ public void remove()
+ {
+ delegate.remove();
+ }
+
+ public IDBTable getTableSafe(String name) throws SchemaElementNotFoundException
+ {
+ return delegate.getTableSafe(name);
+ }
+
+ public boolean hasListeners()
+ {
+ return delegate.hasListeners();
+ }
+
+ public IDBTable getTable(String name)
+ {
+ return delegate.getTable(name);
+ }
+
+ public IDBTable[] getTables()
+ {
+ return delegate.getTables();
+ }
+
+ public Set<IDBTable> create(IDBAdapter dbAdapter, Connection connection) throws DBException
+ {
+ return delegate.create(dbAdapter, connection);
+ }
+
+ public IListener[] getListeners()
+ {
+ return delegate.getListeners();
+ }
+
+ public Set<IDBTable> create(IDBAdapter dbAdapter, DataSource dataSource) throws DBException
+ {
+ return delegate.create(dbAdapter, dataSource);
+ }
+
+ public Set<IDBTable> create(IDBAdapter dbAdapter, IDBConnectionProvider connectionProvider) throws DBException
+ {
+ return delegate.create(dbAdapter, connectionProvider);
+ }
+
+ public void drop(IDBAdapter dbAdapter, Connection connection) throws DBException
+ {
+ delegate.drop(dbAdapter, connection);
+ }
+
+ public void drop(IDBAdapter dbAdapter, DataSource dataSource) throws DBException
+ {
+ delegate.drop(dbAdapter, dataSource);
+ }
+
+ public void drop(IDBAdapter dbAdapter, IDBConnectionProvider connectionProvider) throws DBException
+ {
+ delegate.drop(dbAdapter, connectionProvider);
+ }
+
+ public void export(Connection connection, PrintStream out) throws DBException
+ {
+ delegate.export(connection, out);
+ }
+
+ public void export(DataSource dataSource, PrintStream out) throws DBException
+ {
+ delegate.export(dataSource, out);
+ }
+
+ public void export(IDBConnectionProvider connectionProvider, PrintStream out) throws DBException
+ {
+ delegate.export(connectionProvider, out);
+ }
+
+ public IDBSchemaDelta compare(IDBSchema oldSchema)
+ {
+ return delegate.compare(oldSchema);
+ }
+
+ public int compareTo(IDBSchemaElement o)
+ {
+ return delegate.compareTo(o);
+ }
+}
diff --git a/plugins/org.eclipse.net4j.db/src/org/eclipse/net4j/internal/db/ddl/DelegatingDBSchemaElement.java b/plugins/org.eclipse.net4j.db/src/org/eclipse/net4j/internal/db/ddl/DelegatingDBSchemaElement.java
new file mode 100644
index 0000000000..e3475565ea
--- /dev/null
+++ b/plugins/org.eclipse.net4j.db/src/org/eclipse/net4j/internal/db/ddl/DelegatingDBSchemaElement.java
@@ -0,0 +1,21 @@
+/*
+ * Copyright (c) 2004 - 2012 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:
+ * Eike Stepper - initial API and implementation
+ */
+package org.eclipse.net4j.internal.db.ddl;
+
+import org.eclipse.net4j.spi.db.ddl.InternalDBSchemaElement;
+
+/**
+ * @author Eike Stepper
+ */
+public abstract class DelegatingDBSchemaElement implements InternalDBSchemaElement
+{
+ public abstract InternalDBSchemaElement getDelegate();
+}
diff --git a/plugins/org.eclipse.net4j.db/src/org/eclipse/net4j/internal/db/ddl/DelegatingDBTable.java b/plugins/org.eclipse.net4j.db/src/org/eclipse/net4j/internal/db/ddl/DelegatingDBTable.java
new file mode 100644
index 0000000000..202051d892
--- /dev/null
+++ b/plugins/org.eclipse.net4j.db/src/org/eclipse/net4j/internal/db/ddl/DelegatingDBTable.java
@@ -0,0 +1,281 @@
+/*
+ * Copyright (c) 2004 - 2012 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:
+ * Eike Stepper - initial API and implementation
+ */
+package org.eclipse.net4j.internal.db.ddl;
+
+import org.eclipse.net4j.db.DBType;
+import org.eclipse.net4j.db.ddl.IDBField;
+import org.eclipse.net4j.db.ddl.IDBIndex;
+import org.eclipse.net4j.db.ddl.IDBIndex.Type;
+import org.eclipse.net4j.db.ddl.IDBSchema;
+import org.eclipse.net4j.db.ddl.IDBSchemaElement;
+import org.eclipse.net4j.db.ddl.IDBSchemaVisitor;
+import org.eclipse.net4j.db.ddl.SchemaElementNotFoundException;
+import org.eclipse.net4j.spi.db.ddl.InternalDBTable;
+import org.eclipse.net4j.util.event.IListener;
+
+import java.io.IOException;
+import java.io.Writer;
+import java.util.Properties;
+
+/**
+ * @author Eike Stepper
+ */
+public class DelegatingDBTable extends DelegatingDBSchemaElement implements InternalDBTable
+{
+ private final InternalDBTable delegate;
+
+ public DelegatingDBTable(InternalDBTable delegate)
+ {
+ this.delegate = delegate;
+ }
+
+ @Override
+ public InternalDBTable getDelegate()
+ {
+ return delegate;
+ }
+
+ public String getName()
+ {
+ return delegate.getName();
+ }
+
+ public Properties getProperties()
+ {
+ return delegate.getProperties();
+ }
+
+ public IDBSchema getParent()
+ {
+ return delegate.getParent();
+ }
+
+ public IDBField addField(String name, DBType type)
+ {
+ return delegate.addField(name, type);
+ }
+
+ public String dumpToString()
+ {
+ return delegate.dumpToString();
+ }
+
+ public SchemaElementType getSchemaElementType()
+ {
+ return delegate.getSchemaElementType();
+ }
+
+ public IDBField addField(String name, DBType type, boolean notNull)
+ {
+ return delegate.addField(name, type, notNull);
+ }
+
+ public void dump()
+ {
+ delegate.dump();
+ }
+
+ public void dump(Writer writer) throws IOException
+ {
+ delegate.dump(writer);
+ }
+
+ public void removeField(IDBField fieldToRemove)
+ {
+ delegate.removeField(fieldToRemove);
+ }
+
+ public IDBSchema getSchema()
+ {
+ return delegate.getSchema();
+ }
+
+ public IDBField addField(String name, DBType type, int precision)
+ {
+ return delegate.addField(name, type, precision);
+ }
+
+ public void removeIndex(IDBIndex indexToRemove)
+ {
+ delegate.removeIndex(indexToRemove);
+ }
+
+ public boolean isEmpty()
+ {
+ return delegate.isEmpty();
+ }
+
+ public void addListener(IListener listener)
+ {
+ delegate.addListener(listener);
+ }
+
+ public IDBField addField(String name, DBType type, int precision, boolean notNull)
+ {
+ return delegate.addField(name, type, precision, notNull);
+ }
+
+ public IDBSchemaElement[] getElements()
+ {
+ return delegate.getElements();
+ }
+
+ @Deprecated
+ public void setName(String name)
+ {
+ delegate.setName(name);
+ }
+
+ public IDBField addField(String name, DBType type, int precision, int scale)
+ {
+ return delegate.addField(name, type, precision, scale);
+ }
+
+ public String getFullName()
+ {
+ return delegate.getFullName();
+ }
+
+ public <T extends IDBSchemaElement> T getElement(Class<T> type, String name)
+ {
+ return delegate.getElement(type, name);
+ }
+
+ public IDBField addField(String name, DBType type, int precision, int scale, boolean notNull)
+ {
+ return delegate.addField(name, type, precision, scale, notNull);
+ }
+
+ public void accept(IDBSchemaVisitor visitor)
+ {
+ delegate.accept(visitor);
+ }
+
+ public IDBField getFieldSafe(String name) throws SchemaElementNotFoundException
+ {
+ return delegate.getFieldSafe(name);
+ }
+
+ public void removeListener(IListener listener)
+ {
+ delegate.removeListener(listener);
+ }
+
+ public void remove()
+ {
+ delegate.remove();
+ }
+
+ public IDBField getField(String name)
+ {
+ return delegate.getField(name);
+ }
+
+ public IDBField getField(int position)
+ {
+ return delegate.getField(position);
+ }
+
+ public boolean hasListeners()
+ {
+ return delegate.hasListeners();
+ }
+
+ public int getFieldCount()
+ {
+ return delegate.getFieldCount();
+ }
+
+ public IDBField[] getFields()
+ {
+ return delegate.getFields();
+ }
+
+ public IDBField[] getFields(String... fieldNames) throws SchemaElementNotFoundException
+ {
+ return delegate.getFields(fieldNames);
+ }
+
+ public IListener[] getListeners()
+ {
+ return delegate.getListeners();
+ }
+
+ public IDBIndex addIndex(String name, Type type, IDBField... fields)
+ {
+ return delegate.addIndex(name, type, fields);
+ }
+
+ public IDBIndex addIndex(String name, Type type, String... fieldNames) throws SchemaElementNotFoundException
+ {
+ return delegate.addIndex(name, type, fieldNames);
+ }
+
+ public IDBIndex addIndexEmpty(String name, Type type)
+ {
+ return delegate.addIndexEmpty(name, type);
+ }
+
+ public IDBIndex addIndex(Type type, IDBField... fields)
+ {
+ return delegate.addIndex(type, fields);
+ }
+
+ public IDBIndex addIndex(Type type, String... fieldNames) throws SchemaElementNotFoundException
+ {
+ return delegate.addIndex(type, fieldNames);
+ }
+
+ public IDBIndex addIndexEmpty(Type type)
+ {
+ return delegate.addIndexEmpty(type);
+ }
+
+ public IDBIndex getIndexSafe(String name) throws SchemaElementNotFoundException
+ {
+ return delegate.getIndexSafe(name);
+ }
+
+ public IDBIndex getIndex(String name)
+ {
+ return delegate.getIndex(name);
+ }
+
+ public IDBIndex getIndex(int position)
+ {
+ return delegate.getIndex(position);
+ }
+
+ public int getIndexCount()
+ {
+ return delegate.getIndexCount();
+ }
+
+ public IDBIndex[] getIndices()
+ {
+ return delegate.getIndices();
+ }
+
+ public IDBIndex getPrimaryKeyIndex()
+ {
+ return delegate.getPrimaryKeyIndex();
+ }
+
+ public String sqlInsert()
+ {
+ return delegate.sqlInsert();
+ }
+
+ public int compareTo(IDBSchemaElement o)
+ {
+ return delegate.compareTo(o);
+ }
+}

Back to the top