code: List<String> getColumnList(EntityMetadata m, String[] results, EmbeddableType compoundKey)
      {
          List<String> columns = new ArrayList<String>();
          if (results != null && results.length > 0)
          {
              MetamodelImpl metaModel = (MetamodelImpl) kunderaMetadata.getApplicationMetadata().getMetamodel(
                      m.getPersistenceUnit());
              EntityType entity = metaModel.entity(m.getEntityClazz());
  
              for (int i = 1; i < results.length; i++)
              {
                  if (results[i] != null)
                  {
                      Attribute attribute = entity.getAttribute(results[i]);
  
                      if (attribute == null)
                      {
                          throw new QueryHandlerException("column type is null for: " + results);
                      }
                      else if (m.getIdAttribute().equals(attribute) && compoundKey != null)
                      {
                          Field[] fields = m.getIdAttribute().getBindableJavaType().getDeclaredFields();
                          for (Field field : fields)
                          {
                              if (!ReflectUtils.isTransientOrStatic(field))
                              {
                                  Attribute compositeColumn = compoundKey.getAttribute(field.getName());
                                  columns.add(((AbstractAttribute) compositeColumn).getJPAColumnName());
                              }
                          }
                      }
                      else
                      {
                          columns.add(((AbstractAttribute) attribute).getJPAColumnName());
                      }
                  }
              }
              return columns;
          }
  
          if (log.isInfoEnabled())
          {
              log.info("No record found, returning null.");
          }
          return null;
      }
docs: Gets the column list.
  
  @param m
  the m
  @param results
  the results
  @return the column list