FAQ
Hi all, and a very happy Friday to you.

How would I go about counting distinct related objects using EJBQL? If I want to count the number of “Shops" related to “Receipts", I’d expect to be able to do use EJBQL like this, which works fine for regular attributes:

SELECT count(distinct a.shop) FROM Receipt a

However, this generates the incorrect SQL

SELECT COUNT(DISTINCT *) AS sc0 FROM smu.fd_receipt t0 INNER JOIN smu.fd_shop t1 ON (t0.shop_id = t1.id)

Any ideas? I’m using the 4.0M3-SNAPSHOT release.

Cheers,
- hugi

Search Discussions

Discussion Posts

Follow ups

Related Discussions

Discussion Navigation
viewthread | post
posts ‹ prev | 1 of 3 | next ›
Discussion Overview
groupuser @
categoriescayenne
postedOct 30, '15 at 1:45p
activeNov 9, '15 at 11:32a
posts3
users2
websitecayenne.apache.org

People

Translate

site design / logo © 2021 Grokbase