+ final NormalizedNode<?, ?> data, final SchemaContext schemaContext) {
+ if (data instanceof MapNode || data instanceof LeafSetNode) {
+ final NormalizedNode<?, ?> emptySubTree = ImmutableNodes.fromInstanceId(schemaContext, path);
+ merge(LogicalDatastoreType.CONFIGURATION, YangInstanceIdentifier.create(emptySubTree.getIdentifier()),
+ emptySubTree);
+ TransactionUtil.ensureParentsByMerge(path, schemaContext, this);
+
+ final Collection<? extends NormalizedNode<?, ?>> children =
+ ((NormalizedNodeContainer<?, ?, ?>) data).getValue();
+ final BatchedExistenceCheck check =
+ BatchedExistenceCheck.start(this, LogicalDatastoreType.CONFIGURATION, path, children);
+
+ for (final NormalizedNode<?, ?> child : children) {
+ final YangInstanceIdentifier childPath = path.node(child.getIdentifier());
+ rwTx.put(store, childPath, child);
+ }
+
+ // ... finally collect existence checks and abort the transaction if any of them failed.
+ checkExistence(path, check);
+ } else {
+ checkItemDoesNotExists(this, LogicalDatastoreType.CONFIGURATION, path);
+ TransactionUtil.ensureParentsByMerge(path, schemaContext, this);
+ rwTx.put(store, path, data);
+ }