Skip to content

Add support for table name placeholder for @Query in JDBC and R2DBC  #1856

Closed
@mipo256

Description

@mipo256

Currently, there is no way to reference the name of the table in the SPEL expression in @Query. The behavior I guess should be similar to one we have now in JPA. So something like this:

@Query("SELECT * FROM #{#tableName} WHERE status = #{#status.name()}")
List<MyEntity> findByStatus(Status status);

I think would be the way to go.

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions