Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEike Stepper2006-07-04 12:16:34 +0000
committerEike Stepper2006-07-04 12:16:34 +0000
commit75ec02031ba6d1bf838158d9914f646fc22ae2d3 (patch)
tree6e3f9fe9b6bc9006dd8b3cd2f53bf20093c0fb1a /plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/server
parentef20832768ad6262229960b29ba83d184676d886 (diff)
downloadcdo-75ec02031ba6d1bf838158d9914f646fc22ae2d3.tar.gz
cdo-75ec02031ba6d1bf838158d9914f646fc22ae2d3.tar.xz
cdo-75ec02031ba6d1bf838158d9914f646fc22ae2d3.zip
Made parentClassName null-safe
Diffstat (limited to 'plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/server')
-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 8162716957..2dac4c14a5 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)

Back to the top