[
https://issues.apache.org/jira/browse/DELTASPIKE-1352?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18012156#comment-18012156
]
Mark Struberg commented on DELTASPIKE-1352:
-------------------------------------------
[~tandraschko] isn't this already implemented with the EntityCountRepository?
> Support count in Criteria
> -------------------------
>
> Key: DELTASPIKE-1352
> URL: https://issues.apache.org/jira/browse/DELTASPIKE-1352
> Project: DeltaSpike
> Issue Type: New Feature
> Components: Data-Module
> Reporter: mojo code
> Priority: Minor
>
> Hi. I'm filtering using "Criteria" by some conditions It works correctly and
> get the list of item that meets the conditions. I would like to get the count
> of items which meets the conditions without getting this list in memory, I
> just want to query this count number.
> Thanks in advance.
> ""
> int findUserByCriteria(String name, Boolean active, Integer idrol){
> Criteria<User, User> c = criteria();
>
> if(name != null)
> c.likeIgnoreCase(User_.name, name + "%");
>
> if(active != null)
> c.eq(User_.active, active);
>
> if(idrol != null)
> c.eq(User_.idRol, idrol);
> .....
> {color:#ff0000} int count = ¿?{color}
> .....
> return count;
> }
> ""
--
This message was sent by Atlassian Jira
(v8.20.10#820010)