I have created a customer table using service builder like as shown below
_ _ _ _ _ _ _ _ _ _ _
| Id | CusId | CusName |
|_ _ |_ _ _ _| _ _ _ _ |
| 11 | 215 | John |
|_ _ |_ _ _ _| _ _ _ _ |
| 12 | 206 | Lino |
|_ _ |_ _ _ _| _ _ _ _ |
| 13 | 215 | John |
|_ _ |_ _ _ _| _ _ _ _ |
| 14 | 215 | John |
|_ _ |_ _ _ _| _ _ _ _ |
| 15 | 206 | Lino |
|_ _ |_ _ _ _| _ _ _ _ |
| 16 | 207 | Nino |
|_ _ |_ _ _ _| _ _ _ _ |
My service.xml is given below
service.xml
<entity name="Customer" local-service="true" remote-service="false" json-enabled="true">
<column name="Id" type="int" primary="true"/>
<column name="CusId" type="int" />
<column name="CusName" type="String" />
<finder name="CustomerCount" return-type="Collection">
<finder-column name="CusId"/>
</finder>
</entity>
Can anyone please tell me how to generate the below output using finder
_ _ _ _ _ _ _ _
| CusId | Count |
|_ _ _ _|_ _ _ _|
| 215 | 3 |
|_ _ _ _|_ _ _ _|
| 206 | 2 |
|_ _ _ _|_ _ _ _|
| 207 | 1 |
|_ _ _ _|_ _ _ _|
I am using Liferay 6.2 and database as HSQLDB