eliminated dependency on jdbc core
This commit is contained in:
267
eclipse-code-formatter.prefs
Normal file
267
eclipse-code-formatter.prefs
Normal file
@@ -0,0 +1,267 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<profiles version="11">
|
||||||
|
<profile kind="CodeFormatterProfile" name="Spring" version="11">
|
||||||
|
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_if" value="do not insert"/>
|
||||||
|
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_colon_in_assert" value="insert"/>
|
||||||
|
<setting id="org.eclipse.jdt.core.formatter.brace_position_for_enum_constant" value="end_of_line"/>
|
||||||
|
<setting id="org.eclipse.jdt.core.formatter.align_type_members_on_columns" value="false"/>
|
||||||
|
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_semicolon" value="do not insert"/>
|
||||||
|
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_colon_in_case" value="do not insert"/>
|
||||||
|
<setting id="org.eclipse.jdt.core.formatter.comment.format_line_comments" value="true"/>
|
||||||
|
<setting id="org.eclipse.jdt.core.formatter.number_of_empty_lines_to_preserve" value="1"/>
|
||||||
|
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_switch" value="do not insert"/>
|
||||||
|
<setting id="org.eclipse.jdt.core.formatter.insert_space_between_brackets_in_array_type_reference" value="do not insert"/>
|
||||||
|
<setting id="org.eclipse.jdt.core.formatter.blank_lines_between_type_declarations" value="1"/>
|
||||||
|
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_parenthesized_expression_in_return" value="insert"/>
|
||||||
|
<setting id="org.eclipse.jdt.core.formatter.insert_new_line_in_empty_method_body" value="insert"/>
|
||||||
|
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_annotation_type_declaration" value="insert"/>
|
||||||
|
<setting id="org.eclipse.jdt.core.formatter.indent_statements_compare_to_body" value="true"/>
|
||||||
|
<setting id="org.eclipse.jdt.core.formatter.insert_new_line_after_opening_brace_in_array_initializer" value="do not insert"/>
|
||||||
|
<setting id="org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_member" value="insert"/>
|
||||||
|
<setting id="org.eclipse.jdt.core.formatter.format_guardian_clause_on_one_line" value="false"/>
|
||||||
|
<setting id="org.eclipse.jdt.core.formatter.comment.insert_new_line_before_root_tags" value="do not insert"/>
|
||||||
|
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_colon_in_for" value="insert"/>
|
||||||
|
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_parameters" value="do not insert"/>
|
||||||
|
<setting id="org.eclipse.jdt.core.formatter.tabulation.size" value="4"/>
|
||||||
|
<setting id="org.eclipse.jdt.core.formatter.blank_lines_before_imports" value="1"/>
|
||||||
|
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_colon_in_case" value="insert"/>
|
||||||
|
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_enum_constant_arguments" value="do not insert"/>
|
||||||
|
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_binary_operator" value="insert"/>
|
||||||
|
<setting id="org.eclipse.jdt.core.formatter.continuation_indentation" value="2"/>
|
||||||
|
<setting id="org.eclipse.jdt.core.formatter.blank_lines_before_new_chunk" value="1"/>
|
||||||
|
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_constructor_declaration_parameters" value="insert"/>
|
||||||
|
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_for" value="do not insert"/>
|
||||||
|
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_superinterfaces" value="do not insert"/>
|
||||||
|
<setting id="org.eclipse.jdt.core.formatter.alignment_for_assignment" value="0"/>
|
||||||
|
<setting id="org.eclipse.jdt.core.formatter.alignment_for_parameters_in_method_declaration" value="16"/>
|
||||||
|
<setting id="org.eclipse.jdt.core.formatter.blank_lines_before_member_type" value="1"/>
|
||||||
|
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_constructor_declaration_throws" value="do not insert"/>
|
||||||
|
<setting id="org.eclipse.jdt.core.formatter.alignment_for_conditional_expression" value="80"/>
|
||||||
|
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_while" value="insert"/>
|
||||||
|
<setting id="org.eclipse.jdt.core.formatter.comment.indent_parameter_description" value="false"/>
|
||||||
|
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_declaration_throws" value="insert"/>
|
||||||
|
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_allocation_expression" value="insert"/>
|
||||||
|
<setting id="org.eclipse.jdt.core.formatter.comment.format_html" value="false"/>
|
||||||
|
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_enum_constant" value="do not insert"/>
|
||||||
|
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_annotation" value="do not insert"/>
|
||||||
|
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_parameterized_type_reference" value="do not insert"/>
|
||||||
|
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_enum_declarations" value="insert"/>
|
||||||
|
<setting id="org.eclipse.jdt.core.formatter.comment.format_source_code" value="true"/>
|
||||||
|
<setting id="org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_declaration" value="do not insert"/>
|
||||||
|
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_colon_in_conditional" value="insert"/>
|
||||||
|
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_question_in_conditional" value="insert"/>
|
||||||
|
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_unary_operator" value="do not insert"/>
|
||||||
|
<setting id="org.eclipse.jdt.core.formatter.indentation.size" value="4"/>
|
||||||
|
<setting id="org.eclipse.jdt.core.formatter.insert_new_line_in_empty_annotation_declaration" value="insert"/>
|
||||||
|
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_multiple_local_declarations" value="insert"/>
|
||||||
|
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_postfix_operator" value="do not insert"/>
|
||||||
|
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_enum_constant_arguments" value="insert"/>
|
||||||
|
<setting id="org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_enum_declaration" value="16"/>
|
||||||
|
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_semicolon_in_for" value="do not insert"/>
|
||||||
|
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_constructor_declaration" value="do not insert"/>
|
||||||
|
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation_type_declaration" value="do not insert"/>
|
||||||
|
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_explicitconstructorcall_arguments" value="insert"/>
|
||||||
|
<setting id="org.eclipse.jdt.core.formatter.brace_position_for_anonymous_type_declaration" value="end_of_line"/>
|
||||||
|
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_type_declaration" value="insert"/>
|
||||||
|
<setting id="org.eclipse.jdt.core.formatter.lineSplit" value="120"/>
|
||||||
|
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_block" value="insert"/>
|
||||||
|
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_invocation_arguments" value="do not insert"/>
|
||||||
|
<setting id="org.eclipse.jdt.core.formatter.insert_new_line_in_empty_type_declaration" value="insert"/>
|
||||||
|
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_while" value="do not insert"/>
|
||||||
|
<setting id="org.eclipse.jdt.core.formatter.comment.clear_blank_lines_in_block_comment" value="false"/>
|
||||||
|
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_enum_constant" value="insert"/>
|
||||||
|
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_at_in_annotation_type_declaration" value="insert"/>
|
||||||
|
<setting id="org.eclipse.jdt.core.formatter.insert_new_line_in_empty_enum_constant" value="insert"/>
|
||||||
|
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_arguments" value="do not insert"/>
|
||||||
|
<setting id="org.eclipse.jdt.core.formatter.insert_new_line_before_closing_brace_in_array_initializer" value="do not insert"/>
|
||||||
|
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_parameters" value="do not insert"/>
|
||||||
|
<setting id="org.eclipse.jdt.core.formatter.brace_position_for_array_initializer" value="end_of_line"/>
|
||||||
|
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_cast" value="do not insert"/>
|
||||||
|
<setting id="org.eclipse.jdt.core.formatter.alignment_for_superclass_in_type_declaration" value="16"/>
|
||||||
|
<setting id="org.eclipse.jdt.core.formatter.insert_new_line_in_empty_enum_declaration" value="insert"/>
|
||||||
|
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_synchronized" value="do not insert"/>
|
||||||
|
<setting id="org.eclipse.jdt.core.formatter.comment.format_header" value="false"/>
|
||||||
|
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_colon_in_for" value="insert"/>
|
||||||
|
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation" value="do not insert"/>
|
||||||
|
<setting id="org.eclipse.jdt.core.formatter.insert_new_line_before_else_in_if_statement" value="do not insert"/>
|
||||||
|
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_method_declaration" value="do not insert"/>
|
||||||
|
<setting id="org.eclipse.jdt.core.formatter.alignment_for_arguments_in_explicit_constructor_call" value="16"/>
|
||||||
|
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_allocation_expression" value="do not insert"/>
|
||||||
|
<setting id="org.eclipse.jdt.core.formatter.alignment_for_multiple_fields" value="16"/>
|
||||||
|
<setting id="org.eclipse.jdt.core.formatter.insert_new_line_at_end_of_file_if_missing" value="do not insert"/>
|
||||||
|
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_explicitconstructorcall_arguments" value="do not insert"/>
|
||||||
|
<setting id="org.eclipse.jdt.core.formatter.insert_new_line_in_empty_block" value="insert"/>
|
||||||
|
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_closing_paren_in_cast" value="insert"/>
|
||||||
|
<setting id="org.eclipse.jdt.core.formatter.insert_new_line_before_finally_in_try_statement" value="do not insert"/>
|
||||||
|
<setting id="org.eclipse.jdt.core.formatter.keep_then_statement_on_same_line" value="false"/>
|
||||||
|
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_binary_operator" value="insert"/>
|
||||||
|
<setting id="org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_annotation_declaration_header" value="true"/>
|
||||||
|
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_constructor_declaration" value="insert"/>
|
||||||
|
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_method_declaration" value="do not insert"/>
|
||||||
|
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_declaration_parameters" value="do not insert"/>
|
||||||
|
<setting id="org.eclipse.jdt.core.formatter.alignment_for_expressions_in_array_initializer" value="16"/>
|
||||||
|
<setting id="org.eclipse.jdt.core.formatter.brace_position_for_method_declaration" value="end_of_line"/>
|
||||||
|
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_enum_constant" value="do not insert"/>
|
||||||
|
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_arguments" value="do not insert"/>
|
||||||
|
<setting id="org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_annotation_type_member_declaration" value="do not insert"/>
|
||||||
|
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_parameterized_type_reference" value="do not insert"/>
|
||||||
|
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_annotation_type_member_declaration" value="do not insert"/>
|
||||||
|
<setting id="org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_method_declaration" value="16"/>
|
||||||
|
<setting id="org.eclipse.jdt.core.formatter.blank_lines_before_field" value="0"/>
|
||||||
|
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_method_declaration" value="do not insert"/>
|
||||||
|
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_constructor_declaration_parameters" value="do not insert"/>
|
||||||
|
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_parameters" value="insert"/>
|
||||||
|
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_switch" value="insert"/>
|
||||||
|
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_bracket_in_array_allocation_expression" value="do not insert"/>
|
||||||
|
<setting id="org.eclipse.jdt.core.formatter.comment.format_javadoc_comments" value="true"/>
|
||||||
|
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_annotation" value="do not insert"/>
|
||||||
|
<setting id="org.eclipse.jdt.core.formatter.comment.format_block_comments" value="true"/>
|
||||||
|
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_array_initializer" value="insert"/>
|
||||||
|
<setting id="org.eclipse.jdt.core.formatter.insert_new_line_in_empty_anonymous_type_declaration" value="insert"/>
|
||||||
|
<setting id="org.eclipse.jdt.core.formatter.alignment_for_binary_expression" value="16"/>
|
||||||
|
<setting id="org.eclipse.jdt.core.formatter.insert_space_between_empty_braces_in_array_initializer" value="do not insert"/>
|
||||||
|
<setting id="org.eclipse.jdt.core.formatter.wrap_before_binary_operator" value="true"/>
|
||||||
|
<setting id="org.eclipse.jdt.core.formatter.blank_lines_after_package" value="1"/>
|
||||||
|
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_colon_in_labeled_statement" value="do not insert"/>
|
||||||
|
<setting id="org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_type_declaration" value="16"/>
|
||||||
|
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_catch" value="insert"/>
|
||||||
|
<setting id="org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode" value="enabled"/>
|
||||||
|
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_semicolon_in_for" value="insert"/>
|
||||||
|
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_and_in_type_parameter" value="insert"/>
|
||||||
|
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_catch" value="do not insert"/>
|
||||||
|
<setting id="org.eclipse.jdt.core.formatter.blank_lines_between_import_groups" value="1"/>
|
||||||
|
<setting id="org.eclipse.jdt.core.formatter.insert_new_line_before_while_in_do_statement" value="do not insert"/>
|
||||||
|
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_declaration_throws" value="do not insert"/>
|
||||||
|
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_prefix_operator" value="do not insert"/>
|
||||||
|
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_ellipsis" value="do not insert"/>
|
||||||
|
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_question_in_wildcard" value="do not insert"/>
|
||||||
|
<setting id="org.eclipse.jdt.core.formatter.brace_position_for_constructor_declaration" value="end_of_line"/>
|
||||||
|
<setting id="org.eclipse.jdt.core.formatter.comment.clear_blank_lines_in_javadoc_comment" value="false"/>
|
||||||
|
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_parameters" value="do not insert"/>
|
||||||
|
<setting id="org.eclipse.jdt.core.formatter.alignment_for_arguments_in_allocation_expression" value="16"/>
|
||||||
|
<setting id="org.eclipse.jdt.core.formatter.blank_lines_after_imports" value="1"/>
|
||||||
|
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_colon_in_conditional" value="insert"/>
|
||||||
|
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_enum_declaration" value="insert"/>
|
||||||
|
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_parameterized_type_reference" value="insert"/>
|
||||||
|
<setting id="org.eclipse.jdt.core.formatter.insert_new_line_before_catch_in_try_statement" value="do not insert"/>
|
||||||
|
<setting id="org.eclipse.jdt.core.compiler.problem.assertIdentifier" value="error"/>
|
||||||
|
<setting id="org.eclipse.jdt.core.formatter.brace_position_for_block_in_case" value="end_of_line"/>
|
||||||
|
<setting id="org.eclipse.jdt.core.formatter.alignment_for_arguments_in_enum_constant" value="16"/>
|
||||||
|
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_for_increments" value="do not insert"/>
|
||||||
|
<setting id="org.eclipse.jdt.core.formatter.brace_position_for_enum_declaration" value="end_of_line"/>
|
||||||
|
<setting id="org.eclipse.jdt.core.formatter.blank_lines_before_first_class_body_declaration" value="0"/>
|
||||||
|
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_for" value="insert"/>
|
||||||
|
<setting id="org.eclipse.jdt.core.formatter.keep_else_statement_on_same_line" value="false"/>
|
||||||
|
<setting id="org.eclipse.jdt.core.formatter.indent_empty_lines" value="false"/>
|
||||||
|
<setting id="org.eclipse.jdt.core.formatter.comment.insert_new_line_for_parameter" value="do not insert"/>
|
||||||
|
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_parenthesized_expression_in_throw" value="insert"/>
|
||||||
|
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_while" value="do not insert"/>
|
||||||
|
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_closing_brace_in_block" value="insert"/>
|
||||||
|
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_for_increments" value="insert"/>
|
||||||
|
<setting id="org.eclipse.jdt.core.compiler.source" value="1.5"/>
|
||||||
|
<setting id="org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_enum_declaration_header" value="true"/>
|
||||||
|
<setting id="org.eclipse.jdt.core.formatter.comment.line_length" value="120"/>
|
||||||
|
<setting id="org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_constructor_declaration" value="do not insert"/>
|
||||||
|
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_prefix_operator" value="do not insert"/>
|
||||||
|
<setting id="org.eclipse.jdt.core.formatter.brace_position_for_type_declaration" value="end_of_line"/>
|
||||||
|
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_assignment_operator" value="insert"/>
|
||||||
|
<setting id="org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_parameter" value="do not insert"/>
|
||||||
|
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_method_invocation" value="do not insert"/>
|
||||||
|
<setting id="org.eclipse.jdt.core.compiler.compliance" value="1.5"/>
|
||||||
|
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_arguments" value="do not insert"/>
|
||||||
|
<setting id="org.eclipse.jdt.core.formatter.compact_else_if" value="true"/>
|
||||||
|
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_enum_declarations" value="do not insert"/>
|
||||||
|
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_reference" value="do not insert"/>
|
||||||
|
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_question_in_conditional" value="insert"/>
|
||||||
|
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_parameters" value="do not insert"/>
|
||||||
|
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_method_invocation" value="do not insert"/>
|
||||||
|
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_arguments" value="insert"/>
|
||||||
|
<setting id="org.eclipse.jdt.core.formatter.use_tabs_only_for_leading_indentations" value="false"/>
|
||||||
|
<setting id="org.eclipse.jdt.core.formatter.brace_position_for_switch" value="end_of_line"/>
|
||||||
|
<setting id="org.eclipse.jdt.core.formatter.alignment_for_parameters_in_constructor_declaration" value="16"/>
|
||||||
|
<setting id="org.eclipse.jdt.core.formatter.insert_space_between_empty_brackets_in_array_allocation_expression" value="do not insert"/>
|
||||||
|
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_for" value="do not insert"/>
|
||||||
|
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_constructor_declaration" value="do not insert"/>
|
||||||
|
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_annotation" value="insert"/>
|
||||||
|
<setting id="org.eclipse.jdt.core.formatter.number_of_blank_lines_at_beginning_of_method_body" value="0"/>
|
||||||
|
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_synchronized" value="insert"/>
|
||||||
|
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_parameterized_type_reference" value="do not insert"/>
|
||||||
|
<setting id="org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_switch" value="false"/>
|
||||||
|
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_constructor_declaration" value="do not insert"/>
|
||||||
|
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_annotation" value="do not insert"/>
|
||||||
|
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_if" value="do not insert"/>
|
||||||
|
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_colon_in_default" value="do not insert"/>
|
||||||
|
<setting id="org.eclipse.jdt.core.compiler.problem.enumIdentifier" value="error"/>
|
||||||
|
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_annotation" value="do not insert"/>
|
||||||
|
<setting id="org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_enum_constant" value="do not insert"/>
|
||||||
|
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_bracket_in_array_reference" value="do not insert"/>
|
||||||
|
<setting id="org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_local_variable" value="insert"/>
|
||||||
|
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_type_reference" value="do not insert"/>
|
||||||
|
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_catch" value="do not insert"/>
|
||||||
|
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_array_initializer" value="insert"/>
|
||||||
|
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_synchronized" value="do not insert"/>
|
||||||
|
<setting id="org.eclipse.jdt.core.formatter.keep_empty_array_initializer_on_one_line" value="false"/>
|
||||||
|
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_switch" value="do not insert"/>
|
||||||
|
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_bracket_in_array_reference" value="do not insert"/>
|
||||||
|
<setting id="org.eclipse.jdt.core.compiler.codegen.targetPlatform" value="1.5"/>
|
||||||
|
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_brace_in_array_initializer" value="insert"/>
|
||||||
|
<setting id="org.eclipse.jdt.core.formatter.alignment_for_compact_if" value="16"/>
|
||||||
|
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_question_in_wildcard" value="do not insert"/>
|
||||||
|
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_colon_in_assert" value="insert"/>
|
||||||
|
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_ellipsis" value="insert"/>
|
||||||
|
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_method_declaration" value="insert"/>
|
||||||
|
<setting id="org.eclipse.jdt.core.formatter.alignment_for_arguments_in_qualified_allocation_expression" value="16"/>
|
||||||
|
<setting id="org.eclipse.jdt.core.formatter.indent_statements_compare_to_block" value="true"/>
|
||||||
|
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_parenthesized_expression" value="do not insert"/>
|
||||||
|
<setting id="org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_type_header" value="true"/>
|
||||||
|
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_arguments" value="do not insert"/>
|
||||||
|
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_parameters" value="insert"/>
|
||||||
|
<setting id="org.eclipse.jdt.core.formatter.keep_imple_if_on_one_line" value="false"/>
|
||||||
|
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_multiple_local_declarations" value="do not insert"/>
|
||||||
|
<setting id="org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_invocation" value="do not insert"/>
|
||||||
|
<setting id="org.eclipse.jdt.core.formatter.brace_position_for_annotation_type_declaration" value="end_of_line"/>
|
||||||
|
<setting id="org.eclipse.jdt.core.formatter.alignment_for_selector_in_method_invocation" value="16"/>
|
||||||
|
<setting id="org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_enum_constant_header" value="true"/>
|
||||||
|
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_switch" value="insert"/>
|
||||||
|
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_assignment_operator" value="insert"/>
|
||||||
|
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_unary_operator" value="do not insert"/>
|
||||||
|
<setting id="org.eclipse.jdt.core.formatter.never_indent_line_comments_on_first_column" value="false"/>
|
||||||
|
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_if" value="insert"/>
|
||||||
|
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_colon_in_labeled_statement" value="insert"/>
|
||||||
|
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_allocation_expression" value="do not insert"/>
|
||||||
|
<setting id="org.eclipse.jdt.core.formatter.continuation_indentation_for_array_initializer" value="2"/>
|
||||||
|
<setting id="org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_cases" value="true"/>
|
||||||
|
<setting id="org.eclipse.jdt.core.formatter.comment.indent_root_tags" value="false"/>
|
||||||
|
<setting id="org.eclipse.jdt.core.formatter.alignment_for_enum_constants" value="0"/>
|
||||||
|
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_parameterized_type_reference" value="do not insert"/>
|
||||||
|
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_parenthesized_expression" value="do not insert"/>
|
||||||
|
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_constructor_declaration_throws" value="insert"/>
|
||||||
|
<setting id="org.eclipse.jdt.core.formatter.alignment_for_arguments_in_method_invocation" value="16"/>
|
||||||
|
<setting id="org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_constructor_declaration" value="16"/>
|
||||||
|
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_invocation_arguments" value="insert"/>
|
||||||
|
<setting id="org.eclipse.jdt.core.formatter.blank_lines_before_package" value="0"/>
|
||||||
|
<setting id="org.eclipse.jdt.core.formatter.tabulation.char" value="tab"/>
|
||||||
|
<setting id="org.eclipse.jdt.core.formatter.indent_breaks_compare_to_cases" value="true"/>
|
||||||
|
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_for_inits" value="do not insert"/>
|
||||||
|
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_multiple_field_declarations" value="do not insert"/>
|
||||||
|
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_superinterfaces" value="insert"/>
|
||||||
|
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_declaration_parameters" value="insert"/>
|
||||||
|
<setting id="org.eclipse.jdt.core.formatter.put_empty_statement_on_new_line" value="true"/>
|
||||||
|
<setting id="org.eclipse.jdt.core.formatter.blank_lines_before_method" value="1"/>
|
||||||
|
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_multiple_field_declarations" value="insert"/>
|
||||||
|
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_for_inits" value="insert"/>
|
||||||
|
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_anonymous_type_declaration" value="insert"/>
|
||||||
|
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_cast" value="do not insert"/>
|
||||||
|
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_arguments" value="insert"/>
|
||||||
|
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_array_initializer" value="do not insert"/>
|
||||||
|
<setting id="org.eclipse.jdt.core.formatter.never_indent_block_comments_on_first_column" value="false"/>
|
||||||
|
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_method_invocation" value="do not insert"/>
|
||||||
|
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_enum_constant" value="do not insert"/>
|
||||||
|
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_parenthesized_expression" value="do not insert"/>
|
||||||
|
<setting id="org.eclipse.jdt.core.formatter.brace_position_for_block" value="end_of_line"/>
|
||||||
|
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_postfix_operator" value="do not insert"/>
|
||||||
|
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_brace_in_array_initializer" value="insert"/>
|
||||||
|
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_bracket_in_array_allocation_expression" value="do not insert"/>
|
||||||
|
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_and_in_type_parameter" value="insert"/>
|
||||||
|
</profile>
|
||||||
|
</profiles>
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
#Thu Dec 18 06:35:47 PST 2008
|
#Wed May 06 02:42:56 EDT 2009
|
||||||
eclipse.preferences.version=1
|
eclipse.preferences.version=1
|
||||||
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
|
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
|
||||||
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6
|
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6
|
||||||
@@ -57,15 +57,15 @@ org.eclipse.jdt.core.formatter.comment.clear_blank_lines_in_block_comment=false
|
|||||||
org.eclipse.jdt.core.formatter.comment.clear_blank_lines_in_javadoc_comment=false
|
org.eclipse.jdt.core.formatter.comment.clear_blank_lines_in_javadoc_comment=false
|
||||||
org.eclipse.jdt.core.formatter.comment.format_block_comments=true
|
org.eclipse.jdt.core.formatter.comment.format_block_comments=true
|
||||||
org.eclipse.jdt.core.formatter.comment.format_header=false
|
org.eclipse.jdt.core.formatter.comment.format_header=false
|
||||||
org.eclipse.jdt.core.formatter.comment.format_html=true
|
org.eclipse.jdt.core.formatter.comment.format_html=false
|
||||||
org.eclipse.jdt.core.formatter.comment.format_javadoc_comments=true
|
org.eclipse.jdt.core.formatter.comment.format_javadoc_comments=true
|
||||||
org.eclipse.jdt.core.formatter.comment.format_line_comments=true
|
org.eclipse.jdt.core.formatter.comment.format_line_comments=true
|
||||||
org.eclipse.jdt.core.formatter.comment.format_source_code=true
|
org.eclipse.jdt.core.formatter.comment.format_source_code=true
|
||||||
org.eclipse.jdt.core.formatter.comment.indent_parameter_description=true
|
org.eclipse.jdt.core.formatter.comment.indent_parameter_description=false
|
||||||
org.eclipse.jdt.core.formatter.comment.indent_root_tags=true
|
org.eclipse.jdt.core.formatter.comment.indent_root_tags=false
|
||||||
org.eclipse.jdt.core.formatter.comment.insert_new_line_before_root_tags=insert
|
org.eclipse.jdt.core.formatter.comment.insert_new_line_before_root_tags=do not insert
|
||||||
org.eclipse.jdt.core.formatter.comment.insert_new_line_for_parameter=insert
|
org.eclipse.jdt.core.formatter.comment.insert_new_line_for_parameter=do not insert
|
||||||
org.eclipse.jdt.core.formatter.comment.line_length=80
|
org.eclipse.jdt.core.formatter.comment.line_length=120
|
||||||
org.eclipse.jdt.core.formatter.compact_else_if=true
|
org.eclipse.jdt.core.formatter.compact_else_if=true
|
||||||
org.eclipse.jdt.core.formatter.continuation_indentation=2
|
org.eclipse.jdt.core.formatter.continuation_indentation=2
|
||||||
org.eclipse.jdt.core.formatter.continuation_indentation_for_array_initializer=2
|
org.eclipse.jdt.core.formatter.continuation_indentation_for_array_initializer=2
|
||||||
@@ -256,7 +256,7 @@ org.eclipse.jdt.core.formatter.keep_else_statement_on_same_line=false
|
|||||||
org.eclipse.jdt.core.formatter.keep_empty_array_initializer_on_one_line=false
|
org.eclipse.jdt.core.formatter.keep_empty_array_initializer_on_one_line=false
|
||||||
org.eclipse.jdt.core.formatter.keep_imple_if_on_one_line=false
|
org.eclipse.jdt.core.formatter.keep_imple_if_on_one_line=false
|
||||||
org.eclipse.jdt.core.formatter.keep_then_statement_on_same_line=false
|
org.eclipse.jdt.core.formatter.keep_then_statement_on_same_line=false
|
||||||
org.eclipse.jdt.core.formatter.lineSplit=80
|
org.eclipse.jdt.core.formatter.lineSplit=120
|
||||||
org.eclipse.jdt.core.formatter.never_indent_block_comments_on_first_column=false
|
org.eclipse.jdt.core.formatter.never_indent_block_comments_on_first_column=false
|
||||||
org.eclipse.jdt.core.formatter.never_indent_line_comments_on_first_column=false
|
org.eclipse.jdt.core.formatter.never_indent_line_comments_on_first_column=false
|
||||||
org.eclipse.jdt.core.formatter.number_of_blank_lines_at_beginning_of_method_body=0
|
org.eclipse.jdt.core.formatter.number_of_blank_lines_at_beginning_of_method_body=0
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
#Thu Dec 18 06:35:47 PST 2008
|
#Wed May 06 02:42:56 EDT 2009
|
||||||
eclipse.preferences.version=1
|
eclipse.preferences.version=1
|
||||||
formatter_profile=org.eclipse.jdt.ui.default.eclipse_profile
|
formatter_profile=_Spring
|
||||||
formatter_settings_version=11
|
formatter_settings_version=11
|
||||||
|
|||||||
@@ -0,0 +1,10 @@
|
|||||||
|
package org.springframework.jdbc.datasource.embedded;
|
||||||
|
|
||||||
|
import org.springframework.core.io.support.EncodedResource;
|
||||||
|
|
||||||
|
public class CannotReadScriptException extends RuntimeException {
|
||||||
|
|
||||||
|
public CannotReadScriptException(EncodedResource resource, Throwable cause) {
|
||||||
|
super("Cannot read SQL script from " + resource, cause);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -15,8 +15,8 @@
|
|||||||
*/
|
*/
|
||||||
package org.springframework.jdbc.datasource.embedded;
|
package org.springframework.jdbc.datasource.embedded;
|
||||||
|
|
||||||
import org.springframework.dao.DataAccessException;
|
import java.sql.Connection;
|
||||||
import org.springframework.jdbc.core.JdbcTemplate;
|
import java.sql.SQLException;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Strategy for populating a database with data.
|
* Strategy for populating a database with data.
|
||||||
@@ -27,8 +27,8 @@ public interface DatabasePopulator {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Populate the database using the JDBC-based data access template provided.
|
* Populate the database using the JDBC-based data access template provided.
|
||||||
* @param template the data access template to use to populate the db; already configured and ready to use
|
* @param connection the JDBC connection to use to populate the db; already configured and ready to use
|
||||||
* @throws DataAccessException if an unrecoverable data access exception occurs during database population
|
* @throws SQLException if an unrecoverable data access exception occurs during database population
|
||||||
*/
|
*/
|
||||||
void populate(JdbcTemplate template);
|
void populate(Connection connection) throws SQLException;
|
||||||
}
|
}
|
||||||
@@ -23,24 +23,20 @@ import javax.sql.DataSource;
|
|||||||
|
|
||||||
import org.apache.commons.logging.Log;
|
import org.apache.commons.logging.Log;
|
||||||
import org.apache.commons.logging.LogFactory;
|
import org.apache.commons.logging.LogFactory;
|
||||||
import org.springframework.jdbc.core.JdbcTemplate;
|
|
||||||
import org.springframework.jdbc.datasource.DataSourceTransactionManager;
|
|
||||||
import org.springframework.transaction.TransactionStatus;
|
|
||||||
import org.springframework.transaction.support.TransactionCallbackWithoutResult;
|
|
||||||
import org.springframework.transaction.support.TransactionTemplate;
|
|
||||||
import org.springframework.util.Assert;
|
import org.springframework.util.Assert;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns a {@link EmbeddedDatabase} instance pre-populated with test data.
|
* Returns a {@link EmbeddedDatabase} instance pre-populated with test data. When the database is returned, callers are
|
||||||
* When the database is returned, callers are guaranteed that the database schema and test data will have already been loaded.
|
* guaranteed that the database schema and test data will have already been loaded.
|
||||||
|
* <p>
|
||||||
|
* Can be configured:<br>
|
||||||
|
* Call {@link #setDatabaseName(String)} to change the name of the database.<br>
|
||||||
|
* Call {@link #setDatabaseType(EmbeddedDatabaseType)} to set the database type if you wish to use one of the supported types.<br>
|
||||||
|
* Call {@link #setDatabaseConfigurer(EmbeddedDatabaseConfigurer)} to set a configuration strategy for your own embedded database type.<br>
|
||||||
|
* Call {@link #setDatabasePopulator(DatabasePopulator)} to change the algorithm used to populate the database.<br>
|
||||||
|
* Call {@link #setDataSourceFactory(DataSourceFactory)} to change the type of DataSource used to connect to the database.<br>
|
||||||
|
* Call {@link #getDatabase()} to get the {@link EmbeddedDatabase} instance.<br>
|
||||||
*
|
*
|
||||||
* Can be configured.
|
|
||||||
* Call {@link #setDatabaseName(String)} to change the name of the database.
|
|
||||||
* Call {@link #setDatabaseType(EmbeddedDatabaseType)} to set the database type if you wish to use one of the supported types.
|
|
||||||
* Call {@link #setDatabaseConfigurer(EmbeddedDatabaseConfigurer)} to set a configuration strategy for your own embedded database type.
|
|
||||||
* Call {@link #setDatabasePopulator(DatabasePopulator)} to change the algorithm used to populate the database.
|
|
||||||
* Call {@link #setDataSourceFactory(DataSourceFactory)} to change the type of DataSource used to connect to the database.
|
|
||||||
* Call {@link #getDatabase()} to get the {@link EmbeddedDatabase} instance.
|
|
||||||
* @author Keith Donald
|
* @author Keith Donald
|
||||||
*/
|
*/
|
||||||
public class EmbeddedDatabaseFactory {
|
public class EmbeddedDatabaseFactory {
|
||||||
@@ -50,36 +46,34 @@ public class EmbeddedDatabaseFactory {
|
|||||||
private String databaseName;
|
private String databaseName;
|
||||||
|
|
||||||
private DataSourceFactory dataSourceFactory;
|
private DataSourceFactory dataSourceFactory;
|
||||||
|
|
||||||
private EmbeddedDatabaseConfigurer databaseConfigurer;
|
private EmbeddedDatabaseConfigurer databaseConfigurer;
|
||||||
|
|
||||||
private DatabasePopulator databasePopulator;
|
private DatabasePopulator databasePopulator;
|
||||||
|
|
||||||
private DataSource dataSource;
|
private DataSource dataSource;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Creates a default {@link EmbeddedDatabaseFactory}.
|
* Creates a default {@link EmbeddedDatabaseFactory}. Calling {@link #getDatabase()} will create a embedded HSQL
|
||||||
* Calling {@link #getDatabase()} will create a embedded HSQL database of name 'testdb'.
|
* database of name 'testdb'.
|
||||||
*/
|
*/
|
||||||
public EmbeddedDatabaseFactory() {
|
public EmbeddedDatabaseFactory() {
|
||||||
setDatabaseName("testdb");
|
setDatabaseName("testdb");
|
||||||
setDatabaseType(EmbeddedDatabaseType.HSQL);
|
setDatabaseType(EmbeddedDatabaseType.HSQL);
|
||||||
setDataSourceFactory(new SimpleDriverDataSourceFactory());
|
setDataSourceFactory(new SimpleDriverDataSourceFactory());
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Sets the name of the database.
|
* Sets the name of the database. Defaults to 'testdb'.
|
||||||
* Defaults to 'testdb'.
|
|
||||||
* @param name of the test database
|
* @param name of the test database
|
||||||
*/
|
*/
|
||||||
public void setDatabaseName(String name) {
|
public void setDatabaseName(String name) {
|
||||||
Assert.notNull(name, "The testDatabaseName is required");
|
Assert.notNull(name, "The testDatabaseName is required");
|
||||||
databaseName = name;
|
databaseName = name;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Sets the type of embedded database to use.
|
* Sets the type of embedded database to use. Call this when you wish to configure one of the pre-supported types.
|
||||||
* Call this when you wish to configure one of the pre-supported types.
|
|
||||||
* Defaults to HSQL.
|
* Defaults to HSQL.
|
||||||
* @param type the test database type
|
* @param type the test database type
|
||||||
*/
|
*/
|
||||||
@@ -88,18 +82,17 @@ public class EmbeddedDatabaseFactory {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Sets the strategy that will be used to configure the embedded database instance.
|
* Sets the strategy that will be used to configure the embedded database instance. Call this when you wish to use
|
||||||
* Call this when you wish to use an embedded database type not already supported.
|
* an embedded database type not already supported.
|
||||||
* @param configurer the embedded database configurer
|
* @param configurer the embedded database configurer
|
||||||
*/
|
*/
|
||||||
public void setDatabaseConfigurer(EmbeddedDatabaseConfigurer configurer) {
|
public void setDatabaseConfigurer(EmbeddedDatabaseConfigurer configurer) {
|
||||||
this.databaseConfigurer = configurer;
|
this.databaseConfigurer = configurer;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Sets the strategy that will be used to populate the embedded database.
|
* Sets the strategy that will be used to populate the embedded database. Defaults to null.
|
||||||
* Defaults to null.
|
* @param populator the database populator
|
||||||
* @param populator the database populator
|
|
||||||
*/
|
*/
|
||||||
public void setDatabasePopulator(DatabasePopulator populator) {
|
public void setDatabasePopulator(DatabasePopulator populator) {
|
||||||
Assert.notNull(populator, "The DatabasePopulator is required");
|
Assert.notNull(populator, "The DatabasePopulator is required");
|
||||||
@@ -107,8 +100,8 @@ public class EmbeddedDatabaseFactory {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Sets the factory to use to create the DataSource instance that connects to the embedded database.
|
* Sets the factory to use to create the DataSource instance that connects to the embedded database. Defaults to
|
||||||
* Defaults to {@link SimpleDriverDataSourceFactory}.
|
* {@link SimpleDriverDataSourceFactory}.
|
||||||
* @param dataSourceFactory the data source factory
|
* @param dataSourceFactory the data source factory
|
||||||
*/
|
*/
|
||||||
public void setDataSourceFactory(DataSourceFactory dataSourceFactory) {
|
public void setDataSourceFactory(DataSourceFactory dataSourceFactory) {
|
||||||
@@ -129,7 +122,7 @@ public class EmbeddedDatabaseFactory {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// subclassing hooks
|
// subclassing hooks
|
||||||
|
|
||||||
protected void initDataSource() {
|
protected void initDataSource() {
|
||||||
// create the embedded database source first
|
// create the embedded database source first
|
||||||
if (logger.isInfoEnabled()) {
|
if (logger.isInfoEnabled()) {
|
||||||
@@ -146,26 +139,27 @@ public class EmbeddedDatabaseFactory {
|
|||||||
protected DataSource getDataSource() {
|
protected DataSource getDataSource() {
|
||||||
return dataSource;
|
return dataSource;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void shutdownDataSource() {
|
protected void shutdownDataSource() {
|
||||||
if (dataSource != null) {
|
if (dataSource != null) {
|
||||||
databaseConfigurer.shutdown(dataSource);
|
databaseConfigurer.shutdown(dataSource);
|
||||||
dataSource = null;
|
dataSource = null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// internal helper methods
|
// internal helper methods
|
||||||
|
|
||||||
private void populateDatabase() {
|
private void populateDatabase() {
|
||||||
TransactionTemplate template = new TransactionTemplate(new DataSourceTransactionManager(dataSource));
|
Connection connection = JdbcUtils.getConnection(dataSource);
|
||||||
template.execute(new TransactionCallbackWithoutResult() {
|
try {
|
||||||
@Override
|
databasePopulator.populate(connection);
|
||||||
protected void doInTransactionWithoutResult(TransactionStatus status) {
|
} catch (SQLException e) {
|
||||||
databasePopulator.populate(new JdbcTemplate(dataSource));
|
throw new RuntimeException("SQLException occurred populating embedded database", e);
|
||||||
}
|
} finally {
|
||||||
});
|
JdbcUtils.closeConnection(connection);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private class EmbeddedDataSourceProxy implements EmbeddedDatabase {
|
private class EmbeddedDataSourceProxy implements EmbeddedDatabase {
|
||||||
private DataSource dataSource;
|
private DataSource dataSource;
|
||||||
|
|
||||||
@@ -177,8 +171,7 @@ public class EmbeddedDatabaseFactory {
|
|||||||
return dataSource.getConnection();
|
return dataSource.getConnection();
|
||||||
}
|
}
|
||||||
|
|
||||||
public Connection getConnection(String username, String password)
|
public Connection getConnection(String username, String password) throws SQLException {
|
||||||
throws SQLException {
|
|
||||||
return dataSource.getConnection(username, password);
|
return dataSource.getConnection(username, password);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -205,11 +198,11 @@ public class EmbeddedDatabaseFactory {
|
|||||||
public <T> T unwrap(Class<T> iface) throws SQLException {
|
public <T> T unwrap(Class<T> iface) throws SQLException {
|
||||||
return dataSource.unwrap(iface);
|
return dataSource.unwrap(iface);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void shutdown() {
|
public void shutdown() {
|
||||||
shutdownDataSource();
|
shutdownDataSource();
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -15,13 +15,20 @@
|
|||||||
*/
|
*/
|
||||||
package org.springframework.jdbc.datasource.embedded;
|
package org.springframework.jdbc.datasource.embedded;
|
||||||
|
|
||||||
|
import java.sql.Connection;
|
||||||
|
import java.sql.SQLException;
|
||||||
|
import java.sql.Statement;
|
||||||
|
|
||||||
import javax.sql.DataSource;
|
import javax.sql.DataSource;
|
||||||
|
|
||||||
import org.springframework.jdbc.core.JdbcTemplate;
|
import org.apache.commons.logging.Log;
|
||||||
|
import org.apache.commons.logging.LogFactory;
|
||||||
import org.springframework.util.ClassUtils;
|
import org.springframework.util.ClassUtils;
|
||||||
|
|
||||||
public class HsqlEmbeddedDatabaseConfigurer implements EmbeddedDatabaseConfigurer {
|
public class HsqlEmbeddedDatabaseConfigurer implements EmbeddedDatabaseConfigurer {
|
||||||
|
|
||||||
|
private static final Log logger = LogFactory.getLog(HsqlEmbeddedDatabaseConfigurer.class);
|
||||||
|
|
||||||
private static HsqlEmbeddedDatabaseConfigurer INSTANCE;
|
private static HsqlEmbeddedDatabaseConfigurer INSTANCE;
|
||||||
|
|
||||||
public static synchronized HsqlEmbeddedDatabaseConfigurer getInstance() throws ClassNotFoundException {
|
public static synchronized HsqlEmbeddedDatabaseConfigurer getInstance() throws ClassNotFoundException {
|
||||||
@@ -40,7 +47,18 @@ public class HsqlEmbeddedDatabaseConfigurer implements EmbeddedDatabaseConfigure
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void shutdown(DataSource dataSource) {
|
public void shutdown(DataSource dataSource) {
|
||||||
new JdbcTemplate(dataSource).execute("SHUTDOWN");
|
Connection connection = JdbcUtils.getConnection(dataSource);
|
||||||
|
Statement stmt = null;
|
||||||
|
try {
|
||||||
|
stmt = connection.createStatement();
|
||||||
|
stmt.execute("SHUTDOWN");
|
||||||
|
} catch (SQLException e) {
|
||||||
|
if (logger.isWarnEnabled()) {
|
||||||
|
logger.warn("Could not shutdown in-memory HSQL database", e);
|
||||||
|
}
|
||||||
|
} finally {
|
||||||
|
JdbcUtils.closeStatement(stmt);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,59 @@
|
|||||||
|
package org.springframework.jdbc.datasource.embedded;
|
||||||
|
|
||||||
|
import java.sql.Connection;
|
||||||
|
import java.sql.SQLException;
|
||||||
|
import java.sql.Statement;
|
||||||
|
|
||||||
|
import javax.sql.DataSource;
|
||||||
|
|
||||||
|
import org.apache.commons.logging.Log;
|
||||||
|
import org.apache.commons.logging.LogFactory;
|
||||||
|
import org.springframework.jdbc.CannotGetJdbcConnectionException;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Helper JDBC utilities used by other classes in this package. There is some duplication here with JdbcUtils in
|
||||||
|
* jdbc.support package. We may want to consider simply using that. Package private for now.
|
||||||
|
* @author Keith Donald
|
||||||
|
*/
|
||||||
|
final class JdbcUtils {
|
||||||
|
|
||||||
|
private static Log logger = LogFactory.getLog(EmbeddedDatabaseFactory.class);
|
||||||
|
|
||||||
|
private JdbcUtils() {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public static Connection getConnection(DataSource dataSource) {
|
||||||
|
try {
|
||||||
|
return dataSource.getConnection();
|
||||||
|
} catch (SQLException ex) {
|
||||||
|
throw new CannotGetJdbcConnectionException("Could not get JDBC Connection", ex);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void closeConnection(Connection connection) {
|
||||||
|
if (connection != null) {
|
||||||
|
try {
|
||||||
|
connection.close();
|
||||||
|
} catch (SQLException ex) {
|
||||||
|
logger.debug("Could not close JDBC Connection", ex);
|
||||||
|
} catch (Throwable ex) {
|
||||||
|
// We don't trust the JDBC driver: It might throw RuntimeException or Error.
|
||||||
|
logger.debug("Unexpected exception on closing JDBC Connection", ex);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void closeStatement(Statement stmt) {
|
||||||
|
if (stmt != null) {
|
||||||
|
try {
|
||||||
|
stmt.close();
|
||||||
|
} catch (SQLException ex) {
|
||||||
|
logger.debug("Could not close JDBC Statement", ex);
|
||||||
|
} catch (Throwable ex) {
|
||||||
|
// We don't trust the JDBC driver: It might throw RuntimeException or Error.
|
||||||
|
logger.debug("Unexpected exception on closing JDBC Statement", ex);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -17,6 +17,9 @@ package org.springframework.jdbc.datasource.embedded;
|
|||||||
|
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.io.LineNumberReader;
|
import java.io.LineNumberReader;
|
||||||
|
import java.sql.Connection;
|
||||||
|
import java.sql.SQLException;
|
||||||
|
import java.sql.Statement;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.LinkedList;
|
import java.util.LinkedList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
@@ -25,19 +28,15 @@ import org.apache.commons.logging.Log;
|
|||||||
import org.apache.commons.logging.LogFactory;
|
import org.apache.commons.logging.LogFactory;
|
||||||
import org.springframework.core.io.Resource;
|
import org.springframework.core.io.Resource;
|
||||||
import org.springframework.core.io.support.EncodedResource;
|
import org.springframework.core.io.support.EncodedResource;
|
||||||
import org.springframework.dao.DataAccessException;
|
|
||||||
import org.springframework.dao.DataAccessResourceFailureException;
|
|
||||||
import org.springframework.jdbc.core.JdbcTemplate;
|
|
||||||
import org.springframework.util.StringUtils;
|
import org.springframework.util.StringUtils;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Populates a database from schema and test-data SQL defined in external resources.
|
* Populates a database from schema and test-data SQL defined in external resources. By default, looks for a schema.sql
|
||||||
* By default, looks for a schema.sql file and test-data.sql resource in the root of the classpath.
|
* file and test-data.sql resource in the root of the classpath.
|
||||||
*
|
*
|
||||||
* May be configured.
|
* May be configured. Call {@link #setSchemaLocation(Resource)} to configure the location of the database schema file.
|
||||||
* Call {@link #setSchemaLocation(Resource)} to configure the location of the database schema file.
|
* Call {@link #setTestDataLocation(Resource)} to configure the location of the test data file. Call
|
||||||
* Call {@link #setTestDataLocation(Resource)} to configure the location of the test data file.
|
* {@link #setSqlScriptEncoding(String)} to set the encoding for the schema and test data SQL.
|
||||||
* Call {@link #setSqlScriptEncoding(String)} to set the encoding for the schema and test data SQL.
|
|
||||||
*/
|
*/
|
||||||
public class ResourceDatabasePopulator implements DatabasePopulator {
|
public class ResourceDatabasePopulator implements DatabasePopulator {
|
||||||
|
|
||||||
@@ -46,7 +45,7 @@ public class ResourceDatabasePopulator implements DatabasePopulator {
|
|||||||
private String sqlScriptEncoding;
|
private String sqlScriptEncoding;
|
||||||
|
|
||||||
private List<Resource> scripts = new ArrayList<Resource>();
|
private List<Resource> scripts = new ArrayList<Resource>();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Add a script to execute to populate the database.
|
* Add a script to execute to populate the database.
|
||||||
* @param script the path to a SQL script
|
* @param script the path to a SQL script
|
||||||
@@ -54,7 +53,7 @@ public class ResourceDatabasePopulator implements DatabasePopulator {
|
|||||||
public void addScript(Resource script) {
|
public void addScript(Resource script) {
|
||||||
scripts.add(script);
|
scripts.add(script);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Specify the encoding for SQL scripts, if different from the platform encoding.
|
* Specify the encoding for SQL scripts, if different from the platform encoding.
|
||||||
*/
|
*/
|
||||||
@@ -62,68 +61,64 @@ public class ResourceDatabasePopulator implements DatabasePopulator {
|
|||||||
this.sqlScriptEncoding = sqlScriptEncoding;
|
this.sqlScriptEncoding = sqlScriptEncoding;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void populate(JdbcTemplate template) {
|
public void populate(Connection connection) throws SQLException {
|
||||||
for (Resource script : scripts) {
|
for (Resource script : scripts) {
|
||||||
executeSqlScript(template, new EncodedResource(script, sqlScriptEncoding), false);
|
executeSqlScript(connection, new EncodedResource(script, sqlScriptEncoding), false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// From SimpleJdbcTestUtils - TODO address duplication
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Execute the given SQL script.
|
* Execute the given SQL script. <p>The script will normally be loaded by classpath. There should be one statement
|
||||||
* <p>The script will normally be loaded by classpath. There should be one statement
|
* per line. Any semicolons will be removed. <b>Do not use this method to execute DDL if you expect rollback.</b>
|
||||||
* per line. Any semicolons will be removed. <b>Do not use this method to execute
|
|
||||||
* DDL if you expect rollback.</b>
|
|
||||||
* @param template the SimpleJdbcTemplate with which to perform JDBC operations
|
* @param template the SimpleJdbcTemplate with which to perform JDBC operations
|
||||||
* @param resource the resource (potentially associated with a specific encoding)
|
* @param resource the resource (potentially associated with a specific encoding) to load the SQL script from.
|
||||||
* to load the SQL script from.
|
* @param continueOnError whether or not to continue without throwing an exception in the event of an error.
|
||||||
* @param continueOnError whether or not to continue without throwing an
|
|
||||||
* exception in the event of an error.
|
|
||||||
*/
|
*/
|
||||||
static void executeSqlScript(JdbcTemplate template, EncodedResource resource, boolean continueOnError) {
|
private void executeSqlScript(Connection connection, EncodedResource resource, boolean continueOnError)
|
||||||
|
throws SQLException {
|
||||||
if (logger.isInfoEnabled()) {
|
if (logger.isInfoEnabled()) {
|
||||||
logger.info("Executing SQL script from " + resource);
|
logger.info("Executing SQL script from " + resource);
|
||||||
}
|
}
|
||||||
long startTime = System.currentTimeMillis();
|
long startTime = System.currentTimeMillis();
|
||||||
List<String> statements = new LinkedList<String>();
|
List<String> statements = new LinkedList<String>();
|
||||||
|
String script;
|
||||||
try {
|
try {
|
||||||
LineNumberReader lnr = new LineNumberReader(resource.getReader());
|
script = readScript(resource);
|
||||||
String script = readScript(lnr);
|
} catch (IOException e) {
|
||||||
char delimiter = ';';
|
throw new CannotReadScriptException(resource, e);
|
||||||
if (!containsSqlScriptDelimiters(script, delimiter)) {
|
}
|
||||||
delimiter = '\n';
|
char delimiter = ';';
|
||||||
}
|
if (!containsSqlScriptDelimiters(script, delimiter)) {
|
||||||
splitSqlScript(script, delimiter, statements);
|
delimiter = '\n';
|
||||||
for (String statement : statements) {
|
}
|
||||||
try {
|
splitSqlScript(script, delimiter, statements);
|
||||||
int rowsAffected = template.update(statement);
|
int lineNumber = 0;
|
||||||
if (logger.isDebugEnabled()) {
|
for (String statement : statements) {
|
||||||
logger.debug(rowsAffected + " rows affected by SQL: " + statement);
|
lineNumber++;
|
||||||
}
|
Statement stmt = null;
|
||||||
|
try {
|
||||||
|
stmt = connection.createStatement();
|
||||||
|
int rowsAffected = stmt.executeUpdate(statement);
|
||||||
|
if (logger.isDebugEnabled()) {
|
||||||
|
logger.debug(rowsAffected + " rows affected by SQL: " + statement);
|
||||||
}
|
}
|
||||||
catch (DataAccessException ex) {
|
} catch (SQLException e) {
|
||||||
if (continueOnError) {
|
if (continueOnError) {
|
||||||
if (logger.isWarnEnabled()) {
|
if (logger.isWarnEnabled()) {
|
||||||
logger.warn("SQL: " + statement + " failed", ex);
|
logger.warn("Line " + lineNumber + " statement failed: " + statement, e);
|
||||||
}
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
throw ex;
|
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
throw e;
|
||||||
}
|
}
|
||||||
}
|
} finally {
|
||||||
long elapsedTime = System.currentTimeMillis() - startTime;
|
JdbcUtils.closeStatement(stmt);
|
||||||
if (logger.isInfoEnabled()) {
|
|
||||||
logger.info("Done executing SQL script from " + resource + " in " + elapsedTime + " ms.");
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
catch (IOException ex) {
|
long elapsedTime = System.currentTimeMillis() - startTime;
|
||||||
throw new DataAccessResourceFailureException("Failed to open SQL script from " + resource, ex);
|
if (logger.isInfoEnabled()) {
|
||||||
|
logger.info("Done executing SQL script from " + resource + " in " + elapsedTime + " ms.");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// From JdbcTestUtils - TODO address duplication - these do not seem as useful as the one above
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Read a script from the LineNumberReader and build a String containing the lines.
|
* Read a script from the LineNumberReader and build a String containing the lines.
|
||||||
@@ -131,8 +126,9 @@ public class ResourceDatabasePopulator implements DatabasePopulator {
|
|||||||
* @return <code>String</code> containing the script lines
|
* @return <code>String</code> containing the script lines
|
||||||
* @throws IOException
|
* @throws IOException
|
||||||
*/
|
*/
|
||||||
private static String readScript(LineNumberReader lineNumberReader) throws IOException {
|
private static String readScript(EncodedResource resource) throws IOException {
|
||||||
String currentStatement = lineNumberReader.readLine();
|
LineNumberReader lnr = new LineNumberReader(resource.getReader());
|
||||||
|
String currentStatement = lnr.readLine();
|
||||||
StringBuilder scriptBuilder = new StringBuilder();
|
StringBuilder scriptBuilder = new StringBuilder();
|
||||||
while (currentStatement != null) {
|
while (currentStatement != null) {
|
||||||
if (StringUtils.hasText(currentStatement)) {
|
if (StringUtils.hasText(currentStatement)) {
|
||||||
@@ -141,7 +137,7 @@ public class ResourceDatabasePopulator implements DatabasePopulator {
|
|||||||
}
|
}
|
||||||
scriptBuilder.append(currentStatement);
|
scriptBuilder.append(currentStatement);
|
||||||
}
|
}
|
||||||
currentStatement = lineNumberReader.readLine();
|
currentStatement = lnr.readLine();
|
||||||
}
|
}
|
||||||
return scriptBuilder.toString();
|
return scriptBuilder.toString();
|
||||||
}
|
}
|
||||||
@@ -166,8 +162,8 @@ public class ResourceDatabasePopulator implements DatabasePopulator {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Split an SQL script into separate statements delimited with the provided delimiter character. Each
|
* Split an SQL script into separate statements delimited with the provided delimiter character. Each individual
|
||||||
* individual statement will be added to the provided <code>List</code>.
|
* statement will be added to the provided <code>List</code>.
|
||||||
* @param script the SQL script
|
* @param script the SQL script
|
||||||
* @param delim charecter delimiting each statement - typically a ';' character
|
* @param delim charecter delimiting each statement - typically a ';' character
|
||||||
* @param statements the List that will contain the individual statements
|
* @param statements the List that will contain the individual statements
|
||||||
@@ -185,8 +181,7 @@ public class ResourceDatabasePopulator implements DatabasePopulator {
|
|||||||
statements.add(sb.toString());
|
statements.add(sb.toString());
|
||||||
sb = new StringBuilder();
|
sb = new StringBuilder();
|
||||||
}
|
}
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
sb.append(content[i]);
|
sb.append(content[i]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4,10 +4,7 @@ import static org.junit.Assert.assertEquals;
|
|||||||
import static org.junit.Assert.fail;
|
import static org.junit.Assert.fail;
|
||||||
|
|
||||||
import org.junit.Test;
|
import org.junit.Test;
|
||||||
import org.springframework.dao.DataAccessException;
|
|
||||||
import org.springframework.jdbc.core.JdbcTemplate;
|
import org.springframework.jdbc.core.JdbcTemplate;
|
||||||
import org.springframework.jdbc.datasource.embedded.EmbeddedDatabase;
|
|
||||||
import org.springframework.jdbc.datasource.embedded.EmbeddedDatabaseBuilder;
|
|
||||||
|
|
||||||
public class EmbeddedDatabaseBuilderTests {
|
public class EmbeddedDatabaseBuilderTests {
|
||||||
|
|
||||||
@@ -33,8 +30,7 @@ public class EmbeddedDatabaseBuilderTests {
|
|||||||
try {
|
try {
|
||||||
new EmbeddedDatabaseBuilder().script("bogus.sql").build();
|
new EmbeddedDatabaseBuilder().script("bogus.sql").build();
|
||||||
fail("Should have failed");
|
fail("Should have failed");
|
||||||
} catch (DataAccessException e) {
|
} catch (CannotReadScriptException e) {
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -2,12 +2,9 @@ package org.springframework.jdbc.datasource.embedded;
|
|||||||
|
|
||||||
import static org.junit.Assert.assertTrue;
|
import static org.junit.Assert.assertTrue;
|
||||||
|
|
||||||
|
import java.sql.Connection;
|
||||||
|
|
||||||
import org.junit.Test;
|
import org.junit.Test;
|
||||||
import org.springframework.dao.DataAccessException;
|
|
||||||
import org.springframework.jdbc.core.JdbcTemplate;
|
|
||||||
import org.springframework.jdbc.datasource.embedded.DatabasePopulator;
|
|
||||||
import org.springframework.jdbc.datasource.embedded.EmbeddedDatabase;
|
|
||||||
import org.springframework.jdbc.datasource.embedded.EmbeddedDatabaseFactory;
|
|
||||||
|
|
||||||
public class EmbeddedDatabaseFactoryTests {
|
public class EmbeddedDatabaseFactoryTests {
|
||||||
|
|
||||||
@@ -26,7 +23,7 @@ public class EmbeddedDatabaseFactoryTests {
|
|||||||
|
|
||||||
private boolean populateCalled;
|
private boolean populateCalled;
|
||||||
|
|
||||||
public void populate(JdbcTemplate template) throws DataAccessException {
|
public void populate(Connection connection) {
|
||||||
this.populateCalled = true;
|
this.populateCalled = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user