jackrabbit-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ju...@apache.org
Subject svn commit: r558156 - /jackrabbit/trunk/contrib/orm-persistence/src/java/org/apache/jackrabbit/core/state/orm/ORMNodeState.java
Date Fri, 20 Jul 2007 21:30:54 GMT
Author: jukka
Date: Fri Jul 20 14:30:54 2007
New Revision: 558156

URL: http://svn.apache.org/viewvc?view=rev&rev=558156
Log:
JCR-387: Applied patch from Michael Frericks (without the log4j->slf4j change)

Modified:
    jackrabbit/trunk/contrib/orm-persistence/src/java/org/apache/jackrabbit/core/state/orm/ORMNodeState.java

Modified: jackrabbit/trunk/contrib/orm-persistence/src/java/org/apache/jackrabbit/core/state/orm/ORMNodeState.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/contrib/orm-persistence/src/java/org/apache/jackrabbit/core/state/orm/ORMNodeState.java?view=diff&rev=558156&r1=558155&r2=558156
==============================================================================
--- jackrabbit/trunk/contrib/orm-persistence/src/java/org/apache/jackrabbit/core/state/orm/ORMNodeState.java
(original)
+++ jackrabbit/trunk/contrib/orm-persistence/src/java/org/apache/jackrabbit/core/state/orm/ORMNodeState.java
Fri Jul 20 14:30:54 2007
@@ -61,7 +61,16 @@
         getMixinTypeNames().clear();
         getParentUUIDs().clear();
         uuid = state.getNodeId().getUUID().toString();
-        parentUUID = state.getParentId().getUUID().toString();
+        
+        if (state.getParentId() != null )
+        {
+            parentUUID = state.getParentId().getUUID().toString();
+        }
+        else
+        {
+            parentUUID = null;
+        }
+        
         if (state.getNodeTypeName() != null) {
             nodeTypeName = state.getNodeTypeName().toString();
         }
@@ -144,7 +153,11 @@
     public void toPersistentNodeState(NodeState state) {
         state.setDefinitionId(NodeDefId.valueOf(getDefinitionId()));
         state.setNodeTypeName(QName.valueOf(getNodeTypeName()));
-        state.setParentId(NodeId.valueOf(getParentUUID()));
+        
+        if (getParentUUID() != null)
+        {
+            state.setParentId(NodeId.valueOf(getParentUUID()));
+        }
 
         Iterator childNodeEntryIter = getChildNodeEntries().iterator();
         while (childNodeEntryIter.hasNext()) {



Mime
View raw message