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

Open projections from FluentQuery cannot resolve beans #2984

Open
ma-hab opened this issue May 26, 2023 · 0 comments
Open

Open projections from FluentQuery cannot resolve beans #2984

ma-hab opened this issue May 26, 2023 · 0 comments
Assignees
Labels
type: bug A general bug

Comments

@ma-hab
Copy link

ma-hab commented May 26, 2023

Hello,
I'm currently using spring-data-jpa 3.0.5

Documentation mentions that we can use beans inside open projections like this

  @Value("#{@myBean.getFullName(target)}")
  String getFullName();

This works properly if we define a method that fetches that projection in repository interface.
However, this does not appear to work if we use this method like this findBy(mySpecification, q -> q.as(MyProjection.class)). In that case I get

No bean resolver registered in the context to resolve access to bean 'myBean']

This appears to be the case beacause SpelAwareProxyProjectionFactory created here never has its BeanFactory set.

I'm wondering if this is expected behavior and if it is could support for resolving beans with FluentQuery be added in the future?

@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged label May 26, 2023
@mp911de mp911de added type: bug A general bug and removed status: waiting-for-triage An issue we've not yet triaged labels May 30, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: bug A general bug
Projects
None yet
Development

No branches or pull requests

4 participants