-
Notifications
You must be signed in to change notification settings - Fork 343
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Count is not made on the primary column when it is in a joined table. #962
Comments
Hello, I'm trying to investigate it but, conceptually, isn't the result the same? In your case is not |
Thanks for your answer. No, the result was not the same, as the count is a count distinct. [001|value1] This will only count 2, while it should count 4. |
Ok, so because it's not a unique value field where |
What is your |
@MaxandreOgeret check this out https://github.com/APY/APYDataGridBundle/blob/58f4e370ba79bd7d593a3759010ab002b3946b61/Resources/doc/columns_configuration/annotations/column_annotation_property.md
|
Yes you're right. and my source is an entity Setting the field as primary do not work with the count query. The count walker, takes the primary key of the source entity, not the column set as primary. |
@MaxandreOgeret follow my last comment, it should resolve your issue. |
I tried, but it don't change anything. :/ |
Can you show me relevant code? |
I don't have the sources right now, but i'll try to give you an exemple. I have two tables :
These tables represents this tree :
Let's say customers have more than one adresses and i want to list those adresses like :
If my primary entity is CUSTOMER and max_parent comes from it, it will count only one. Tell me if you want more explanations. |
You may just check that the count request is made on the column marked as primary. |
I understand. BTW I can't guarantee that I'll take a look soon as from today I'm in vacation :) Last question: can you tell me what source are you using? |
I am using |
@MaxandreOgeret can you show me how did you excluded |
I tried : I tried to dump the column and the attribute primary id expectedly false. |
Ok, thank you. Once bug is confirmed, I will change the label and try to tackle it. Thanks for the moment. |
I'm at your service if further investigations are required. Thanks for the moment too. 🥇 |
Hello everyone.
I have a problem and I can't solve it.
I have to display a grid, containing datas from a table and a joined table.
The primary column is set correctly, but the count query is not made on this column ! It is made on the id of the first table !
Why should the primary column not be used to count? I don't understand. Is it a bug?
SELECT count(DISTINCT h0_.id) AS sclr_0 FROM hierabc h0_ INNER JOIN AdresseAll a1_ ON (h0_.idpeople= a1_.idpeople) WHERE h0_.idpeoplesup= ('XXXXXXXXXXX'');
Here h0.id, is the id of the entity selected as source. But it is not the column set as primary.
Don't hesitate to ask me anything if you need further details!
Thanks a lot for your help !!
The text was updated successfully, but these errors were encountered: