Spring Integration - Externalizing JDBC Queries

后端 未结 2 1425
南笙
南笙 2020-12-21 15:21

Is there a simple way to externalize big sql queries from jdbc outbound gateways, instead of inlining it? The reason being that we\'re having to many big queries to make, an

2条回答
  •  予麋鹿
    予麋鹿 (楼主)
    2020-12-21 15:56

    You can define your queries in XML as spring beans:

    
        
          
              
          
        
     
    

    Using CDATA the query text can include newlines, angle brackets, etc., so it's legible and you can cut and paste it directly into a SQL tool.

    You can refer to the bean using SpEL.

提交回复
热议问题