1

So, the case is the following.

I have a piece of code that looks like this:

public interface CustomRepo extends CrudRepository<CustomEntity, Long> {    
    @Query(value = "select * from custom")
    public List<CustomEntity> findAll();
}

Together with @EnableJDBCRepositories in my @Configuration file, this allows me to execute the custom query in JDBC natively.

Now, what I need is to substitute that

value = "select * from custom" 

with something like this:

value = "query.one"

where "query.one" is the placeholder for a property in a .properties file that looks like this:

query.one=select * from custom;

How could I accomplish that?

barbsan
  • 3,418
  • 11
  • 21
  • 28

1 Answers1

0

I see two options:

  1. Do a custom implementation

  2. The alternative is you take a look at the issue for pretty much exactly this: DATAJDBC-234 and create a PR for that. If you need help on how to get started feel free to ask in a comment on the issue.

Jens Schauder
  • 77,657
  • 34
  • 181
  • 348