code: protected NodeData getBaseVersionData(final NodeData node, final SessionImpl session) throws RepositoryException
     {
  
        NodeTypeDataManager ntManager = session.getWorkspace().getNodeTypesHolder();
        if (ntManager.isNodeType(Constants.MIX_VERSIONABLE, node.getPrimaryTypeName(), node.getMixinTypeNames()))
        {
  
           SessionDataManager dmanager = session.getTransientNodesManager();
  
           PropertyData bvProperty =
              (PropertyData)dmanager.getItemData(node, new QPathEntry(Constants.JCR_BASEVERSION, 0), ItemType.PROPERTY);
  
           return (NodeData)dmanager.getItemData(ValueDataUtil.getString(bvProperty.getValues().get(0)));
        }
  
        return null; // non versionable
     }
docs: -------------------- utils --------------------