From d6156c201a3bc52c8bf879a49abea1b8b9da8f91 Mon Sep 17 00:00:00 2001 From: Michael Bayne Date: Tue, 30 Jan 2007 20:57:38 +0000 Subject: [PATCH] Patch from Zell to fix index bits. --- src/java/com/samskivert/jdbc/depot/DepotMarshaller.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/java/com/samskivert/jdbc/depot/DepotMarshaller.java b/src/java/com/samskivert/jdbc/depot/DepotMarshaller.java index 105efab..3cbd0c7 100644 --- a/src/java/com/samskivert/jdbc/depot/DepotMarshaller.java +++ b/src/java/com/samskivert/jdbc/depot/DepotMarshaller.java @@ -761,7 +761,8 @@ public class DepotMarshaller log.info("Adding primary key to " + getTableName() + ": " + pkdef); ctx.invoke(new Modifier.Simple("alter table " + getTableName() + " add " + pkdef)); - } else if (!hasPrimaryKey() && indexColumns.remove("PRIMARY") != null) { + } else if (!hasPrimaryKey() && indexColumns.containsKey("PRIMARY")) { + indexColumns.remove("PRIMARY"); log.info("Dropping primary from " + getTableName()); ctx.invoke(new Modifier.Simple("alter table " + getTableName() + " drop primary key")); } @@ -769,7 +770,8 @@ public class DepotMarshaller // add any missing indices Entity entity = _pclass.getAnnotation(Entity.class); for (Index index : (entity == null ? new Index[0] : entity.indices())) { - if (indexColumns.remove(index.name()) != null) { + if (indexColumns.containsKey(index.name())) { + indexColumns.remove(index.name()); continue; } String indexdef = "create " + index.type() + " index " + index.name() +