SessionCache versionSession = session.spawnSessionCache(false);
MutableCachedNode versionableNode = versionSession.mutable(versionedKey);
PropertyFactory props = propertyFactory();
ReferenceFactory refFactory = session.referenceFactory();
Reference historyRef = refFactory.create(historyKey, true);
Reference baseVersionRef = refFactory.create(version.getKey(), true);
versionableNode.setProperty(versionSession, props.create(JcrLexicon.VERSION_HISTORY, historyRef));
versionableNode.setProperty(versionSession, props.create(JcrLexicon.BASE_VERSION, baseVersionRef));
versionableNode.setProperty(versionSession, props.create(JcrLexicon.IS_CHECKED_OUT, Boolean.FALSE));
// The 'jcr:predecessors' set to an empty array, per Section 15.2 in JSR-283
versionableNode.setProperty(versionSession, props.create(JcrLexicon.PREDECESSORS, new Object[] {}));