Skip to content

Named queries length #4053

@steviemul

Description

@steviemul

I really like the ability to used named queries in Spring Boot JPA, however sometimes the method names can get very lengthy.

Suggestion to be able to alias a method in a repository to shorten the name.

For example

Instead of having a method like
public List<Customer> getCustomerByNameAndAddressSortByDataOfBirthDesc() {}

Could we reuse the named method functionality to allow the named query without having to explicity define the query, so something like

@Alias(for = "getCustomerByNameAndAddressSortByDataOfBirthDesc")
public List<Customer> getCustomers() {}

Just a thought

Metadata

Metadata

Assignees

No one assigned

    Labels

    status: declinedA suggestion or change that we don't feel we should currently apply

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions