code: private void addCompositeIdToColumns(MetamodelImpl metamodel, EmbeddableType compoundKey, List<String> columns,
          Field field) {
          if (!ReflectUtils.isTransientOrStatic(field)) {
              Attribute compositeColumn = compoundKey.getAttribute(field.getName());
              if (compositeColumn.getJavaType().isAnnotationPresent(Embeddable.class)) {
                  // partition key
                  EmbeddableType partitionCol = metamodel.embeddable(compositeColumn.getJavaType());
                  Set<Attribute> cols = partitionCol.getAttributes();
                  for (Attribute col : cols) {
                      Field f = (Field) col.getJavaMember();
                      if (!ReflectUtils.isTransientOrStatic(f)) {
                          columns.add(((AbstractAttribute) col).getJPAColumnName());
                      }
                  }
              } else {
                  columns.add(((AbstractAttribute) compositeColumn).getJPAColumnName());
              }
          }
      }
docs: Adds the composite id to columns.
  
  @param metamodel
  the metamodel
  @param compoundKey
  the compound key
  @param columns
  the columns
  @param field
  the field