Hello Johannes

You're probably looking for [1] with [2] which looks like
QueryResult<E> findByFlagIsNotNull() and
repository.findByFlagIsNotNull().count();

Hope that helps,
Thomas

[1] http://deltaspike.apache.org/documentation/data.html#QueryOptions21
[2]
http://deltaspike.apache.org/javadoc/1.4.2/org/apache/deltaspike/data/api/QueryResult.html#count--


On Tue, Nov 3, 2015 at 8:43 AM, Johannes Häyry <[email protected]>
wrote:

> Hello,
> Is it possible to use generated query for count and if so, how is it done?
> I was expecting Long countByFlagIsNotNull() to work, but instead I had to
> add Query annotation like this:
> @Query("select count(m) from Message m where m.flag is not null")
>
> /Johannes
>
> --
> Johannes Häyry, Vaadin Expert
> Vaadin.com <https://vaadin.com> - +358 443 564 403 - skype:johannes_vaadin
>

Reply via email to