catchAndRethrow
Catch exceptions during SQL execution and re-throw them as RuntimeExceptions
Configuration Options
Option: ’true'
The default value for catchAndRethrow is true. This will catch any SQLException that happen during SQL execution and re-throw them as RuntimeExceptions.
package com.example.persistence;
public class SomeRepository {
public void writeSome() {
// ... some code
}
// ... rest of generated code
}
Option: ‘false’
In case you want to handle SQLExceptions yourself, set catchAndRethrow to false.
package com.example.persistence;
import java.sql.SQLException;
public class SomeRepository {
public void writeSome() throws SQLException {
// ... some code
}
// ... rest of generated code
}
Related Options
Also in this group: annotations , createConnection , description , executeBatch , executeOnce , generateConnectionOverloads , generateResultRowType , injectConverter , name , parameters , repository , resultRowColumns , resultRowConverter , resultRowType , returningMode , throwOnMultipleResults , type , validateSchema , vendor , writesReturnUpdateCount .
Front Matter
In order to configure this option, place the following code in the front matter of your SQL statement:
-- catchAndRethrow: true
SELECT something
FROM your_database_schema
WHERE some_column = :some_value