Skip to content

Use Class, Enum, Constants, ... inside @Query anontation #3651

@nhaphanse

Description

@nhaphanse

Dear Team,

I hope this message finds you well.

I wanted to bring up a concern regarding the use of DTO projects, particularly when it comes to utilizing constants in @query annotations without specifying their full relative paths. For example, I currently have the following query:

@Query("select new com.food.customer.CustomerModel(c.id, c.name) " +
       "from Customer c where c.id = com.food.customer.CustomerModel.ORIGINAL")
List<CustomerModel> findCustomerModel();

While the integrator can assist to some extent, the long and often duplicated paths can be quite inconvenient in our projects.

Could you please provide support in finding a more efficient solution for this situation? Your assistance would greatly enhance our workflow.

Thank you for your help!

David

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions