Hi there!
Actually, what I have is something like:
@Embedable class Address { String getStreet(); int getStreetNo(); } @Entity class Contact { Collection<Address> getAddresses(); }
Now what I want to do is to select all available Customer Entites and ORDER them by the first Address - Item (if any) in the collection with a concatenated value of street + streetNo (if not null). So I want something like this:
SELECT c, a FROM Customer INNER JOIN c.addresses ORDER BY SIZE(c.addresses) > 0 ? CONCAT(c.addresses[0].street + c.addresses[1].streetNo) : null
any clue? I can't figure how to do it with regular JPA Query methodics only..
thanks!
Alex