diff options
-rw-r--r-- | plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/HorizontalMappingStrategy.java | 35 |
1 files changed, 23 insertions, 12 deletions
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 9ada759e7f..982c5da1dc 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 @@ -186,19 +186,30 @@ public class HorizontalMappingStrategy extends MappingStrategy builder.append(CDODBSchema.ATTRIBUTES_CONTAINER); builder.append("="); builder.append(CDOIDUtil.getLong(folderID)); - builder.append(" AND "); - builder.append(nameField); - if (exactMatch) + if (exactMatch || name != null) { - builder.append("=\'"); - builder.append(name); - builder.append("\'"); - } - else - { - builder.append(" LIKE \'"); - builder.append(name); - builder.append("%\'"); + builder.append(" AND "); + builder.append(nameField); + if (exactMatch) + { + if (name == null) + { + builder.append(" IS NULL"); + } + else + { + builder.append("=\'"); + builder.append(name); + builder.append("\'"); + } + } + else + { + // Here: name != null + builder.append(" LIKE \'"); + builder.append(name); + builder.append("%\'"); + } } String sql = builder.toString(); |