Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--plugins/org.eclipse.net4j.db/src/org/eclipse/net4j/db/ddl/IDBIndex.java5
-rw-r--r--plugins/org.eclipse.net4j.db/src/org/eclipse/net4j/internal/db/ddl/DBIndex.java8
2 files changed, 13 insertions, 0 deletions
diff --git a/plugins/org.eclipse.net4j.db/src/org/eclipse/net4j/db/ddl/IDBIndex.java b/plugins/org.eclipse.net4j.db/src/org/eclipse/net4j/db/ddl/IDBIndex.java
index d0f4198630..0bf2f2490d 100644
--- a/plugins/org.eclipse.net4j.db/src/org/eclipse/net4j/db/ddl/IDBIndex.java
+++ b/plugins/org.eclipse.net4j.db/src/org/eclipse/net4j/db/ddl/IDBIndex.java
@@ -44,6 +44,11 @@ public interface IDBIndex extends IDBSchemaElement
/**
* @since 4.2
*/
+ public IDBIndexField addIndexField(String name);
+
+ /**
+ * @since 4.2
+ */
public IDBIndexField getIndexField(String name);
/**
diff --git a/plugins/org.eclipse.net4j.db/src/org/eclipse/net4j/internal/db/ddl/DBIndex.java b/plugins/org.eclipse.net4j.db/src/org/eclipse/net4j/internal/db/ddl/DBIndex.java
index 1db215abe2..4195881458 100644
--- a/plugins/org.eclipse.net4j.db/src/org/eclipse/net4j/internal/db/ddl/DBIndex.java
+++ b/plugins/org.eclipse.net4j.db/src/org/eclipse/net4j/internal/db/ddl/DBIndex.java
@@ -18,6 +18,7 @@ import org.eclipse.net4j.db.ddl.IDBSchemaElement;
import org.eclipse.net4j.db.ddl.IDBSchemaVisitor;
import org.eclipse.net4j.spi.db.DBSchema;
import org.eclipse.net4j.spi.db.DBSchemaElement;
+import org.eclipse.net4j.util.CheckUtil;
import java.io.IOException;
import java.io.Writer;
@@ -134,6 +135,13 @@ public class DBIndex extends DBSchemaElement implements IDBIndex
return indexField;
}
+ public IDBIndexField addIndexField(String name)
+ {
+ DBField field = table.getField(name);
+ CheckUtil.checkArg(field, "Field not found: " + name);
+ return addIndexField(field);
+ }
+
public void removeIndexField(IDBIndexField indexFieldToRemove)
{
assertUnlocked();

Back to the top