Answer the question
In order to leave comments, you need to log in
How to store and get sql queries from .properties file?
How to store and get sql queries from .properties file?
Only this comes to mind))
sql.properties file
user.get.all=select * from user
@PropertySource("classpath:sql.properties")
...
@Autowired
private Environment env;
...
String sql = env.getProperty("user.get.all");
Answer the question
In order to leave comments, you need to log in
Sql queries, most likely, do not exist on their own, but are associated with some kind of model and business logic.
The model is in your code and the business logic is in the code, which means that the queries should be in the code.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question