summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEike Stepper2006-07-04 08:16:34 (EDT)
committerEike Stepper2006-07-04 08:16:34 (EDT)
commit75ec02031ba6d1bf838158d9914f646fc22ae2d3 (patch)
tree6e3f9fe9b6bc9006dd8b3cd2f53bf20093c0fb1a
parentef20832768ad6262229960b29ba83d184676d886 (diff)
downloadcdo-75ec02031ba6d1bf838158d9914f646fc22ae2d3.zip
cdo-75ec02031ba6d1bf838158d9914f646fc22ae2d3.tar.gz
cdo-75ec02031ba6d1bf838158d9914f646fc22ae2d3.tar.bz2
Made parentClassName null-safe
-rw-r--r--plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/server/impl/MapperImpl.java9
1 files changed, 7 insertions, 2 deletions
diff --git a/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/server/impl/MapperImpl.java b/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/server/impl/MapperImpl.java
index 8162716..2dac4c1 100644
--- a/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/server/impl/MapperImpl.java
+++ b/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/server/impl/MapperImpl.java
@@ -342,6 +342,11 @@ public class MapperImpl extends ServiceImpl implements Mapper, SQLConstants
String parentName = resultSet.getString(3);
String tableName = resultSet.getString(4);
+ if (parentName != null && parentName.length() == 0)
+ {
+ parentName = null;
+ }
+
if (isDebugEnabled())
debug("Initializing class: cid=" + cid + ", name=" + name + ", parentName=" + parentName
+ ", tableName=" + tableName);
@@ -391,9 +396,9 @@ public class MapperImpl extends ServiceImpl implements Mapper, SQLConstants
public void insertClass(final ClassInfo classInfo)
{
+ String parentName = classInfo.getParentName() == null ? "" : classInfo.getParentName();
sql(INSERT_CLASS, new Object[] { new Integer(classInfo.getCID()), classInfo.getName(),
- classInfo.getParentName(), classInfo.getTableName(),
- new Integer(classInfo.getPackageInfo().getPid())});
+ parentName, classInfo.getTableName(), new Integer(classInfo.getPackageInfo().getPid())});
}
public void insertAttribute(final AttributeInfo attributeInfo, final int cid)