spring @sqlgroup with multiple datasource -


i trying use @sql , @sqlgroup on unit test want annotation use datasource different name other default datasource.

how can achieve this?

from transaction management @sql section of spring reference manual:

if algorithms used sqlscriptstestexecutionlistener detect datasource , platformtransactionmanager , infer transaction semantics not suit needs, may specify explicit names via datasource , transactionmanager attributes of @sqlconfig.

for example:

@sqlgroup({     @sql(scripts = "script1.sql", config = @sqlconfig(datasource = "datasource1", transactionmanager = "txmgr1")),     @sql(scripts = "script2.sql", config = @sqlconfig(datasource = "datasource2", transactionmanager = "txmgr2")) }) 

regards,

sam (author of spring testcontext framework)


Comments

Popular posts from this blog

python - Mongodb How to add addtional information when aggregating? -

java - Spring Data JPA: Why findOne(id) executing delete query internally? -

java - Incorrect order of records in M-M relationship in hibernate -