thank you so much ! Amedeo
> On 29 Apr 2017, at 16:22, Nikita Timofeev <[email protected]> wrote: > > Hi Amedeo, > > For raw queries you can use SQLTemplate, like this: > > SQLTemplate query = new SQLTemplate(MyEntity.class, "SELECT COUNT(1) > FROM MY_ENTITY"); > query.setFetchingDataRows(true); > List<DataRow> rows = (List<DataRow>) context.performQuery(query); > > You can also use aggregate functions directly with Cayenne API (since > version 4.0.M5): > > long count = ObjectSelect.query(MyEntity.class).selectCount(context); > > Hope this helps! > > On Sat, Apr 29, 2017 at 4:49 PM, Amedeo Mantica <[email protected]> wrote: >> Hi all, >> >> Ho to execute a simple raw query with cayenne ? >> >> let say: SELECT COUNT(1) FROM MY_ENTITY; >> >> Thank you >> Amedeo > > > > -- > Best regards, > Nikita Timofeev
