klcodanr commented on a change in pull request #46: SlingModelPersistor:
Improvements for compatibility and additional Ignore features, several bug fixes
URL: https://github.com/apache/sling-whiteboard/pull/46#discussion_r330152538
##########
File path:
SlingModelPersist/src/main/java/org/apache/sling/models/persistor/impl/ModelPersistorImpl.java
##########
@@ -113,14 +113,15 @@ public void persist(final @NotNull String nodePath,
final @NotNull Object instan
// let's create the resource first
LOGGER.debug("Creating node at: {} of type: {}", nodePath,
resourceType.primaryType);
+ boolean isUpdate = resourceResolver.getResource(nodePath) != null;
resource = ResourceUtil.getOrCreateResource(resourceResolver,
nodePath, resourceType.primaryType, NT_UNSTRUCTURED, true);
if (StringUtils.isNotEmpty(resourceType.childType)) {
LOGGER.debug("Needs a child node, creating node at: {} of type:
{}", nodePath, resourceType.childType);
resource = ResourceUtil.getOrCreateResource(resourceResolver,
nodePath + "/" + JCR_CONTENT, resourceType.childType, NT_UNSTRUCTURED, true);
}
if (ReflectionUtils.isArrayOrCollection(instance)) {
- persistComplexValue(instance, true, nodePath, "dunno", resource);
+ persistComplexValue(instance, true, "dunno", resource);
Review comment:
"dunno" ?
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services