Skip to content

Dynamic projections for interfaces does not work #1813

Closed
@mipo256

Description

@mipo256

I've created test in the playground repo to demonstrate the issue.

The fact is - currently, the JdbcQueryCreator.complete() fails to build a SELECT clause in case of interfaces to be used in dynamic projections. The stack trace is:

java.lang.IllegalStateException: SELECT does not declare a select list

	at org.springframework.data.relational.core.sql.SelectValidator.doValidate(SelectValidator.java:57)
	at org.springframework.data.relational.core.sql.SelectValidator.validate(SelectValidator.java:49)
	at org.springframework.data.relational.core.sql.DefaultSelectBuilder.build(DefaultSelectBuilder.java:202)
	at org.springframework.data.jdbc.repository.query.JdbcQueryCreator.complete(JdbcQueryCreator.java:182)
	at org.springframework.data.jdbc.repository.query.JdbcQueryCreator.complete(JdbcQueryCreator.java:66)
	at org.springframework.data.repository.query.parser.AbstractQueryCreator.createQuery(AbstractQueryCreator.java:95)

That seems to happen only for dynamic projections, interface based projection on their own should be fine.

I think it's going to be great to add a support for this.

Metadata

Metadata

Assignees

No one assigned

    Labels

    status: invalidAn issue that we don't feel is valid

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions