@@ -186,7 +186,9 @@ public class MySqlStoredProcedureIntegrationTests {
|
||||
List<Employee> entityListFromNamedProcedure();
|
||||
}
|
||||
|
||||
@EnableJpaRepositories(considerNestedRepositories = true, basePackageClasses = Config.class,
|
||||
@EnableJpaRepositories( //
|
||||
considerNestedRepositories = true, //
|
||||
basePackageClasses = Config.class, //
|
||||
includeFilters = @Filter(type = FilterType.ASSIGNABLE_TYPE, classes = EmployeeRepositoryWithNoCursor.class))
|
||||
@EnableTransactionManagement
|
||||
static class Config {
|
||||
@@ -194,14 +196,16 @@ public class MySqlStoredProcedureIntegrationTests {
|
||||
@SuppressWarnings("resource")
|
||||
@Bean(initMethod = "start")
|
||||
public MySQLContainer<?> container() {
|
||||
|
||||
return new MySQLContainer<>("mysql:8.0.24") //
|
||||
.withUsername("test") //
|
||||
.withPassword("test") //
|
||||
.withConfigurationOverride("");
|
||||
.withUsername("test") //
|
||||
.withPassword("test") //
|
||||
.withConfigurationOverride("");
|
||||
}
|
||||
|
||||
@Bean
|
||||
public DataSource dataSource(MySQLContainer<?> container) {
|
||||
|
||||
MysqlDataSource dataSource = new MysqlDataSource();
|
||||
dataSource.setUrl(container.getJdbcUrl());
|
||||
dataSource.setUser(container.getUsername());
|
||||
|
||||
@@ -152,8 +152,10 @@ public class PostgresStoredProcedureIntegrationTests {
|
||||
@Entity
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
@NamedStoredProcedureQuery(name = "get_employees_postgres", procedureName = "get_employees",
|
||||
parameters = { @StoredProcedureParameter(mode = ParameterMode.REF_CURSOR, type = void.class) },
|
||||
@NamedStoredProcedureQuery( //
|
||||
name = "get_employees_postgres", //
|
||||
procedureName = "get_employees", //
|
||||
parameters = { @StoredProcedureParameter(mode = ParameterMode.REF_CURSOR, type = void.class) }, //
|
||||
resultClasses = Employee.class)
|
||||
public static class Employee {
|
||||
|
||||
@@ -197,12 +199,14 @@ public class PostgresStoredProcedureIntegrationTests {
|
||||
@SuppressWarnings("resource")
|
||||
@Bean(initMethod = "start")
|
||||
public PostgreSQLContainer<?> container() {
|
||||
|
||||
return new PostgreSQLContainer<>("postgres:9.6.12") //
|
||||
.withUsername("postgres");
|
||||
}
|
||||
|
||||
@Bean
|
||||
public DataSource dataSource(PostgreSQLContainer<?> container) {
|
||||
|
||||
PGSimpleDataSource dataSource = new PGSimpleDataSource();
|
||||
dataSource.setUrl(container.getJdbcUrl());
|
||||
dataSource.setUser(container.getUsername());
|
||||
|
||||
Reference in New Issue
Block a user