code: private Object find(Class entityClass, Object key, List<String> columnsToSelect)
      {
          EntityMetadata entityMetadata = KunderaMetadataManager.getEntityMetadata(kunderaMetadata, entityClass);
          MetamodelImpl metamodel = (MetamodelImpl) KunderaMetadataManager.getMetamodel(kunderaMetadata,
                  entityMetadata.getPersistenceUnit());
  
          String idColumnName = ((AbstractAttribute) entityMetadata.getIdAttribute()).getJPAColumnName();
          Table schemaTable = tableAPI.getTable(entityMetadata.getTableName());
  
          PrimaryKey rowKey = schemaTable.createPrimaryKey();
          if (metamodel.isEmbeddable(entityMetadata.getIdAttribute().getBindableJavaType()))
          {
              readEmbeddable(key, columnsToSelect, entityMetadata, metamodel, schemaTable, rowKey,
                      entityMetadata.getIdAttribute());
          }
          else
          {
              if (eligibleToFetch(columnsToSelect, idColumnName))
              {
                  NoSqlDBUtils.add(schemaTable.getField(idColumnName), rowKey, key, idColumnName);
              }
          }
          KunderaCoreUtils.printQuery("Fetch data from " + entityMetadata.getTableName() + " for PK " + key, showQuery);
          if (log.isDebugEnabled())
          {
              log.debug("Fetching data from " + entityMetadata.getTableName() + " for PK " + key);
          }
  
          // Object entity = null;
          List entities = new ArrayList();
          Map<String, Object> relationMap = initialize(entityMetadata);
  
          try
          {
              Iterator<Row> rowsIter = tableAPI.tableIterator(rowKey, null, null);
              // iterator and build entity
              entities = scrollAndPopulate(key, entityMetadata, metamodel, schemaTable, rowsIter, relationMap,
                      columnsToSelect);
          }
          catch (Exception e)
          {
              log.error("Error while finding data for Key " + key + ", Caused By :" + e + ".");
              throw new PersistenceException(e);
          }
  
          return entities.isEmpty() ? null : entities.get(0);
      }
docs: Find by id.
  
  @param entityClass
  entity class
  @param key
  primary key
  @param columnsToSelect
  columns to select
  @return the object