Y
Y
Yasuro2019-10-25 17:08:59
Spring
Yasuro, 2019-10-25 17:08:59

How to read queries from files?

I have a repository like this:

public interface MyObjectRepository extends ArangoRepository<MyObject, String>{
    @Query("  REMOVE { _key: @key } IN mt_objects\n" +
                "  return OLD ")
        MyObject deleteByKey(@Param("key") String key);

}

I would like to put Query in a separate file. And I want to use different files for different repositories. If I used sql, I would use my own .sql file for each repository, in which I could conveniently format queries.
I know about EnableArangoRepositories#namedQueriesLocation() but in this case I can only use one file per application.
I use springboot and arangoDB

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question