title: get @ElementCollection entries with Querydsl
body: <p>I have an @Entity class which holds an @ElementCollection:</p>
  
  <pre><code>@Entity
  public class Skill extends JpaEntity {
    @ElementCollection(targetClass = SkillName.class)
    @CollectionTable(joinColumns = @JoinColumn(name = "SKILL_ID"))
    private Set&lt;SkillName&gt; names = new HashSet&lt;&gt;();
  ...
  </code></pre>
  
  <p>Those elements are defined in a nested @Embeddable class without ID:</p>
  
  <pre><code>  @Embeddable
    @Immutable
    @Table(uniqueConstraints = @UniqueConstraint(columnNames = "NAME"))
    public static class SkillName extends ValueObject {
      private boolean selectable;
      @Column(unique = true, nullable = false)
      @Size(max = 64)
      @NotEmpty
      private String name;
  ...
  </code></pre>
  
  <p>I try to get some specific elements of that element-collection via Querydsl:</p>
  
  <pre><code>    QSkill skill = QSkill.skill;
      QSkill_SkillName skillName = QSkill_SkillName.skillName;
  
      List&lt;SkillName&gt; foundSkillNames = from(skill)
      .innerJoin(skill.names, skillName).where(...)
      .list(skillName);
  </code></pre>
  
  <p>This gives me a MySQLSyntaxErrorException: Unknown column 'names1_.id' in 'field list' since the resulting query looks like:</p>
  
  <pre><code>select names1_.id as col_0_0_ from Skill skill0_ inner join Skill_names names1_ on ...
  </code></pre>
  
  <p>which is obviously wrong since SkillName has no id</p>
  
  <p>If I replace .list(skillName) with .list(skillName.name) everything works fine, but I get a list of Strings instead of a list of SkillNames.</p>
  
  <p><strong>So the question is:</strong>
  What can I do to get a list of @Embeddables of an @ElementCollection via Querydsl?</p>