code: private List fetchEntity(Class entityClass, Object rowId, EntityMetadata entityMetadata,
              List<String> relationNames, String tableName, List results, FilterList filter, Queue filterClausequeue,
              String... columns) throws IOException
      {
          results = new ArrayList();
          List<AbstractManagedType> subManagedType = getSubManagedType(entityClass, entityMetadata);
  
          if (!subManagedType.isEmpty())
          {
              for (AbstractManagedType subEntity : subManagedType)
              {
                  EntityMetadata subEntityMetadata = KunderaMetadataManager.getEntityMetadata(kunderaMetadata,
                          subEntity.getJavaType());
                  List tempResults = handler.readData(tableName, subEntityMetadata.getEntityClazz(), subEntityMetadata,
                          rowId, subEntityMetadata.getRelationNames(), filter, columns);
                  if (tempResults != null && !tempResults.isEmpty())
                  {
                      results.addAll(tempResults);
                  }
              }
          }
          else
          {
              results = handler.readData(tableName, entityMetadata.getEntityClazz(), entityMetadata, rowId,
                      relationNames, filter, columns);
          }
          if (rowId != null)
          {
              KunderaCoreUtils.printQuery("Fetch data from " + entityMetadata.getTableName() + " for PK " + rowId,
                      showQuery);
          }
          else if (showQuery && filterClausequeue.size() > 0)
          {
              KunderaCoreUtils.printQueryWithFilterClause(filterClausequeue, entityMetadata.getTableName());
          }
  
          return results;
      }
docs: Fetch entity.
  
  @param entityClass
  the entity class
  @param rowId
  the row id
  @param entityMetadata
  the entity metadata
  @param relationNames
  the relation names
  @param tableName
  the table name
  @param results
  the results
  @param filter
  the filter
  @param filterClausequeue
  the filter clausequeue
  @param columns
  the columns
  @return the list
  @throws IOException
  Signals that an I/O exception has occurred.