Can Spring JPA projections have Collections? : <p>I have a Customer entity from which I only want to select a few fields and their associated CustomerAddresses. I've defined a Spring Data JPA projection interface as follows:</p>

<pre><code>public interface CustomerWithAddresses {
    Integer getId();
    String getFirstName();
    String getLastName();
    String getBrandCode();
    String getCustomerNumber();
    Set&lt;CustomerAddress&gt; getCustomerAddresses();
}
</code></pre>

<p>But from my Repository method:</p>

<pre><code>CustomerWithAddresses findCustomerWithAddressesById(@Param("id") Integer id);
</code></pre>

<p>I keep getting NonUniqueResultException for Customers with multiple CustomerAddresses. Do projections have to have a flat structure, i.e. they don't support Collections the same way true Entities do?</p>
