Skip to content
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

Failing Tests with CustomerFindController #3270

Merged

Conversation

nPraml
Copy link
Contributor

@nPraml nPraml commented Nov 14, 2023

Hello @rob-bygrave,

we discovered an issue with BeanFindController and findSingleAttribute queries.
If there is a BeanFindController, every property is selected in DefaultServer.BuildQueryRequest. The produced queries and the results are wrong:

TestQuerySingleAttribute.distinctWithFetch:329
Expecting actual:
  "select distinct t0.status, t0.name, t0.smallnote, t0.anniversary, t0.cretime, t0.updtime, t0.version, t0.shipping_address_id, t1.city from o_customer t0 left join o_address t1 on t1.id = t0.billing_address_id"
to contain:
  "select distinct t1.city from o_customer t0 left join o_address t1 on t1.id = t0.billing_address_id"

TestQuerySingleAttribute.findSingleWithFetch:402
Expecting ArrayList:
  [NEW, NEW, ACTIVE, ACTIVE, NEW, NEW, NEW, NEW, NEW, NEW]
to contain:
  ["Auckland"]
but could not find the following element(s):
  ["Auckland"]

Can you tell me why will all properties from t0 be selected when there is a BeanFindController present?
FYI: we use a BeanFindController with postProcess/postProcessMany and the other methods return the default (false or null) values.

Kind regards,
Noemi

rbygrave added a commit that referenced this pull request Nov 21, 2023
The existence of a BeanFindController should not break the use of
single attribute queries + still allow auto-tuning.
@rbygrave rbygrave merged commit 496ef36 into ebean-orm:master Nov 21, 2023
1 check failed
@rbygrave rbygrave self-assigned this Nov 21, 2023
@rbygrave rbygrave added the bug label Nov 21, 2023
@rbygrave rbygrave added this to the 13.25.1 milestone Nov 21, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants