@SqlConfig

@SqlConfig 定義了用於決定如何解析和執行使用 @Sql 註解配置的 SQL 腳本的元數據。以下範例示範如何使用它

  • Java

  • Kotlin

@Test
@Sql(
	scripts = "/test-user-data.sql",
	config = @SqlConfig(commentPrefix = "`", separator = "@@") (1)
)
void userTest() {
	// run code that relies on the test data
}
1 設定 SQL 腳本中的註解前缀和分隔符號。
@Test
@Sql("/test-user-data.sql", config = SqlConfig(commentPrefix = "`", separator = "@@")) (1)
fun userTest() {
	// run code that relies on the test data
}
1 設定 SQL 腳本中的註解前缀和分隔符號。