summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEike Stepper2008-01-17 11:14:32 (EST)
committerEike Stepper2008-01-17 11:14:32 (EST)
commit41fe42f734bcbdb0f151a449beaaec5ffc19dcac (patch)
tree8a0d435539b7b406ae016a83006f39f857b92f79
parent2a75aacf38877bff0648ad835993a982c1056f5a (diff)
downloadcdo-41fe42f734bcbdb0f151a449beaaec5ffc19dcac.zip
cdo-41fe42f734bcbdb0f151a449beaaec5ffc19dcac.tar.gz
cdo-41fe42f734bcbdb0f151a449beaaec5ffc19dcac.tar.bz2
[214487] Use prepared statements if appropriate
https://bugs.eclipse.org/bugs/show_bug.cgi?id=214487
-rw-r--r--plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/db/IAttributeMapping.java2
-rw-r--r--plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/db/IClassMapping.java2
-rw-r--r--plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/db/IDBStore.java2
-rw-r--r--plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/db/IReferenceMapping.java2
-rw-r--r--plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/AttributeMapping.java2
-rw-r--r--plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/CDODBSchema.java8
-rw-r--r--plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/ClassMapping.java6
-rw-r--r--plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/DBStore.java6
-rw-r--r--plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/DBStoreAccessor.java2
-rw-r--r--plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/DBStoreWriter.java2
-rw-r--r--plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/FeatureServerInfo.java2
-rw-r--r--plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/HorizontalMappingStrategy.java2
-rw-r--r--plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/MappingStrategy.java4
-rw-r--r--plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/NoClassMapping.java2
-rw-r--r--plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/ObjectTypeCache.java8
-rw-r--r--plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/PackageServerInfo.java2
-rw-r--r--plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/ReferenceMapping.java2
-rw-r--r--plugins/org.eclipse.net4j.db.derby/src/org/eclipse/net4j/db/internal/derby/DerbyAdapter.java4
-rw-r--r--plugins/org.eclipse.net4j.db.hsqldb/src/org/eclipse/net4j/db/internal/hsqldb/HSQLDBAdapter.java2
-rw-r--r--plugins/org.eclipse.net4j.db.mysql/src/org/eclipse/net4j/db/internal/mysql/MYSQLAdapter.java4
-rw-r--r--plugins/org.eclipse.net4j.db/META-INF/MANIFEST.MF7
-rw-r--r--plugins/org.eclipse.net4j.db/src/org/eclipse/net4j/db/DBSelect.java68
-rw-r--r--plugins/org.eclipse.net4j.db/src/org/eclipse/net4j/db/DBUtil.java5
-rw-r--r--plugins/org.eclipse.net4j.db/src/org/eclipse/net4j/db/IDBAdapter.java2
-rw-r--r--plugins/org.eclipse.net4j.db/src/org/eclipse/net4j/db/ddl/IDBField.java (renamed from plugins/org.eclipse.net4j.db/src/org/eclipse/net4j/db/IDBField.java)6
-rw-r--r--plugins/org.eclipse.net4j.db/src/org/eclipse/net4j/db/ddl/IDBIndex.java (renamed from plugins/org.eclipse.net4j.db/src/org/eclipse/net4j/db/IDBIndex.java)4
-rw-r--r--plugins/org.eclipse.net4j.db/src/org/eclipse/net4j/db/ddl/IDBSchema.java (renamed from plugins/org.eclipse.net4j.db/src/org/eclipse/net4j/db/IDBSchema.java)8
-rw-r--r--plugins/org.eclipse.net4j.db/src/org/eclipse/net4j/db/ddl/IDBSchemaElement.java (renamed from plugins/org.eclipse.net4j.db/src/org/eclipse/net4j/db/IDBElement.java)4
-rw-r--r--plugins/org.eclipse.net4j.db/src/org/eclipse/net4j/db/ddl/IDBTable.java (renamed from plugins/org.eclipse.net4j.db/src/org/eclipse/net4j/db/IDBTable.java)7
-rw-r--r--plugins/org.eclipse.net4j.db/src/org/eclipse/net4j/db/dml/IDBParameter.java29
-rw-r--r--plugins/org.eclipse.net4j.db/src/org/eclipse/net4j/db/dml/IDBStatement.java35
-rw-r--r--plugins/org.eclipse.net4j.db/src/org/eclipse/net4j/internal/db/DBAdapter.java9
-rw-r--r--plugins/org.eclipse.net4j.db/src/org/eclipse/net4j/internal/db/ddl/DBField.java (renamed from plugins/org.eclipse.net4j.db/src/org/eclipse/net4j/internal/db/DBField.java)8
-rw-r--r--plugins/org.eclipse.net4j.db/src/org/eclipse/net4j/internal/db/ddl/DBIndex.java (renamed from plugins/org.eclipse.net4j.db/src/org/eclipse/net4j/internal/db/DBIndex.java)10
-rw-r--r--plugins/org.eclipse.net4j.db/src/org/eclipse/net4j/internal/db/ddl/DBSchema.java (renamed from plugins/org.eclipse.net4j.db/src/org/eclipse/net4j/internal/db/DBSchema.java)8
-rw-r--r--plugins/org.eclipse.net4j.db/src/org/eclipse/net4j/internal/db/ddl/DBSchemaElement.java (renamed from plugins/org.eclipse.net4j.db/src/org/eclipse/net4j/internal/db/DBElement.java)8
-rw-r--r--plugins/org.eclipse.net4j.db/src/org/eclipse/net4j/internal/db/ddl/DBTable.java (renamed from plugins/org.eclipse.net4j.db/src/org/eclipse/net4j/internal/db/DBTable.java)12
-rw-r--r--plugins/org.eclipse.net4j.db/src/org/eclipse/net4j/internal/db/dml/DBParameter.java49
-rw-r--r--plugins/org.eclipse.net4j.db/src/org/eclipse/net4j/internal/db/dml/DBStatement.java106
-rw-r--r--plugins/org.eclipse.net4j.jms.server.jdbc/src/org/eclipse/net4j/jms/server/internal/jdbc/JMSSchema.java8
40 files changed, 315 insertions, 144 deletions
diff --git a/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/db/IAttributeMapping.java b/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/db/IAttributeMapping.java
index 403c527..66b387a 100644
--- a/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/db/IAttributeMapping.java
+++ b/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/db/IAttributeMapping.java
@@ -12,7 +12,7 @@ package org.eclipse.emf.cdo.server.db;
import org.eclipse.emf.cdo.internal.protocol.revision.CDORevisionImpl;
-import org.eclipse.net4j.db.IDBField;
+import org.eclipse.net4j.db.ddl.IDBField;
import java.sql.ResultSet;
diff --git a/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/db/IClassMapping.java b/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/db/IClassMapping.java
index 2798201..a2b8d76 100644
--- a/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/db/IClassMapping.java
+++ b/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/db/IClassMapping.java
@@ -14,7 +14,7 @@ import org.eclipse.emf.cdo.internal.protocol.revision.CDORevisionImpl;
import org.eclipse.emf.cdo.protocol.model.CDOClass;
import org.eclipse.emf.cdo.protocol.model.CDOFeature;
-import org.eclipse.net4j.db.IDBTable;
+import org.eclipse.net4j.db.ddl.IDBTable;
import java.util.List;
import java.util.Set;
diff --git a/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/db/IDBStore.java b/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/db/IDBStore.java
index 8edf8fd..38a15f4 100644
--- a/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/db/IDBStore.java
+++ b/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/db/IDBStore.java
@@ -14,7 +14,7 @@ import org.eclipse.emf.cdo.server.IStore;
import org.eclipse.net4j.db.ConnectionProvider;
import org.eclipse.net4j.db.IDBAdapter;
-import org.eclipse.net4j.db.IDBSchema;
+import org.eclipse.net4j.db.ddl.IDBSchema;
/**
* @author Eike Stepper
diff --git a/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/db/IReferenceMapping.java b/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/db/IReferenceMapping.java
index 9014893..846ed51 100644
--- a/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/db/IReferenceMapping.java
+++ b/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/db/IReferenceMapping.java
@@ -13,7 +13,7 @@ package org.eclipse.emf.cdo.server.db;
import org.eclipse.emf.cdo.internal.protocol.revision.CDORevisionImpl;
import org.eclipse.emf.cdo.server.IStoreChunkReader.Chunk;
-import org.eclipse.net4j.db.IDBTable;
+import org.eclipse.net4j.db.ddl.IDBTable;
import java.util.List;
diff --git a/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/AttributeMapping.java b/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/AttributeMapping.java
index 2b677f4..9f6b4f2 100644
--- a/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/AttributeMapping.java
+++ b/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/AttributeMapping.java
@@ -17,7 +17,7 @@ import org.eclipse.emf.cdo.server.db.IAttributeMapping;
import org.eclipse.net4j.db.DBException;
import org.eclipse.net4j.db.IDBAdapter;
-import org.eclipse.net4j.db.IDBField;
+import org.eclipse.net4j.db.ddl.IDBField;
import java.sql.ResultSet;
import java.sql.SQLException;
diff --git a/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/CDODBSchema.java b/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/CDODBSchema.java
index a967e0f..3378aca 100644
--- a/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/CDODBSchema.java
+++ b/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/CDODBSchema.java
@@ -11,10 +11,10 @@
package org.eclipse.emf.cdo.server.internal.db;
import org.eclipse.net4j.db.DBType;
-import org.eclipse.net4j.db.IDBField;
-import org.eclipse.net4j.db.IDBIndex;
-import org.eclipse.net4j.db.IDBTable;
-import org.eclipse.net4j.internal.db.DBSchema;
+import org.eclipse.net4j.db.ddl.IDBField;
+import org.eclipse.net4j.db.ddl.IDBIndex;
+import org.eclipse.net4j.db.ddl.IDBTable;
+import org.eclipse.net4j.internal.db.ddl.DBSchema;
/**
* @author Eike Stepper
diff --git a/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/ClassMapping.java b/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/ClassMapping.java
index b6dbfc5..0ffc365 100644
--- a/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/ClassMapping.java
+++ b/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/ClassMapping.java
@@ -28,9 +28,9 @@ import org.eclipse.net4j.db.DBException;
import org.eclipse.net4j.db.DBType;
import org.eclipse.net4j.db.DBUtil;
import org.eclipse.net4j.db.IDBAdapter;
-import org.eclipse.net4j.db.IDBField;
-import org.eclipse.net4j.db.IDBIndex;
-import org.eclipse.net4j.db.IDBTable;
+import org.eclipse.net4j.db.ddl.IDBField;
+import org.eclipse.net4j.db.ddl.IDBIndex;
+import org.eclipse.net4j.db.ddl.IDBTable;
import org.eclipse.net4j.internal.util.om.trace.ContextTracer;
import org.eclipse.net4j.util.ImplementationError;
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 677654f..0f3d19d 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
@@ -26,9 +26,9 @@ import org.eclipse.net4j.db.DBException;
import org.eclipse.net4j.db.DBType;
import org.eclipse.net4j.db.DBUtil;
import org.eclipse.net4j.db.IDBAdapter;
-import org.eclipse.net4j.db.IDBSchema;
-import org.eclipse.net4j.db.IDBTable;
-import org.eclipse.net4j.internal.db.DBSchema;
+import org.eclipse.net4j.db.ddl.IDBSchema;
+import org.eclipse.net4j.db.ddl.IDBTable;
+import org.eclipse.net4j.internal.db.ddl.DBSchema;
import org.eclipse.net4j.util.ImplementationError;
import org.eclipse.net4j.util.lifecycle.LifecycleUtil;
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 57f838b..48f39d7 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
@@ -21,7 +21,7 @@ import org.eclipse.emf.cdo.server.db.IMappingStrategy;
import org.eclipse.net4j.db.DBException;
import org.eclipse.net4j.db.DBUtil;
-import org.eclipse.net4j.db.IDBTable;
+import org.eclipse.net4j.db.ddl.IDBTable;
import java.sql.Connection;
import java.sql.SQLException;
diff --git a/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/DBStoreWriter.java b/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/DBStoreWriter.java
index 252ae85..f6d5f9f 100644
--- a/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/DBStoreWriter.java
+++ b/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/DBStoreWriter.java
@@ -25,7 +25,7 @@ import org.eclipse.emf.cdo.server.internal.db.bundle.OM;
import org.eclipse.net4j.db.DBException;
import org.eclipse.net4j.db.DBUtil;
-import org.eclipse.net4j.db.IDBTable;
+import org.eclipse.net4j.db.ddl.IDBTable;
import org.eclipse.net4j.internal.util.om.trace.ContextTracer;
import org.eclipse.net4j.util.transaction.ITransaction;
diff --git a/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/FeatureServerInfo.java b/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/FeatureServerInfo.java
index f89ee6d..156abda 100644
--- a/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/FeatureServerInfo.java
+++ b/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/FeatureServerInfo.java
@@ -12,7 +12,7 @@ package org.eclipse.emf.cdo.server.internal.db;
import org.eclipse.emf.cdo.protocol.model.CDOFeature;
-import org.eclipse.net4j.db.IDBField;
+import org.eclipse.net4j.db.ddl.IDBField;
import java.util.HashMap;
import java.util.Map;
diff --git a/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/HorizontalMappingStrategy.java b/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/HorizontalMappingStrategy.java
index 3359e32..8a3cc0a 100644
--- a/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/HorizontalMappingStrategy.java
+++ b/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/HorizontalMappingStrategy.java
@@ -23,7 +23,7 @@ import org.eclipse.emf.cdo.server.internal.db.bundle.OM;
import org.eclipse.net4j.db.DBException;
import org.eclipse.net4j.db.DBUtil;
-import org.eclipse.net4j.db.IDBTable;
+import org.eclipse.net4j.db.ddl.IDBTable;
import org.eclipse.net4j.internal.util.om.trace.ContextTracer;
import org.eclipse.net4j.util.lifecycle.LifecycleUtil;
diff --git a/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/MappingStrategy.java b/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/MappingStrategy.java
index 5b6ae0f..a324bf8 100644
--- a/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/MappingStrategy.java
+++ b/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/MappingStrategy.java
@@ -26,8 +26,8 @@ import org.eclipse.emf.cdo.server.internal.db.bundle.OM;
import org.eclipse.net4j.db.DBException;
import org.eclipse.net4j.db.DBUtil;
-import org.eclipse.net4j.db.IDBField;
-import org.eclipse.net4j.db.IDBTable;
+import org.eclipse.net4j.db.ddl.IDBField;
+import org.eclipse.net4j.db.ddl.IDBTable;
import org.eclipse.net4j.internal.util.lifecycle.Lifecycle;
import org.eclipse.net4j.internal.util.om.trace.ContextTracer;
import org.eclipse.net4j.util.io.CloseableIterator;
diff --git a/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/NoClassMapping.java b/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/NoClassMapping.java
index 74f303a..66042d4 100644
--- a/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/NoClassMapping.java
+++ b/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/NoClassMapping.java
@@ -20,7 +20,7 @@ import org.eclipse.emf.cdo.server.db.IDBStoreWriter;
import org.eclipse.emf.cdo.server.db.IMappingStrategy;
import org.eclipse.emf.cdo.server.db.IReferenceMapping;
-import org.eclipse.net4j.db.IDBTable;
+import org.eclipse.net4j.db.ddl.IDBTable;
import java.util.Collections;
import java.util.List;
diff --git a/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/ObjectTypeCache.java b/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/ObjectTypeCache.java
index 139e987..fb68f16 100644
--- a/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/ObjectTypeCache.java
+++ b/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/ObjectTypeCache.java
@@ -21,10 +21,10 @@ import org.eclipse.net4j.db.DBException;
import org.eclipse.net4j.db.DBType;
import org.eclipse.net4j.db.DBUtil;
import org.eclipse.net4j.db.IDBAdapter;
-import org.eclipse.net4j.db.IDBField;
-import org.eclipse.net4j.db.IDBIndex;
-import org.eclipse.net4j.db.IDBSchema;
-import org.eclipse.net4j.db.IDBTable;
+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.IDBTable;
import org.eclipse.net4j.internal.util.lifecycle.Lifecycle;
import java.sql.ResultSet;
diff --git a/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/PackageServerInfo.java b/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/PackageServerInfo.java
index 20ba9f8..5ebc96e 100644
--- a/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/PackageServerInfo.java
+++ b/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/PackageServerInfo.java
@@ -12,7 +12,7 @@ package org.eclipse.emf.cdo.server.internal.db;
import org.eclipse.emf.cdo.protocol.model.CDOPackage;
-import org.eclipse.net4j.db.IDBSchema;
+import org.eclipse.net4j.db.ddl.IDBSchema;
/**
* @author Eike Stepper
diff --git a/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/ReferenceMapping.java b/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/ReferenceMapping.java
index 0c4b35b..c648576 100644
--- a/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/ReferenceMapping.java
+++ b/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/ReferenceMapping.java
@@ -30,7 +30,7 @@ import org.eclipse.emf.cdo.server.internal.db.bundle.OM;
import org.eclipse.net4j.db.DBException;
import org.eclipse.net4j.db.DBType;
import org.eclipse.net4j.db.DBUtil;
-import org.eclipse.net4j.db.IDBTable;
+import org.eclipse.net4j.db.ddl.IDBTable;
import org.eclipse.net4j.internal.util.om.trace.ContextTracer;
import java.sql.ResultSet;
diff --git a/plugins/org.eclipse.net4j.db.derby/src/org/eclipse/net4j/db/internal/derby/DerbyAdapter.java b/plugins/org.eclipse.net4j.db.derby/src/org/eclipse/net4j/db/internal/derby/DerbyAdapter.java
index f6ab4dc..5120b83 100644
--- a/plugins/org.eclipse.net4j.db.derby/src/org/eclipse/net4j/db/internal/derby/DerbyAdapter.java
+++ b/plugins/org.eclipse.net4j.db.derby/src/org/eclipse/net4j/db/internal/derby/DerbyAdapter.java
@@ -11,9 +11,9 @@
package org.eclipse.net4j.db.internal.derby;
import org.eclipse.net4j.db.DBType;
-import org.eclipse.net4j.db.IDBField;
+import org.eclipse.net4j.db.ddl.IDBField;
import org.eclipse.net4j.internal.db.DBAdapter;
-import org.eclipse.net4j.internal.db.DBField;
+import org.eclipse.net4j.internal.db.ddl.DBField;
import org.apache.derby.jdbc.EmbeddedDriver;
diff --git a/plugins/org.eclipse.net4j.db.hsqldb/src/org/eclipse/net4j/db/internal/hsqldb/HSQLDBAdapter.java b/plugins/org.eclipse.net4j.db.hsqldb/src/org/eclipse/net4j/db/internal/hsqldb/HSQLDBAdapter.java
index 2d41999..fc717c7 100644
--- a/plugins/org.eclipse.net4j.db.hsqldb/src/org/eclipse/net4j/db/internal/hsqldb/HSQLDBAdapter.java
+++ b/plugins/org.eclipse.net4j.db.hsqldb/src/org/eclipse/net4j/db/internal/hsqldb/HSQLDBAdapter.java
@@ -12,7 +12,7 @@ package org.eclipse.net4j.db.internal.hsqldb;
import org.eclipse.net4j.db.DBType;
import org.eclipse.net4j.internal.db.DBAdapter;
-import org.eclipse.net4j.internal.db.DBField;
+import org.eclipse.net4j.internal.db.ddl.DBField;
import org.hsqldb.jdbcDriver;
diff --git a/plugins/org.eclipse.net4j.db.mysql/src/org/eclipse/net4j/db/internal/mysql/MYSQLAdapter.java b/plugins/org.eclipse.net4j.db.mysql/src/org/eclipse/net4j/db/internal/mysql/MYSQLAdapter.java
index 03b9809..c3c6196 100644
--- a/plugins/org.eclipse.net4j.db.mysql/src/org/eclipse/net4j/db/internal/mysql/MYSQLAdapter.java
+++ b/plugins/org.eclipse.net4j.db.mysql/src/org/eclipse/net4j/db/internal/mysql/MYSQLAdapter.java
@@ -12,9 +12,9 @@ package org.eclipse.net4j.db.internal.mysql;
import org.eclipse.net4j.db.DBException;
import org.eclipse.net4j.db.DBType;
-import org.eclipse.net4j.db.IDBField;
+import org.eclipse.net4j.db.ddl.IDBField;
import org.eclipse.net4j.internal.db.DBAdapter;
-import org.eclipse.net4j.internal.db.DBField;
+import org.eclipse.net4j.internal.db.ddl.DBField;
import org.gjt.mm.mysql.Driver;
diff --git a/plugins/org.eclipse.net4j.db/META-INF/MANIFEST.MF b/plugins/org.eclipse.net4j.db/META-INF/MANIFEST.MF
index 44254cf..bf0681f 100644
--- a/plugins/org.eclipse.net4j.db/META-INF/MANIFEST.MF
+++ b/plugins/org.eclipse.net4j.db/META-INF/MANIFEST.MF
@@ -11,5 +11,10 @@ Bundle-RequiredExecutionEnvironment: J2SE-1.5
Require-Bundle: org.eclipse.core.runtime;bundle-version="[3.3.0,4.0.0)",
org.eclipse.net4j.util;bundle-version="[0.8.0,0.9.0)";visibility:=reexport
Export-Package: org.eclipse.net4j.db;version="0.8.0",
- org.eclipse.net4j.internal.db;version="0.8.0"
+ org.eclipse.net4j.db.ddl;version="0.8.0",
+ org.eclipse.net4j.db.dml;version="0.8.0",
+ org.eclipse.net4j.internal.db;version="0.8.0",
+ org.eclipse.net4j.internal.db.bundle;version="0.8.0";x-internal:=true,
+ org.eclipse.net4j.internal.db.ddl;version="0.8.0",
+ org.eclipse.net4j.internal.db.dml;version="0.8.0"
Eclipse-LazyStart: true
diff --git a/plugins/org.eclipse.net4j.db/src/org/eclipse/net4j/db/DBSelect.java b/plugins/org.eclipse.net4j.db/src/org/eclipse/net4j/db/DBSelect.java
deleted file mode 100644
index 8ffcd08..0000000
--- a/plugins/org.eclipse.net4j.db/src/org/eclipse/net4j/db/DBSelect.java
+++ /dev/null
@@ -1,68 +0,0 @@
-/***************************************************************************
- * Copyright (c) 2004 - 2008 Eike Stepper, Germany.
- * 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.db;
-
-import org.eclipse.net4j.util.collection.Pair;
-
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.List;
-
-/**
- * @author Eike Stepper
- */
-public abstract class DBSelect implements IDBRowHandler
-{
- private List<IDBField> fields = new ArrayList<IDBField>(0);
-
- private List<Pair<IDBField, Boolean>> orders = new ArrayList<Pair<IDBField, Boolean>>(0);
-
- private String where;
-
- public DBSelect(IDBField... fields)
- {
- this.fields.addAll(Arrays.asList(fields));
- }
-
- public DBSelect field(IDBField field)
- {
- fields.add(field);
- return this;
- }
-
- public DBSelect order(IDBField field, boolean asc)
- {
- orders.add(new Pair<IDBField, Boolean>(field, asc));
- return this;
- }
-
- public DBSelect orderAsc(IDBField field)
- {
- return order(field, true);
- }
-
- public DBSelect orderDesc(IDBField field)
- {
- return order(field, false);
- }
-
- public DBSelect where()
- {
- where = "";
- return this;
- }
-
- public DBSelect whereEq(IDBField field, boolean value)
- {
- this.where += where;
- return this;
- }
-}
diff --git a/plugins/org.eclipse.net4j.db/src/org/eclipse/net4j/db/DBUtil.java b/plugins/org.eclipse.net4j.db/src/org/eclipse/net4j/db/DBUtil.java
index 2ff53cd..52ec022 100644
--- a/plugins/org.eclipse.net4j.db/src/org/eclipse/net4j/db/DBUtil.java
+++ b/plugins/org.eclipse.net4j.db/src/org/eclipse/net4j/db/DBUtil.java
@@ -10,9 +10,12 @@
**************************************************************************/
package org.eclipse.net4j.db;
-import org.eclipse.net4j.internal.db.DBSchema;
+import org.eclipse.net4j.db.ddl.IDBField;
+import org.eclipse.net4j.db.ddl.IDBSchema;
+import org.eclipse.net4j.db.ddl.IDBTable;
import org.eclipse.net4j.internal.db.DataSourceConnectionProvider;
import org.eclipse.net4j.internal.db.bundle.OM;
+import org.eclipse.net4j.internal.db.ddl.DBSchema;
import org.eclipse.net4j.internal.util.om.trace.ContextTracer;
import org.eclipse.net4j.util.ReflectUtil;
diff --git a/plugins/org.eclipse.net4j.db/src/org/eclipse/net4j/db/IDBAdapter.java b/plugins/org.eclipse.net4j.db/src/org/eclipse/net4j/db/IDBAdapter.java
index deec382..339c347 100644
--- a/plugins/org.eclipse.net4j.db/src/org/eclipse/net4j/db/IDBAdapter.java
+++ b/plugins/org.eclipse.net4j.db/src/org/eclipse/net4j/db/IDBAdapter.java
@@ -10,6 +10,8 @@
**************************************************************************/
package org.eclipse.net4j.db;
+import org.eclipse.net4j.db.ddl.IDBField;
+import org.eclipse.net4j.db.ddl.IDBTable;
import org.eclipse.net4j.internal.db.DBAdapterRegistry;
import org.eclipse.net4j.util.registry.IRegistry;
diff --git a/plugins/org.eclipse.net4j.db/src/org/eclipse/net4j/db/IDBField.java b/plugins/org.eclipse.net4j.db/src/org/eclipse/net4j/db/ddl/IDBField.java
index 5857420..e14fe8c 100644
--- a/plugins/org.eclipse.net4j.db/src/org/eclipse/net4j/db/IDBField.java
+++ b/plugins/org.eclipse.net4j.db/src/org/eclipse/net4j/db/ddl/IDBField.java
@@ -8,12 +8,14 @@
* Contributors:
* Eike Stepper - initial API and implementation
**************************************************************************/
-package org.eclipse.net4j.db;
+package org.eclipse.net4j.db.ddl;
+
+import org.eclipse.net4j.db.DBType;
/**
* @author Eike Stepper
*/
-public interface IDBField extends IDBElement
+public interface IDBField extends IDBSchemaElement
{
public static final int DEFAULT = -1;
diff --git a/plugins/org.eclipse.net4j.db/src/org/eclipse/net4j/db/IDBIndex.java b/plugins/org.eclipse.net4j.db/src/org/eclipse/net4j/db/ddl/IDBIndex.java
index 0515219..ffe7a67 100644
--- a/plugins/org.eclipse.net4j.db/src/org/eclipse/net4j/db/IDBIndex.java
+++ b/plugins/org.eclipse.net4j.db/src/org/eclipse/net4j/db/ddl/IDBIndex.java
@@ -8,12 +8,12 @@
* Contributors:
* Eike Stepper - initial API and implementation
**************************************************************************/
-package org.eclipse.net4j.db;
+package org.eclipse.net4j.db.ddl;
/**
* @author Eike Stepper
*/
-public interface IDBIndex extends IDBElement
+public interface IDBIndex extends IDBSchemaElement
{
public IDBTable getTable();
diff --git a/plugins/org.eclipse.net4j.db/src/org/eclipse/net4j/db/IDBSchema.java b/plugins/org.eclipse.net4j.db/src/org/eclipse/net4j/db/ddl/IDBSchema.java
index 8e3fc09..6451d63 100644
--- a/plugins/org.eclipse.net4j.db/src/org/eclipse/net4j/db/IDBSchema.java
+++ b/plugins/org.eclipse.net4j.db/src/org/eclipse/net4j/db/ddl/IDBSchema.java
@@ -8,7 +8,11 @@
* Contributors:
* Eike Stepper - initial API and implementation
**************************************************************************/
-package org.eclipse.net4j.db;
+package org.eclipse.net4j.db.ddl;
+
+import org.eclipse.net4j.db.ConnectionProvider;
+import org.eclipse.net4j.db.DBException;
+import org.eclipse.net4j.db.IDBAdapter;
import javax.sql.DataSource;
@@ -18,7 +22,7 @@ import java.util.Set;
/**
* @author Eike Stepper
*/
-public interface IDBSchema extends IDBElement
+public interface IDBSchema extends IDBSchemaElement
{
public IDBTable addTable(String name) throws DBException;
diff --git a/plugins/org.eclipse.net4j.db/src/org/eclipse/net4j/db/IDBElement.java b/plugins/org.eclipse.net4j.db/src/org/eclipse/net4j/db/ddl/IDBSchemaElement.java
index f9e1ddb..d0eb709 100644
--- a/plugins/org.eclipse.net4j.db/src/org/eclipse/net4j/db/IDBElement.java
+++ b/plugins/org.eclipse.net4j.db/src/org/eclipse/net4j/db/ddl/IDBSchemaElement.java
@@ -8,14 +8,14 @@
* Contributors:
* Eike Stepper - initial API and implementation
**************************************************************************/
-package org.eclipse.net4j.db;
+package org.eclipse.net4j.db.ddl;
import java.util.Properties;
/**
* @author Eike Stepper
*/
-public interface IDBElement
+public interface IDBSchemaElement
{
public IDBSchema getSchema();
diff --git a/plugins/org.eclipse.net4j.db/src/org/eclipse/net4j/db/IDBTable.java b/plugins/org.eclipse.net4j.db/src/org/eclipse/net4j/db/ddl/IDBTable.java
index 1d5e279..927f192 100644
--- a/plugins/org.eclipse.net4j.db/src/org/eclipse/net4j/db/IDBTable.java
+++ b/plugins/org.eclipse.net4j.db/src/org/eclipse/net4j/db/ddl/IDBTable.java
@@ -8,14 +8,15 @@
* Contributors:
* Eike Stepper - initial API and implementation
**************************************************************************/
-package org.eclipse.net4j.db;
+package org.eclipse.net4j.db.ddl;
-import org.eclipse.net4j.internal.db.DBField;
+import org.eclipse.net4j.db.DBType;
+import org.eclipse.net4j.internal.db.ddl.DBField;
/**
* @author Eike Stepper
*/
-public interface IDBTable extends IDBElement
+public interface IDBTable extends IDBSchemaElement
{
public IDBField addField(String name, DBType type);
diff --git a/plugins/org.eclipse.net4j.db/src/org/eclipse/net4j/db/dml/IDBParameter.java b/plugins/org.eclipse.net4j.db/src/org/eclipse/net4j/db/dml/IDBParameter.java
new file mode 100644
index 0000000..9d7f4bb
--- /dev/null
+++ b/plugins/org.eclipse.net4j.db/src/org/eclipse/net4j/db/dml/IDBParameter.java
@@ -0,0 +1,29 @@
+/***************************************************************************
+ * Copyright (c) 2004 - 2008 Eike Stepper, Germany.
+ * 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.db.dml;
+
+import org.eclipse.net4j.db.DBType;
+
+/**
+ * @author Eike Stepper
+ */
+public interface IDBParameter
+{
+ public IDBStatement getStatement();
+
+ /**
+ * Returns the zero based position of this parameter within the {@link IDBStatement#getParameters() parameters} list
+ * of the containing {@link #getStatement() statement}.
+ */
+ public int getPosition();
+
+ public DBType getType();
+}
diff --git a/plugins/org.eclipse.net4j.db/src/org/eclipse/net4j/db/dml/IDBStatement.java b/plugins/org.eclipse.net4j.db/src/org/eclipse/net4j/db/dml/IDBStatement.java
new file mode 100644
index 0000000..2de389a
--- /dev/null
+++ b/plugins/org.eclipse.net4j.db/src/org/eclipse/net4j/db/dml/IDBStatement.java
@@ -0,0 +1,35 @@
+/***************************************************************************
+ * Copyright (c) 2004 - 2008 Eike Stepper, Germany.
+ * 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.db.dml;
+
+import org.eclipse.net4j.db.DBType;
+import org.eclipse.net4j.db.ddl.IDBField;
+import org.eclipse.net4j.db.ddl.IDBSchemaElement;
+
+/**
+ * @author Eike Stepper
+ */
+public interface IDBStatement
+{
+ public IDBParameter addParameter(DBType type);
+
+ public IDBParameter addParameter(IDBField field);
+
+ public IDBParameter[] getParameters();
+
+ public void addSQL(String literal);
+
+ public void addSQL(IDBParameter parameter);
+
+ public void addSQL(IDBSchemaElement schemaElement);
+
+ public String getSQL();
+}
diff --git a/plugins/org.eclipse.net4j.db/src/org/eclipse/net4j/internal/db/DBAdapter.java b/plugins/org.eclipse.net4j.db/src/org/eclipse/net4j/internal/db/DBAdapter.java
index d75683d..3a73c8f 100644
--- a/plugins/org.eclipse.net4j.db/src/org/eclipse/net4j/internal/db/DBAdapter.java
+++ b/plugins/org.eclipse.net4j.db/src/org/eclipse/net4j/internal/db/DBAdapter.java
@@ -14,10 +14,13 @@ import org.eclipse.net4j.db.DBException;
import org.eclipse.net4j.db.DBType;
import org.eclipse.net4j.db.DBUtil;
import org.eclipse.net4j.db.IDBAdapter;
-import org.eclipse.net4j.db.IDBField;
-import org.eclipse.net4j.db.IDBIndex;
-import org.eclipse.net4j.db.IDBTable;
+import org.eclipse.net4j.db.ddl.IDBField;
+import org.eclipse.net4j.db.ddl.IDBIndex;
+import org.eclipse.net4j.db.ddl.IDBTable;
import org.eclipse.net4j.internal.db.bundle.OM;
+import org.eclipse.net4j.internal.db.ddl.DBField;
+import org.eclipse.net4j.internal.db.ddl.DBIndex;
+import org.eclipse.net4j.internal.db.ddl.DBTable;
import org.eclipse.net4j.internal.util.om.trace.ContextTracer;
import java.sql.Connection;
diff --git a/plugins/org.eclipse.net4j.db/src/org/eclipse/net4j/internal/db/DBField.java b/plugins/org.eclipse.net4j.db/src/org/eclipse/net4j/internal/db/ddl/DBField.java
index f1b0973..313f597 100644
--- a/plugins/org.eclipse.net4j.db/src/org/eclipse/net4j/internal/db/DBField.java
+++ b/plugins/org.eclipse.net4j.db/src/org/eclipse/net4j/internal/db/ddl/DBField.java
@@ -8,16 +8,16 @@
* Contributors:
* Eike Stepper - initial API and implementation
**************************************************************************/
-package org.eclipse.net4j.internal.db;
+package org.eclipse.net4j.internal.db.ddl;
import org.eclipse.net4j.db.DBType;
-import org.eclipse.net4j.db.IDBField;
-import org.eclipse.net4j.db.IDBSchema;
+import org.eclipse.net4j.db.ddl.IDBField;
+import org.eclipse.net4j.db.ddl.IDBSchema;
/**
* @author Eike Stepper
*/
-public class DBField extends DBElement implements IDBField
+public class DBField extends DBSchemaElement implements IDBField
{
private static final int DEFAULT_PRECISION = 255;
diff --git a/plugins/org.eclipse.net4j.db/src/org/eclipse/net4j/internal/db/DBIndex.java b/plugins/org.eclipse.net4j.db/src/org/eclipse/net4j/internal/db/ddl/DBIndex.java
index 4da9950..62c8912 100644
--- a/plugins/org.eclipse.net4j.db/src/org/eclipse/net4j/internal/db/DBIndex.java
+++ b/plugins/org.eclipse.net4j.db/src/org/eclipse/net4j/internal/db/ddl/DBIndex.java
@@ -8,16 +8,16 @@
* Contributors:
* Eike Stepper - initial API and implementation
**************************************************************************/
-package org.eclipse.net4j.internal.db;
+package org.eclipse.net4j.internal.db.ddl;
-import org.eclipse.net4j.db.IDBField;
-import org.eclipse.net4j.db.IDBIndex;
-import org.eclipse.net4j.db.IDBSchema;
+import org.eclipse.net4j.db.ddl.IDBField;
+import org.eclipse.net4j.db.ddl.IDBIndex;
+import org.eclipse.net4j.db.ddl.IDBSchema;
/**
* @author Eike Stepper
*/
-public class DBIndex extends DBElement implements IDBIndex
+public class DBIndex extends DBSchemaElement implements IDBIndex
{
private DBTable table;
diff --git a/plugins/org.eclipse.net4j.db/src/org/eclipse/net4j/internal/db/DBSchema.java b/plugins/org.eclipse.net4j.db/src/org/eclipse/net4j/internal/db/ddl/DBSchema.java
index 0637856..ec80442 100644
--- a/plugins/org.eclipse.net4j.db/src/org/eclipse/net4j/internal/db/DBSchema.java
+++ b/plugins/org.eclipse.net4j.db/src/org/eclipse/net4j/internal/db/ddl/DBSchema.java
@@ -8,14 +8,14 @@
* Contributors:
* Eike Stepper - initial API and implementation
**************************************************************************/
-package org.eclipse.net4j.internal.db;
+package org.eclipse.net4j.internal.db.ddl;
import org.eclipse.net4j.db.ConnectionProvider;
import org.eclipse.net4j.db.DBException;
import org.eclipse.net4j.db.DBUtil;
import org.eclipse.net4j.db.IDBAdapter;
-import org.eclipse.net4j.db.IDBSchema;
-import org.eclipse.net4j.db.IDBTable;
+import org.eclipse.net4j.db.ddl.IDBSchema;
+import org.eclipse.net4j.db.ddl.IDBTable;
import javax.sql.DataSource;
@@ -27,7 +27,7 @@ import java.util.Set;
/**
* @author Eike Stepper
*/
-public class DBSchema extends DBElement implements IDBSchema
+public class DBSchema extends DBSchemaElement implements IDBSchema
{
private String name;
diff --git a/plugins/org.eclipse.net4j.db/src/org/eclipse/net4j/internal/db/DBElement.java b/plugins/org.eclipse.net4j.db/src/org/eclipse/net4j/internal/db/ddl/DBSchemaElement.java
index ba9638c..69d130e 100644
--- a/plugins/org.eclipse.net4j.db/src/org/eclipse/net4j/internal/db/DBElement.java
+++ b/plugins/org.eclipse.net4j.db/src/org/eclipse/net4j/internal/db/ddl/DBSchemaElement.java
@@ -8,20 +8,20 @@
* Contributors:
* Eike Stepper - initial API and implementation
**************************************************************************/
-package org.eclipse.net4j.internal.db;
+package org.eclipse.net4j.internal.db.ddl;
-import org.eclipse.net4j.db.IDBElement;
+import org.eclipse.net4j.db.ddl.IDBSchemaElement;
import java.util.Properties;
/**
* @author Eike Stepper
*/
-public abstract class DBElement implements IDBElement
+public abstract class DBSchemaElement implements IDBSchemaElement
{
private Properties properties;
- public DBElement()
+ public DBSchemaElement()
{
}
diff --git a/plugins/org.eclipse.net4j.db/src/org/eclipse/net4j/internal/db/DBTable.java b/plugins/org.eclipse.net4j.db/src/org/eclipse/net4j/internal/db/ddl/DBTable.java
index 60d2ca9..acd0073 100644
--- a/plugins/org.eclipse.net4j.db/src/org/eclipse/net4j/internal/db/DBTable.java
+++ b/plugins/org.eclipse.net4j.db/src/org/eclipse/net4j/internal/db/ddl/DBTable.java
@@ -8,14 +8,14 @@
* Contributors:
* Eike Stepper - initial API and implementation
**************************************************************************/
-package org.eclipse.net4j.internal.db;
+package org.eclipse.net4j.internal.db.ddl;
import org.eclipse.net4j.db.DBException;
import org.eclipse.net4j.db.DBType;
-import org.eclipse.net4j.db.IDBField;
-import org.eclipse.net4j.db.IDBIndex;
-import org.eclipse.net4j.db.IDBTable;
-import org.eclipse.net4j.db.IDBIndex.Type;
+import org.eclipse.net4j.db.ddl.IDBField;
+import org.eclipse.net4j.db.ddl.IDBIndex;
+import org.eclipse.net4j.db.ddl.IDBTable;
+import org.eclipse.net4j.db.ddl.IDBIndex.Type;
import java.io.IOException;
import java.util.ArrayList;
@@ -24,7 +24,7 @@ import java.util.List;
/**
* @author Eike Stepper
*/
-public class DBTable extends DBElement implements IDBTable
+public class DBTable extends DBSchemaElement implements IDBTable
{
private DBSchema schema;
diff --git a/plugins/org.eclipse.net4j.db/src/org/eclipse/net4j/internal/db/dml/DBParameter.java b/plugins/org.eclipse.net4j.db/src/org/eclipse/net4j/internal/db/dml/DBParameter.java
new file mode 100644
index 0000000..f367597
--- /dev/null
+++ b/plugins/org.eclipse.net4j.db/src/org/eclipse/net4j/internal/db/dml/DBParameter.java
@@ -0,0 +1,49 @@
+/***************************************************************************
+ * Copyright (c) 2004 - 2008 Eike Stepper, Germany.
+ * 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.dml;
+
+import org.eclipse.net4j.db.DBType;
+import org.eclipse.net4j.db.dml.IDBParameter;
+import org.eclipse.net4j.db.dml.IDBStatement;
+
+/**
+ * @author Eike Stepper
+ */
+public class DBParameter implements IDBParameter
+{
+ private IDBStatement statement;
+
+ private int position;
+
+ private DBType type;
+
+ public DBParameter(IDBStatement statement, int position, DBType type)
+ {
+ this.statement = statement;
+ this.position = position;
+ this.type = type;
+ }
+
+ public IDBStatement getStatement()
+ {
+ return statement;
+ }
+
+ public int getPosition()
+ {
+ return position;
+ }
+
+ public DBType getType()
+ {
+ return type;
+ }
+}
diff --git a/plugins/org.eclipse.net4j.db/src/org/eclipse/net4j/internal/db/dml/DBStatement.java b/plugins/org.eclipse.net4j.db/src/org/eclipse/net4j/internal/db/dml/DBStatement.java
new file mode 100644
index 0000000..b1c0924
--- /dev/null
+++ b/plugins/org.eclipse.net4j.db/src/org/eclipse/net4j/internal/db/dml/DBStatement.java
@@ -0,0 +1,106 @@
+/***************************************************************************
+ * Copyright (c) 2004 - 2008 Eike Stepper, Germany.
+ * 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.dml;
+
+import org.eclipse.net4j.db.DBType;
+import org.eclipse.net4j.db.ddl.IDBField;
+import org.eclipse.net4j.db.ddl.IDBSchemaElement;
+import org.eclipse.net4j.db.dml.IDBParameter;
+import org.eclipse.net4j.db.dml.IDBStatement;
+
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * @author Eike Stepper
+ */
+public class DBStatement implements IDBStatement
+{
+ private static final DBParameter[] NO_PARAMETERS = {};
+
+ private List<DBParameter> parameters;
+
+ private List<Object> sequence = new ArrayList<Object>();
+
+ public IDBParameter addParameter(DBType type)
+ {
+ int position = 0;
+ if (parameters == null)
+ {
+ parameters = new ArrayList<DBParameter>();
+ }
+ else
+ {
+ position = parameters.size();
+ }
+
+ DBParameter parameter = new DBParameter(this, position, type);
+ parameters.add(parameter);
+ return parameter;
+ }
+
+ public IDBParameter addParameter(IDBField field)
+ {
+ return addParameter(field.getType());
+ }
+
+ public DBParameter[] getParameters()
+ {
+ if (parameters == null)
+ {
+ return NO_PARAMETERS;
+ }
+
+ return parameters.toArray(new DBParameter[parameters.size()]);
+ }
+
+ public void addSQL(String literal)
+ {
+ int tailPos = sequence.size() - 1;
+ Object tail = sequence.get(tailPos);
+ if (tail instanceof String)
+ {
+ sequence.set(tailPos, ((String)tail) + literal);
+ }
+ else
+ {
+ sequence.add(literal);
+ }
+ }
+
+ public void addSQL(IDBParameter parameter)
+ {
+ sequence.add(parameter);
+ }
+
+ public void addSQL(IDBSchemaElement schemaElement)
+ {
+ addSQL(schemaElement.getName());
+ }
+
+ public String getSQL()
+ {
+ StringBuilder builder = new StringBuilder();
+ for (Object element : sequence)
+ {
+ if (element instanceof IDBParameter)
+ {
+ builder.append("?");
+ }
+ else
+ {
+ builder.append(element);
+ }
+ }
+
+ return builder.toString();
+ }
+}
diff --git a/plugins/org.eclipse.net4j.jms.server.jdbc/src/org/eclipse/net4j/jms/server/internal/jdbc/JMSSchema.java b/plugins/org.eclipse.net4j.jms.server.jdbc/src/org/eclipse/net4j/jms/server/internal/jdbc/JMSSchema.java
index 88714ec..5b357e2 100644
--- a/plugins/org.eclipse.net4j.jms.server.jdbc/src/org/eclipse/net4j/jms/server/internal/jdbc/JMSSchema.java
+++ b/plugins/org.eclipse.net4j.jms.server.jdbc/src/org/eclipse/net4j/jms/server/internal/jdbc/JMSSchema.java
@@ -11,10 +11,10 @@
package org.eclipse.net4j.jms.server.internal.jdbc;
import org.eclipse.net4j.db.DBType;
-import org.eclipse.net4j.db.IDBField;
-import org.eclipse.net4j.db.IDBIndex;
-import org.eclipse.net4j.db.IDBTable;
-import org.eclipse.net4j.internal.db.DBSchema;
+import org.eclipse.net4j.db.ddl.IDBField;
+import org.eclipse.net4j.db.ddl.IDBIndex;
+import org.eclipse.net4j.db.ddl.IDBTable;
+import org.eclipse.net4j.internal.db.ddl.DBSchema;
/**
* @author Eike Stepper