如何从Spring Data中的application.properties中获取查询?
OrderRepository.java:
@Repository
public interface OrderRepository extends CrudRepository<Order, UUID> {
@Query("#{app.queryExample}") // TODO the query should come from application.properties
Set<Order> findByExampleQuery();
}
application.properties:
app.queryExample=select o from Order o