I'm wondering if anybody knows how to get multiple counts from a single query using hibernates criteria query?
I have the following query.
List<PurchaseRequest> prs = this.session.createCriteria(PurchaseRequest.class).list();
within PurchaseRequest, I have a column called current_state. I'd like to query all the PurchaseRequest rows and group the current_states together so I can get a total count of each current_state.
States look like this, creator, authorizer, assignor. etc.
Select current_state, count(*) From PurchaseRequest Group By current_state?