diff options
author | Martin Taal | 2013-09-09 18:09:18 +0000 |
---|---|---|
committer | Martin Taal | 2013-09-09 18:09:18 +0000 |
commit | a232f6e7dcca9706ea963ba6f6c3a1bdd26bcea1 (patch) | |
tree | 83bfa135437aad86823032b175483484eb64792f | |
parent | d71a8eea08c32e4a355baad3a756127cf3e9e6bb (diff) | |
download | cdo-a232f6e7dcca9706ea963ba6f6c3a1bdd26bcea1.tar.gz cdo-a232f6e7dcca9706ea963ba6f6c3a1bdd26bcea1.tar.xz cdo-a232f6e7dcca9706ea963ba6f6c3a1bdd26bcea1.zip |
[414828] - [Hibernate] Implement Chunked reader
Change-Id: I7531aeef66d3e3836b0bcce48c058269eb16cc12
45 files changed, 2132 insertions, 486 deletions
diff --git a/features/org.eclipse.emf.cdo.examples.hibernate-feature/feature.xml b/features/org.eclipse.emf.cdo.examples.hibernate-feature/feature.xml index 6f526131b0..fbb11596c6 100644 --- a/features/org.eclipse.emf.cdo.examples.hibernate-feature/feature.xml +++ b/features/org.eclipse.emf.cdo.examples.hibernate-feature/feature.xml @@ -12,7 +12,7 @@ <feature id="org.eclipse.emf.cdo.examples.hibernate" label="%featureName" - version="4.2.0.qualifier" + version="4.2.100.qualifier" provider-name="%providerName" plugin="org.eclipse.emf.cdo.examples.hibernate.server" image="eclipse_update_120.jpg" diff --git a/features/org.eclipse.emf.cdo.server.hibernate-feature/feature.xml b/features/org.eclipse.emf.cdo.server.hibernate-feature/feature.xml index 9de19d66ac..c81a468b3c 100644 --- a/features/org.eclipse.emf.cdo.server.hibernate-feature/feature.xml +++ b/features/org.eclipse.emf.cdo.server.hibernate-feature/feature.xml @@ -12,7 +12,7 @@ <feature id="org.eclipse.emf.cdo.server.hibernate" label="%featureName" - version="4.2.0.qualifier" + version="4.2.100.qualifier" provider-name="%providerName" license-feature="org.eclipse.emf.cdo.license" license-feature-version="0.0.0"> diff --git a/plugins/org.eclipse.emf.cdo.examples.hibernate.client/.settings/org.eclipse.jdt.core.prefs b/plugins/org.eclipse.emf.cdo.examples.hibernate.client/.settings/org.eclipse.jdt.core.prefs index c6e07f8e95..37c84836d7 100644 --- a/plugins/org.eclipse.emf.cdo.examples.hibernate.client/.settings/org.eclipse.jdt.core.prefs +++ b/plugins/org.eclipse.emf.cdo.examples.hibernate.client/.settings/org.eclipse.jdt.core.prefs @@ -1,4 +1,3 @@ -#Wed Jan 20 18:16:27 CET 2010 eclipse.preferences.version=1 org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5 @@ -6,3 +5,283 @@ org.eclipse.jdt.core.compiler.compliance=1.5 org.eclipse.jdt.core.compiler.problem.assertIdentifier=error org.eclipse.jdt.core.compiler.problem.enumIdentifier=error org.eclipse.jdt.core.compiler.source=1.5 +org.eclipse.jdt.core.formatter.align_type_members_on_columns=false +org.eclipse.jdt.core.formatter.alignment_for_arguments_in_allocation_expression=16 +org.eclipse.jdt.core.formatter.alignment_for_arguments_in_annotation=0 +org.eclipse.jdt.core.formatter.alignment_for_arguments_in_enum_constant=16 +org.eclipse.jdt.core.formatter.alignment_for_arguments_in_explicit_constructor_call=16 +org.eclipse.jdt.core.formatter.alignment_for_arguments_in_method_invocation=16 +org.eclipse.jdt.core.formatter.alignment_for_arguments_in_qualified_allocation_expression=16 +org.eclipse.jdt.core.formatter.alignment_for_assignment=0 +org.eclipse.jdt.core.formatter.alignment_for_binary_expression=16 +org.eclipse.jdt.core.formatter.alignment_for_compact_if=16 +org.eclipse.jdt.core.formatter.alignment_for_conditional_expression=80 +org.eclipse.jdt.core.formatter.alignment_for_enum_constants=0 +org.eclipse.jdt.core.formatter.alignment_for_expressions_in_array_initializer=16 +org.eclipse.jdt.core.formatter.alignment_for_method_declaration=0 +org.eclipse.jdt.core.formatter.alignment_for_multiple_fields=16 +org.eclipse.jdt.core.formatter.alignment_for_parameters_in_constructor_declaration=16 +org.eclipse.jdt.core.formatter.alignment_for_parameters_in_method_declaration=16 +org.eclipse.jdt.core.formatter.alignment_for_resources_in_try=80 +org.eclipse.jdt.core.formatter.alignment_for_selector_in_method_invocation=16 +org.eclipse.jdt.core.formatter.alignment_for_superclass_in_type_declaration=16 +org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_enum_declaration=16 +org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_type_declaration=16 +org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_constructor_declaration=16 +org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_method_declaration=16 +org.eclipse.jdt.core.formatter.alignment_for_union_type_in_multicatch=16 +org.eclipse.jdt.core.formatter.blank_lines_after_imports=1 +org.eclipse.jdt.core.formatter.blank_lines_after_package=1 +org.eclipse.jdt.core.formatter.blank_lines_before_field=1 +org.eclipse.jdt.core.formatter.blank_lines_before_first_class_body_declaration=0 +org.eclipse.jdt.core.formatter.blank_lines_before_imports=1 +org.eclipse.jdt.core.formatter.blank_lines_before_member_type=1 +org.eclipse.jdt.core.formatter.blank_lines_before_method=1 +org.eclipse.jdt.core.formatter.blank_lines_before_new_chunk=1 +org.eclipse.jdt.core.formatter.blank_lines_before_package=0 +org.eclipse.jdt.core.formatter.blank_lines_between_import_groups=1 +org.eclipse.jdt.core.formatter.blank_lines_between_type_declarations=1 +org.eclipse.jdt.core.formatter.brace_position_for_annotation_type_declaration=next_line +org.eclipse.jdt.core.formatter.brace_position_for_anonymous_type_declaration=next_line +org.eclipse.jdt.core.formatter.brace_position_for_array_initializer=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_block=next_line +org.eclipse.jdt.core.formatter.brace_position_for_block_in_case=next_line +org.eclipse.jdt.core.formatter.brace_position_for_constructor_declaration=next_line +org.eclipse.jdt.core.formatter.brace_position_for_enum_constant=next_line +org.eclipse.jdt.core.formatter.brace_position_for_enum_declaration=next_line +org.eclipse.jdt.core.formatter.brace_position_for_method_declaration=next_line +org.eclipse.jdt.core.formatter.brace_position_for_switch=next_line +org.eclipse.jdt.core.formatter.brace_position_for_type_declaration=next_line +org.eclipse.jdt.core.formatter.comment.clear_blank_lines_in_block_comment=true +org.eclipse.jdt.core.formatter.comment.clear_blank_lines_in_javadoc_comment=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_html=true +org.eclipse.jdt.core.formatter.comment.format_javadoc_comments=false +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.indent_parameter_description=true +org.eclipse.jdt.core.formatter.comment.indent_root_tags=true +org.eclipse.jdt.core.formatter.comment.insert_new_line_before_root_tags=insert +org.eclipse.jdt.core.formatter.comment.insert_new_line_for_parameter=insert +org.eclipse.jdt.core.formatter.comment.line_length=120 +org.eclipse.jdt.core.formatter.comment.new_lines_at_block_boundaries=true +org.eclipse.jdt.core.formatter.comment.new_lines_at_javadoc_boundaries=true +org.eclipse.jdt.core.formatter.comment.preserve_white_space_between_code_and_line_comments=false +org.eclipse.jdt.core.formatter.compact_else_if=true +org.eclipse.jdt.core.formatter.continuation_indentation=2 +org.eclipse.jdt.core.formatter.continuation_indentation_for_array_initializer=2 +org.eclipse.jdt.core.formatter.disabling_tag=@formatter\:off +org.eclipse.jdt.core.formatter.enabling_tag=@formatter\:on +org.eclipse.jdt.core.formatter.format_guardian_clause_on_one_line=false +org.eclipse.jdt.core.formatter.format_line_comment_starting_on_first_column=true +org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_annotation_declaration_header=true +org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_enum_constant_header=true +org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_enum_declaration_header=true +org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_type_header=true +org.eclipse.jdt.core.formatter.indent_breaks_compare_to_cases=true +org.eclipse.jdt.core.formatter.indent_empty_lines=false +org.eclipse.jdt.core.formatter.indent_statements_compare_to_block=true +org.eclipse.jdt.core.formatter.indent_statements_compare_to_body=true +org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_cases=true +org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_switch=false +org.eclipse.jdt.core.formatter.indentation.size=2 +org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_field=insert +org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_local_variable=insert +org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_method=insert +org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_package=insert +org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_parameter=do not insert +org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_type=insert +org.eclipse.jdt.core.formatter.insert_new_line_after_label=do not insert +org.eclipse.jdt.core.formatter.insert_new_line_after_opening_brace_in_array_initializer=do not insert +org.eclipse.jdt.core.formatter.insert_new_line_at_end_of_file_if_missing=insert +org.eclipse.jdt.core.formatter.insert_new_line_before_catch_in_try_statement=insert +org.eclipse.jdt.core.formatter.insert_new_line_before_closing_brace_in_array_initializer=do not insert +org.eclipse.jdt.core.formatter.insert_new_line_before_else_in_if_statement=insert +org.eclipse.jdt.core.formatter.insert_new_line_before_finally_in_try_statement=insert +org.eclipse.jdt.core.formatter.insert_new_line_before_while_in_do_statement=do not insert +org.eclipse.jdt.core.formatter.insert_new_line_in_empty_annotation_declaration=insert +org.eclipse.jdt.core.formatter.insert_new_line_in_empty_anonymous_type_declaration=insert +org.eclipse.jdt.core.formatter.insert_new_line_in_empty_block=insert +org.eclipse.jdt.core.formatter.insert_new_line_in_empty_enum_constant=insert +org.eclipse.jdt.core.formatter.insert_new_line_in_empty_enum_declaration=insert +org.eclipse.jdt.core.formatter.insert_new_line_in_empty_method_body=insert +org.eclipse.jdt.core.formatter.insert_new_line_in_empty_type_declaration=insert +org.eclipse.jdt.core.formatter.insert_space_after_and_in_type_parameter=insert +org.eclipse.jdt.core.formatter.insert_space_after_assignment_operator=insert +org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation_type_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_binary_operator=insert +org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_arguments=insert +org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_parameters=insert +org.eclipse.jdt.core.formatter.insert_space_after_closing_brace_in_block=insert +org.eclipse.jdt.core.formatter.insert_space_after_closing_paren_in_cast=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_colon_in_assert=insert +org.eclipse.jdt.core.formatter.insert_space_after_colon_in_case=insert +org.eclipse.jdt.core.formatter.insert_space_after_colon_in_conditional=insert +org.eclipse.jdt.core.formatter.insert_space_after_colon_in_for=insert +org.eclipse.jdt.core.formatter.insert_space_after_colon_in_labeled_statement=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_allocation_expression=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_annotation=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_array_initializer=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_constructor_declaration_parameters=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_constructor_declaration_throws=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_enum_constant_arguments=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_enum_declarations=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_explicitconstructorcall_arguments=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_for_increments=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_for_inits=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_declaration_parameters=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_declaration_throws=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_invocation_arguments=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_multiple_field_declarations=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_multiple_local_declarations=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_parameterized_type_reference=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_superinterfaces=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_arguments=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_parameters=insert +org.eclipse.jdt.core.formatter.insert_space_after_ellipsis=insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_parameterized_type_reference=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_arguments=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_parameters=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_brace_in_array_initializer=insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_bracket_in_array_allocation_expression=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_bracket_in_array_reference=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_annotation=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_cast=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_catch=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_constructor_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_enum_constant=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_for=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_if=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_method_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_method_invocation=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_parenthesized_expression=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_switch=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_synchronized=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_try=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_while=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_postfix_operator=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_prefix_operator=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_question_in_conditional=insert +org.eclipse.jdt.core.formatter.insert_space_after_question_in_wildcard=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_semicolon_in_for=insert +org.eclipse.jdt.core.formatter.insert_space_after_semicolon_in_try_resources=insert +org.eclipse.jdt.core.formatter.insert_space_after_unary_operator=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_and_in_type_parameter=insert +org.eclipse.jdt.core.formatter.insert_space_before_assignment_operator=insert +org.eclipse.jdt.core.formatter.insert_space_before_at_in_annotation_type_declaration=insert +org.eclipse.jdt.core.formatter.insert_space_before_binary_operator=insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_parameterized_type_reference=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_arguments=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_parameters=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_brace_in_array_initializer=insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_bracket_in_array_allocation_expression=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_bracket_in_array_reference=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_annotation=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_cast=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_catch=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_constructor_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_enum_constant=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_for=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_if=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_method_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_method_invocation=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_parenthesized_expression=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_switch=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_synchronized=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_try=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_while=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_colon_in_assert=insert +org.eclipse.jdt.core.formatter.insert_space_before_colon_in_case=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_colon_in_conditional=insert +org.eclipse.jdt.core.formatter.insert_space_before_colon_in_default=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_colon_in_for=insert +org.eclipse.jdt.core.formatter.insert_space_before_colon_in_labeled_statement=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_allocation_expression=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_annotation=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_array_initializer=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_constructor_declaration_parameters=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_constructor_declaration_throws=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_enum_constant_arguments=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_enum_declarations=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_explicitconstructorcall_arguments=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_for_increments=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_for_inits=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_declaration_parameters=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_declaration_throws=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_invocation_arguments=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_multiple_field_declarations=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_multiple_local_declarations=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_parameterized_type_reference=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_superinterfaces=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_arguments=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_parameters=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_ellipsis=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_parameterized_type_reference=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_arguments=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_parameters=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_annotation_type_declaration=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_anonymous_type_declaration=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_array_initializer=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_block=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_constructor_declaration=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_enum_constant=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_enum_declaration=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_method_declaration=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_switch=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_type_declaration=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_allocation_expression=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_reference=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_type_reference=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_annotation=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_annotation_type_member_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_catch=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_constructor_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_enum_constant=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_for=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_if=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_method_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_method_invocation=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_parenthesized_expression=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_switch=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_synchronized=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_try=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_while=insert +org.eclipse.jdt.core.formatter.insert_space_before_parenthesized_expression_in_return=insert +org.eclipse.jdt.core.formatter.insert_space_before_parenthesized_expression_in_throw=insert +org.eclipse.jdt.core.formatter.insert_space_before_postfix_operator=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_prefix_operator=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_question_in_conditional=insert +org.eclipse.jdt.core.formatter.insert_space_before_question_in_wildcard=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_semicolon=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_semicolon_in_for=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_semicolon_in_try_resources=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_unary_operator=do not insert +org.eclipse.jdt.core.formatter.insert_space_between_brackets_in_array_type_reference=do not insert +org.eclipse.jdt.core.formatter.insert_space_between_empty_braces_in_array_initializer=do not insert +org.eclipse.jdt.core.formatter.insert_space_between_empty_brackets_in_array_allocation_expression=do not insert +org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_annotation_type_member_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_constructor_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_enum_constant=do not insert +org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_invocation=do not insert +org.eclipse.jdt.core.formatter.join_lines_in_comments=true +org.eclipse.jdt.core.formatter.join_wrapped_lines=true +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_imple_if_on_one_line=false +org.eclipse.jdt.core.formatter.keep_then_statement_on_same_line=false +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_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_empty_lines_to_preserve=1 +org.eclipse.jdt.core.formatter.put_empty_statement_on_new_line=true +org.eclipse.jdt.core.formatter.tabulation.char=space +org.eclipse.jdt.core.formatter.tabulation.size=2 +org.eclipse.jdt.core.formatter.use_on_off_tags=false +org.eclipse.jdt.core.formatter.use_tabs_only_for_leading_indentations=false +org.eclipse.jdt.core.formatter.wrap_before_binary_operator=true +org.eclipse.jdt.core.formatter.wrap_before_or_operator_multicatch=true +org.eclipse.jdt.core.formatter.wrap_outer_expressions_when_nested=true diff --git a/plugins/org.eclipse.emf.cdo.examples.hibernate.client/.settings/org.eclipse.jdt.ui.prefs b/plugins/org.eclipse.emf.cdo.examples.hibernate.client/.settings/org.eclipse.jdt.ui.prefs new file mode 100644 index 0000000000..66ed83a11f --- /dev/null +++ b/plugins/org.eclipse.emf.cdo.examples.hibernate.client/.settings/org.eclipse.jdt.ui.prefs @@ -0,0 +1,3 @@ +eclipse.preferences.version=1 +formatter_profile=_EMFT +formatter_settings_version=12 diff --git a/plugins/org.eclipse.emf.cdo.examples.hibernate.client/META-INF/MANIFEST.MF b/plugins/org.eclipse.emf.cdo.examples.hibernate.client/META-INF/MANIFEST.MF index 841fa584a5..a6a8547369 100644 --- a/plugins/org.eclipse.emf.cdo.examples.hibernate.client/META-INF/MANIFEST.MF +++ b/plugins/org.eclipse.emf.cdo.examples.hibernate.client/META-INF/MANIFEST.MF @@ -2,7 +2,7 @@ Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: %pluginName Bundle-SymbolicName: org.eclipse.emf.cdo.examples.hibernate.client -Bundle-Version: 4.1.100.qualifier +Bundle-Version: 4.1.200.qualifier Bundle-Vendor: %providerName Bundle-Localization: plugin Bundle-RequiredExecutionEnvironment: J2SE-1.5 @@ -33,4 +33,4 @@ Import-Package: org.hibernate;version="[4.0.0,5.0.0)", org.hibernate.type;version="[4.0.0,5.0.0)", org.hibernate.usertype;version="[4.0.0,5.0.0)", org.apache.commons.logging;version="[1.0.0,2.0.0)" -Export-Package: org.eclipse.emf.cdo.examples.hibernate.client;version="4.1.100" +Export-Package: org.eclipse.emf.cdo.examples.hibernate.client;version="4.1.200" diff --git a/plugins/org.eclipse.emf.cdo.examples.hibernate.client/src/org/eclipse/emf/cdo/examples/hibernate/client/HibernateQueryTest.java b/plugins/org.eclipse.emf.cdo.examples.hibernate.client/src/org/eclipse/emf/cdo/examples/hibernate/client/HibernateQueryTest.java index ebac325a4a..c4d982be1b 100644 --- a/plugins/org.eclipse.emf.cdo.examples.hibernate.client/src/org/eclipse/emf/cdo/examples/hibernate/client/HibernateQueryTest.java +++ b/plugins/org.eclipse.emf.cdo.examples.hibernate.client/src/org/eclipse/emf/cdo/examples/hibernate/client/HibernateQueryTest.java @@ -12,6 +12,7 @@ package org.eclipse.emf.cdo.examples.hibernate.client; import org.eclipse.emf.cdo.CDOObject; import org.eclipse.emf.cdo.common.id.CDOID; +import org.eclipse.emf.cdo.common.id.CDOIDString; import org.eclipse.emf.cdo.common.id.CDOIDUtil; import org.eclipse.emf.cdo.eresource.CDOResource; import org.eclipse.emf.cdo.examples.company.CompanyFactory; @@ -24,9 +25,7 @@ import org.eclipse.emf.cdo.examples.company.VAT; import org.eclipse.emf.cdo.session.CDOSession; import org.eclipse.emf.cdo.transaction.CDOTransaction; import org.eclipse.emf.cdo.view.CDOQuery; - import org.eclipse.net4j.util.collection.CloseableIterator; - import org.junit.Before; import java.io.Serializable; @@ -36,9 +35,10 @@ import java.util.List; /** * Test different aspects of HQL querying using the CDO query api. * <p/> - * The queries are done on a test set which is created automatically. The size of the testdata is controlled by the - * static final int's in the top of this class. - * + * The queries are done on a test set which is created automatically. The size + * of the testdata is controlled by the static final int's in the top of this + * class. + * * @author Martin Taal */ public class HibernateQueryTest extends BaseTest @@ -102,7 +102,8 @@ public class HibernateQueryTest extends BaseTest assertEquals(NUM_OF_PRODUCTS, products.size()); } - // MT: re-enable after https://bugs.eclipse.org/bugs/show_bug.cgi?id=309920 + // MT: re-enable after + // https://bugs.eclipse.org/bugs/show_bug.cgi?id=309920 // gets resolved // { // CDOQuery cdoQuery = transaction.createQuery("hql", "from Product where name=:name"); //$NON-NLS-1$ //$NON-NLS-2$ @@ -121,7 +122,8 @@ public class HibernateQueryTest extends BaseTest CDOQuery cdoQuery = transaction.createQuery("hql", "from Product where vat=:vat"); //$NON-NLS-1$ //$NON-NLS-2$ cdoQuery.setParameter("vat", VAT.VAT15); //$NON-NLS-1$ final List<Product> products = cdoQuery.getResult(Product.class); - // MT: re-enable after https://bugs.eclipse.org/bugs/show_bug.cgi?id=309920 + // MT: re-enable after + // https://bugs.eclipse.org/bugs/show_bug.cgi?id=309920 // gets resolved // assertEquals(10, products.size()); assertEquals(5, products.size()); @@ -214,10 +216,13 @@ public class HibernateQueryTest extends BaseTest } else { - // MT: re-enable after https://bugs.eclipse.org/bugs/show_bug.cgi?id=309920 + // MT: re-enable after + // https://bugs.eclipse.org/bugs/show_bug.cgi?id=309920 // gets resolved - // assertEquals(5, orderQuery.getResult(SalesOrder.class).size()); - // assertEquals(0, orderQuery.getResult(SalesOrder.class).size()); + // assertEquals(5, + // orderQuery.getResult(SalesOrder.class).size()); + // assertEquals(0, + // orderQuery.getResult(SalesOrder.class).size()); } } } @@ -318,7 +323,8 @@ public class HibernateQueryTest extends BaseTest { CDOQuery productQuery = transaction.createQuery("hql", "from Product"); //$NON-NLS-1$ //$NON-NLS-2$ productQuery.setMaxResults(pageSize); - // NOTE: firstResult is a special parameter for the hql query language + // NOTE: firstResult is a special parameter for the hql query + // language productQuery.setParameter("firstResult", page * pageSize); //$NON-NLS-1$ final List<Product> queriedProducts = productQuery.getResult(Product.class); assertEquals(true, queriedProducts.size() <= pageSize); @@ -368,7 +374,8 @@ public class HibernateQueryTest extends BaseTest final List<Product> products = new ArrayList<Product>(); for (int i = 0; i < NUM_OF_PRODUCTS; i++) { - // MT: re-enable after https://bugs.eclipse.org/bugs/show_bug.cgi?id=309920 + // MT: re-enable after + // https://bugs.eclipse.org/bugs/show_bug.cgi?id=309920 // gets resolved products.add(createProduct((index++) + i)); } @@ -399,7 +406,8 @@ public class HibernateQueryTest extends BaseTest { SalesOrder salesOrder = CompanyFactory.eINSTANCE.createSalesOrder(); salesOrder.setCustomer(customer); - // MT: re-enable after https://bugs.eclipse.org/bugs/show_bug.cgi?id=309920 + // MT: re-enable after + // https://bugs.eclipse.org/bugs/show_bug.cgi?id=309920 // gets resolved // salesOrder.setId(num); salesOrder.setId((index++ + num)); @@ -441,6 +449,10 @@ public class HibernateQueryTest extends BaseTest public Serializable getIdValue(CDOID id) { - return CDOIDUtil.getString(id); + if (id instanceof CDOIDString) + { + return CDOIDUtil.getString(id); + } + return CDOIDUtil.getLong(id); } } diff --git a/plugins/org.eclipse.emf.cdo.examples.hibernate.server/.classpath b/plugins/org.eclipse.emf.cdo.examples.hibernate.server/.classpath index 64c5e31b7a..304e86186a 100644 --- a/plugins/org.eclipse.emf.cdo.examples.hibernate.server/.classpath +++ b/plugins/org.eclipse.emf.cdo.examples.hibernate.server/.classpath @@ -1,7 +1,7 @@ <?xml version="1.0" encoding="UTF-8"?> <classpath> + <classpathentry kind="src" path="src"/> <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.5"/> <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/> - <classpathentry kind="src" path="src"/> <classpathentry kind="output" path="bin"/> </classpath> diff --git a/plugins/org.eclipse.emf.cdo.examples.hibernate.server/.settings/org.eclipse.jdt.core.prefs b/plugins/org.eclipse.emf.cdo.examples.hibernate.server/.settings/org.eclipse.jdt.core.prefs index 3eaedee4a9..37c84836d7 100644 --- a/plugins/org.eclipse.emf.cdo.examples.hibernate.server/.settings/org.eclipse.jdt.core.prefs +++ b/plugins/org.eclipse.emf.cdo.examples.hibernate.server/.settings/org.eclipse.jdt.core.prefs @@ -1,4 +1,3 @@ -#Wed Jan 20 18:24:17 CET 2010 eclipse.preferences.version=1 org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5 @@ -6,3 +5,283 @@ org.eclipse.jdt.core.compiler.compliance=1.5 org.eclipse.jdt.core.compiler.problem.assertIdentifier=error org.eclipse.jdt.core.compiler.problem.enumIdentifier=error org.eclipse.jdt.core.compiler.source=1.5 +org.eclipse.jdt.core.formatter.align_type_members_on_columns=false +org.eclipse.jdt.core.formatter.alignment_for_arguments_in_allocation_expression=16 +org.eclipse.jdt.core.formatter.alignment_for_arguments_in_annotation=0 +org.eclipse.jdt.core.formatter.alignment_for_arguments_in_enum_constant=16 +org.eclipse.jdt.core.formatter.alignment_for_arguments_in_explicit_constructor_call=16 +org.eclipse.jdt.core.formatter.alignment_for_arguments_in_method_invocation=16 +org.eclipse.jdt.core.formatter.alignment_for_arguments_in_qualified_allocation_expression=16 +org.eclipse.jdt.core.formatter.alignment_for_assignment=0 +org.eclipse.jdt.core.formatter.alignment_for_binary_expression=16 +org.eclipse.jdt.core.formatter.alignment_for_compact_if=16 +org.eclipse.jdt.core.formatter.alignment_for_conditional_expression=80 +org.eclipse.jdt.core.formatter.alignment_for_enum_constants=0 +org.eclipse.jdt.core.formatter.alignment_for_expressions_in_array_initializer=16 +org.eclipse.jdt.core.formatter.alignment_for_method_declaration=0 +org.eclipse.jdt.core.formatter.alignment_for_multiple_fields=16 +org.eclipse.jdt.core.formatter.alignment_for_parameters_in_constructor_declaration=16 +org.eclipse.jdt.core.formatter.alignment_for_parameters_in_method_declaration=16 +org.eclipse.jdt.core.formatter.alignment_for_resources_in_try=80 +org.eclipse.jdt.core.formatter.alignment_for_selector_in_method_invocation=16 +org.eclipse.jdt.core.formatter.alignment_for_superclass_in_type_declaration=16 +org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_enum_declaration=16 +org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_type_declaration=16 +org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_constructor_declaration=16 +org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_method_declaration=16 +org.eclipse.jdt.core.formatter.alignment_for_union_type_in_multicatch=16 +org.eclipse.jdt.core.formatter.blank_lines_after_imports=1 +org.eclipse.jdt.core.formatter.blank_lines_after_package=1 +org.eclipse.jdt.core.formatter.blank_lines_before_field=1 +org.eclipse.jdt.core.formatter.blank_lines_before_first_class_body_declaration=0 +org.eclipse.jdt.core.formatter.blank_lines_before_imports=1 +org.eclipse.jdt.core.formatter.blank_lines_before_member_type=1 +org.eclipse.jdt.core.formatter.blank_lines_before_method=1 +org.eclipse.jdt.core.formatter.blank_lines_before_new_chunk=1 +org.eclipse.jdt.core.formatter.blank_lines_before_package=0 +org.eclipse.jdt.core.formatter.blank_lines_between_import_groups=1 +org.eclipse.jdt.core.formatter.blank_lines_between_type_declarations=1 +org.eclipse.jdt.core.formatter.brace_position_for_annotation_type_declaration=next_line +org.eclipse.jdt.core.formatter.brace_position_for_anonymous_type_declaration=next_line +org.eclipse.jdt.core.formatter.brace_position_for_array_initializer=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_block=next_line +org.eclipse.jdt.core.formatter.brace_position_for_block_in_case=next_line +org.eclipse.jdt.core.formatter.brace_position_for_constructor_declaration=next_line +org.eclipse.jdt.core.formatter.brace_position_for_enum_constant=next_line +org.eclipse.jdt.core.formatter.brace_position_for_enum_declaration=next_line +org.eclipse.jdt.core.formatter.brace_position_for_method_declaration=next_line +org.eclipse.jdt.core.formatter.brace_position_for_switch=next_line +org.eclipse.jdt.core.formatter.brace_position_for_type_declaration=next_line +org.eclipse.jdt.core.formatter.comment.clear_blank_lines_in_block_comment=true +org.eclipse.jdt.core.formatter.comment.clear_blank_lines_in_javadoc_comment=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_html=true +org.eclipse.jdt.core.formatter.comment.format_javadoc_comments=false +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.indent_parameter_description=true +org.eclipse.jdt.core.formatter.comment.indent_root_tags=true +org.eclipse.jdt.core.formatter.comment.insert_new_line_before_root_tags=insert +org.eclipse.jdt.core.formatter.comment.insert_new_line_for_parameter=insert +org.eclipse.jdt.core.formatter.comment.line_length=120 +org.eclipse.jdt.core.formatter.comment.new_lines_at_block_boundaries=true +org.eclipse.jdt.core.formatter.comment.new_lines_at_javadoc_boundaries=true +org.eclipse.jdt.core.formatter.comment.preserve_white_space_between_code_and_line_comments=false +org.eclipse.jdt.core.formatter.compact_else_if=true +org.eclipse.jdt.core.formatter.continuation_indentation=2 +org.eclipse.jdt.core.formatter.continuation_indentation_for_array_initializer=2 +org.eclipse.jdt.core.formatter.disabling_tag=@formatter\:off +org.eclipse.jdt.core.formatter.enabling_tag=@formatter\:on +org.eclipse.jdt.core.formatter.format_guardian_clause_on_one_line=false +org.eclipse.jdt.core.formatter.format_line_comment_starting_on_first_column=true +org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_annotation_declaration_header=true +org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_enum_constant_header=true +org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_enum_declaration_header=true +org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_type_header=true +org.eclipse.jdt.core.formatter.indent_breaks_compare_to_cases=true +org.eclipse.jdt.core.formatter.indent_empty_lines=false +org.eclipse.jdt.core.formatter.indent_statements_compare_to_block=true +org.eclipse.jdt.core.formatter.indent_statements_compare_to_body=true +org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_cases=true +org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_switch=false +org.eclipse.jdt.core.formatter.indentation.size=2 +org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_field=insert +org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_local_variable=insert +org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_method=insert +org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_package=insert +org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_parameter=do not insert +org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_type=insert +org.eclipse.jdt.core.formatter.insert_new_line_after_label=do not insert +org.eclipse.jdt.core.formatter.insert_new_line_after_opening_brace_in_array_initializer=do not insert +org.eclipse.jdt.core.formatter.insert_new_line_at_end_of_file_if_missing=insert +org.eclipse.jdt.core.formatter.insert_new_line_before_catch_in_try_statement=insert +org.eclipse.jdt.core.formatter.insert_new_line_before_closing_brace_in_array_initializer=do not insert +org.eclipse.jdt.core.formatter.insert_new_line_before_else_in_if_statement=insert +org.eclipse.jdt.core.formatter.insert_new_line_before_finally_in_try_statement=insert +org.eclipse.jdt.core.formatter.insert_new_line_before_while_in_do_statement=do not insert +org.eclipse.jdt.core.formatter.insert_new_line_in_empty_annotation_declaration=insert +org.eclipse.jdt.core.formatter.insert_new_line_in_empty_anonymous_type_declaration=insert +org.eclipse.jdt.core.formatter.insert_new_line_in_empty_block=insert +org.eclipse.jdt.core.formatter.insert_new_line_in_empty_enum_constant=insert +org.eclipse.jdt.core.formatter.insert_new_line_in_empty_enum_declaration=insert +org.eclipse.jdt.core.formatter.insert_new_line_in_empty_method_body=insert +org.eclipse.jdt.core.formatter.insert_new_line_in_empty_type_declaration=insert +org.eclipse.jdt.core.formatter.insert_space_after_and_in_type_parameter=insert +org.eclipse.jdt.core.formatter.insert_space_after_assignment_operator=insert +org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation_type_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_binary_operator=insert +org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_arguments=insert +org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_parameters=insert +org.eclipse.jdt.core.formatter.insert_space_after_closing_brace_in_block=insert +org.eclipse.jdt.core.formatter.insert_space_after_closing_paren_in_cast=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_colon_in_assert=insert +org.eclipse.jdt.core.formatter.insert_space_after_colon_in_case=insert +org.eclipse.jdt.core.formatter.insert_space_after_colon_in_conditional=insert +org.eclipse.jdt.core.formatter.insert_space_after_colon_in_for=insert +org.eclipse.jdt.core.formatter.insert_space_after_colon_in_labeled_statement=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_allocation_expression=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_annotation=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_array_initializer=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_constructor_declaration_parameters=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_constructor_declaration_throws=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_enum_constant_arguments=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_enum_declarations=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_explicitconstructorcall_arguments=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_for_increments=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_for_inits=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_declaration_parameters=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_declaration_throws=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_invocation_arguments=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_multiple_field_declarations=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_multiple_local_declarations=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_parameterized_type_reference=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_superinterfaces=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_arguments=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_parameters=insert +org.eclipse.jdt.core.formatter.insert_space_after_ellipsis=insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_parameterized_type_reference=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_arguments=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_parameters=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_brace_in_array_initializer=insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_bracket_in_array_allocation_expression=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_bracket_in_array_reference=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_annotation=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_cast=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_catch=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_constructor_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_enum_constant=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_for=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_if=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_method_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_method_invocation=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_parenthesized_expression=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_switch=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_synchronized=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_try=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_while=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_postfix_operator=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_prefix_operator=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_question_in_conditional=insert +org.eclipse.jdt.core.formatter.insert_space_after_question_in_wildcard=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_semicolon_in_for=insert +org.eclipse.jdt.core.formatter.insert_space_after_semicolon_in_try_resources=insert +org.eclipse.jdt.core.formatter.insert_space_after_unary_operator=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_and_in_type_parameter=insert +org.eclipse.jdt.core.formatter.insert_space_before_assignment_operator=insert +org.eclipse.jdt.core.formatter.insert_space_before_at_in_annotation_type_declaration=insert +org.eclipse.jdt.core.formatter.insert_space_before_binary_operator=insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_parameterized_type_reference=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_arguments=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_parameters=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_brace_in_array_initializer=insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_bracket_in_array_allocation_expression=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_bracket_in_array_reference=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_annotation=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_cast=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_catch=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_constructor_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_enum_constant=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_for=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_if=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_method_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_method_invocation=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_parenthesized_expression=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_switch=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_synchronized=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_try=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_while=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_colon_in_assert=insert +org.eclipse.jdt.core.formatter.insert_space_before_colon_in_case=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_colon_in_conditional=insert +org.eclipse.jdt.core.formatter.insert_space_before_colon_in_default=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_colon_in_for=insert +org.eclipse.jdt.core.formatter.insert_space_before_colon_in_labeled_statement=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_allocation_expression=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_annotation=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_array_initializer=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_constructor_declaration_parameters=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_constructor_declaration_throws=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_enum_constant_arguments=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_enum_declarations=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_explicitconstructorcall_arguments=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_for_increments=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_for_inits=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_declaration_parameters=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_declaration_throws=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_invocation_arguments=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_multiple_field_declarations=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_multiple_local_declarations=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_parameterized_type_reference=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_superinterfaces=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_arguments=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_parameters=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_ellipsis=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_parameterized_type_reference=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_arguments=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_parameters=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_annotation_type_declaration=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_anonymous_type_declaration=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_array_initializer=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_block=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_constructor_declaration=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_enum_constant=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_enum_declaration=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_method_declaration=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_switch=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_type_declaration=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_allocation_expression=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_reference=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_type_reference=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_annotation=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_annotation_type_member_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_catch=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_constructor_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_enum_constant=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_for=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_if=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_method_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_method_invocation=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_parenthesized_expression=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_switch=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_synchronized=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_try=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_while=insert +org.eclipse.jdt.core.formatter.insert_space_before_parenthesized_expression_in_return=insert +org.eclipse.jdt.core.formatter.insert_space_before_parenthesized_expression_in_throw=insert +org.eclipse.jdt.core.formatter.insert_space_before_postfix_operator=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_prefix_operator=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_question_in_conditional=insert +org.eclipse.jdt.core.formatter.insert_space_before_question_in_wildcard=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_semicolon=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_semicolon_in_for=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_semicolon_in_try_resources=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_unary_operator=do not insert +org.eclipse.jdt.core.formatter.insert_space_between_brackets_in_array_type_reference=do not insert +org.eclipse.jdt.core.formatter.insert_space_between_empty_braces_in_array_initializer=do not insert +org.eclipse.jdt.core.formatter.insert_space_between_empty_brackets_in_array_allocation_expression=do not insert +org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_annotation_type_member_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_constructor_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_enum_constant=do not insert +org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_invocation=do not insert +org.eclipse.jdt.core.formatter.join_lines_in_comments=true +org.eclipse.jdt.core.formatter.join_wrapped_lines=true +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_imple_if_on_one_line=false +org.eclipse.jdt.core.formatter.keep_then_statement_on_same_line=false +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_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_empty_lines_to_preserve=1 +org.eclipse.jdt.core.formatter.put_empty_statement_on_new_line=true +org.eclipse.jdt.core.formatter.tabulation.char=space +org.eclipse.jdt.core.formatter.tabulation.size=2 +org.eclipse.jdt.core.formatter.use_on_off_tags=false +org.eclipse.jdt.core.formatter.use_tabs_only_for_leading_indentations=false +org.eclipse.jdt.core.formatter.wrap_before_binary_operator=true +org.eclipse.jdt.core.formatter.wrap_before_or_operator_multicatch=true +org.eclipse.jdt.core.formatter.wrap_outer_expressions_when_nested=true diff --git a/plugins/org.eclipse.emf.cdo.examples.hibernate.server/.settings/org.eclipse.jdt.ui.prefs b/plugins/org.eclipse.emf.cdo.examples.hibernate.server/.settings/org.eclipse.jdt.ui.prefs new file mode 100644 index 0000000000..66ed83a11f --- /dev/null +++ b/plugins/org.eclipse.emf.cdo.examples.hibernate.server/.settings/org.eclipse.jdt.ui.prefs @@ -0,0 +1,3 @@ +eclipse.preferences.version=1 +formatter_profile=_EMFT +formatter_settings_version=12 diff --git a/plugins/org.eclipse.emf.cdo.examples.hibernate.server/META-INF/MANIFEST.MF b/plugins/org.eclipse.emf.cdo.examples.hibernate.server/META-INF/MANIFEST.MF index b7899d0644..1720709e52 100644 --- a/plugins/org.eclipse.emf.cdo.examples.hibernate.server/META-INF/MANIFEST.MF +++ b/plugins/org.eclipse.emf.cdo.examples.hibernate.server/META-INF/MANIFEST.MF @@ -2,7 +2,7 @@ Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: %pluginName Bundle-SymbolicName: org.eclipse.emf.cdo.examples.hibernate.server -Bundle-Version: 4.1.100.qualifier +Bundle-Version: 4.1.200.qualifier Bundle-Vendor: %providerName Bundle-Localization: plugin Bundle-RequiredExecutionEnvironment: J2SE-1.5 @@ -20,5 +20,5 @@ Import-Package: org.eclipse.emf.teneo.annotations.mapper;version="[2.0.0,3.0.0)" org.hibernate.engine.spi;version="[4.0.0,5.0.0)", org.hibernate.id;version="[4.0.0,5.0.0)", org.hibernate.persister.entity;version="[4.0.0,5.0.0)" -Export-Package: org.eclipse.emf.cdo.examples.hibernate.server;version="4.1.100" +Export-Package: org.eclipse.emf.cdo.examples.hibernate.server;version="4.1.200" Bundle-ClassPath: . diff --git a/plugins/org.eclipse.emf.cdo.examples.hibernate.server/src/org/eclipse/emf/cdo/examples/hibernate/server/CDOExampleUUIDHexGenerator.java b/plugins/org.eclipse.emf.cdo.examples.hibernate.server/src/org/eclipse/emf/cdo/examples/hibernate/server/CDOExampleUUIDHexGenerator.java index c6583300d4..f0258ee940 100644 --- a/plugins/org.eclipse.emf.cdo.examples.hibernate.server/src/org/eclipse/emf/cdo/examples/hibernate/server/CDOExampleUUIDHexGenerator.java +++ b/plugins/org.eclipse.emf.cdo.examples.hibernate.server/src/org/eclipse/emf/cdo/examples/hibernate/server/CDOExampleUUIDHexGenerator.java @@ -36,7 +36,7 @@ public class CDOExampleUUIDHexGenerator extends UUIDHexGenerator { return id; } - + return super.generate(session, obj); } } diff --git a/plugins/org.eclipse.emf.cdo.server.hibernate.teneo/.settings/org.eclipse.jdt.core.prefs b/plugins/org.eclipse.emf.cdo.server.hibernate.teneo/.settings/org.eclipse.jdt.core.prefs index dbc9f40994..667c5d77db 100644 --- a/plugins/org.eclipse.emf.cdo.server.hibernate.teneo/.settings/org.eclipse.jdt.core.prefs +++ b/plugins/org.eclipse.emf.cdo.server.hibernate.teneo/.settings/org.eclipse.jdt.core.prefs @@ -182,6 +182,7 @@ org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_switch=false org.eclipse.jdt.core.formatter.indentation.size=2 org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_field=insert org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_local_variable=insert +org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_member=insert org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_method=insert org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_package=insert org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_parameter=do not insert diff --git a/plugins/org.eclipse.emf.cdo.server.hibernate.teneo/.settings/org.eclipse.pde.prefs b/plugins/org.eclipse.emf.cdo.server.hibernate.teneo/.settings/org.eclipse.pde.prefs index fe01bb701d..c6b96bb45e 100644 --- a/plugins/org.eclipse.emf.cdo.server.hibernate.teneo/.settings/org.eclipse.pde.prefs +++ b/plugins/org.eclipse.emf.cdo.server.hibernate.teneo/.settings/org.eclipse.pde.prefs @@ -9,7 +9,7 @@ compilers.p.build.missing.output=2 compilers.p.build.output.library=1 compilers.p.build.source.library=1 compilers.p.build.src.includes=1 -compilers.p.deprecated=2 +compilers.p.deprecated=1 compilers.p.discouraged-class=1 compilers.p.internal=1 compilers.p.missing-packages=1 diff --git a/plugins/org.eclipse.emf.cdo.server.hibernate/.settings/org.eclipse.jdt.core.prefs b/plugins/org.eclipse.emf.cdo.server.hibernate/.settings/org.eclipse.jdt.core.prefs index e8d729090c..805cd8fbdd 100644 --- a/plugins/org.eclipse.emf.cdo.server.hibernate/.settings/org.eclipse.jdt.core.prefs +++ b/plugins/org.eclipse.emf.cdo.server.hibernate/.settings/org.eclipse.jdt.core.prefs @@ -193,6 +193,7 @@ org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_switch=false org.eclipse.jdt.core.formatter.indentation.size=2 org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_field=insert org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_local_variable=insert +org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_member=insert org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_method=insert org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_package=insert org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_parameter=do not insert diff --git a/plugins/org.eclipse.emf.cdo.server.hibernate/.settings/org.eclipse.pde.prefs b/plugins/org.eclipse.emf.cdo.server.hibernate/.settings/org.eclipse.pde.prefs index fe01bb701d..c6b96bb45e 100644 --- a/plugins/org.eclipse.emf.cdo.server.hibernate/.settings/org.eclipse.pde.prefs +++ b/plugins/org.eclipse.emf.cdo.server.hibernate/.settings/org.eclipse.pde.prefs @@ -9,7 +9,7 @@ compilers.p.build.missing.output=2 compilers.p.build.output.library=1 compilers.p.build.source.library=1 compilers.p.build.src.includes=1 -compilers.p.deprecated=2 +compilers.p.deprecated=1 compilers.p.discouraged-class=1 compilers.p.internal=1 compilers.p.missing-packages=1 diff --git a/plugins/org.eclipse.emf.cdo.server.hibernate/META-INF/MANIFEST.MF b/plugins/org.eclipse.emf.cdo.server.hibernate/META-INF/MANIFEST.MF index 6937c17fca..b366181241 100644 --- a/plugins/org.eclipse.emf.cdo.server.hibernate/META-INF/MANIFEST.MF +++ b/plugins/org.eclipse.emf.cdo.server.hibernate/META-INF/MANIFEST.MF @@ -1,7 +1,7 @@ Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-SymbolicName: org.eclipse.emf.cdo.server.hibernate;singleton:=true -Bundle-Version: 4.2.0.qualifier +Bundle-Version: 4.2.100.qualifier Bundle-Name: %pluginName Bundle-Vendor: %providerName Bundle-Localization: plugin @@ -14,42 +14,44 @@ Require-Bundle: org.eclipse.core.runtime;bundle-version="[3.5.0,4.0.0)", org.eclipse.emf.cdo.common;bundle-version="[4.0.0,5.0.0)", org.eclipse.emf.cdo.server;bundle-version="[4.0.0,5.0.0)";visibility:=reexport, org.eclipse.net4j.db;bundle-version="[4.0.0,5.0.0)";visibility:=reexport -Export-Package: org.eclipse.emf.cdo.server.hibernate;version="4.2.0", - org.eclipse.emf.cdo.server.internal.hibernate;version="4.2.0";x-friends:="org.eclipse.emf.cdo.server.hibernate.teneo,org.eclipse.emf.cdo.tests.hibernate", - org.eclipse.emf.cdo.server.internal.hibernate.bundle;version="4.2.0";x-internal:=true, - org.eclipse.emf.cdo.server.internal.hibernate.info;version="4.2.0";x-friends:="org.eclipse.emf.cdo.server.hibernate.teneo,org.eclipse.emf.cdo.tests.hibernate", - org.eclipse.emf.cdo.server.internal.hibernate.tuplizer;version="4.2.0";x-friends:="org.eclipse.emf.cdo.server.hibernate.teneo,org.eclipse.emf.cdo.tests.hibernate" -Import-Package: org.apache.log4j;version="[1.2.12, 1.3.0)", +Export-Package: org.eclipse.emf.cdo.server.hibernate;version="4.2.100", + org.eclipse.emf.cdo.server.internal.hibernate;version="4.2.100";x-friends:="org.eclipse.emf.cdo.server.hibernate.teneo,org.eclipse.emf.cdo.tests.hibernate", + org.eclipse.emf.cdo.server.internal.hibernate.bundle;version="4.2.100";x-internal:=true, + org.eclipse.emf.cdo.server.internal.hibernate.info;version="4.2.100";x-friends:="org.eclipse.emf.cdo.server.hibernate.teneo,org.eclipse.emf.cdo.tests.hibernate", + org.eclipse.emf.cdo.server.internal.hibernate.tuplizer;version="4.2.100";x-friends:="org.eclipse.emf.cdo.server.hibernate.teneo,org.eclipse.emf.cdo.tests.hibernate" +Import-Package: org.apache.log4j;version="[1.2.12,1.3.0)", + org.eclipse.emf.teneo;version="[2.0.1,3.0.0)", + org.eclipse.emf.teneo.annotations.mapper;version="[2.0.1,3.0.0)", + org.eclipse.emf.teneo.annotations.pamodel;version="[2.0.1,3.0.0)", + org.eclipse.emf.teneo.extension;version="[2.0.1,3.0.0)", + org.eclipse.emf.teneo.hibernate;version="[2.0.1,3.0.0)", + org.eclipse.emf.teneo.hibernate.auditing;version="[2.0.1,3.0.0)", + org.eclipse.emf.teneo.hibernate.auditing.model.teneoauditing;version="[2.0.1,3.0.0)", + org.eclipse.emf.teneo.hibernate.mapper;version="[2.0.1,3.0.0)", + org.eclipse.emf.teneo.util;version="[2.0.1,3.0.0)", org.hibernate;version="[4.0.0,5.0.0)", - org.hibernate.service;version="[4.0.0,5.0.0)", - org.hibernate.event.service.spi;version="[4.0.0,5.0.0)", - org.hibernate.internal;version="[4.0.0,5.0.0)", - org.hibernate.event.spi;version="[4.0.0,5.0.0)", - org.hibernate.collection.spi;version="[4.0.0,5.0.0)", - org.hibernate.metamodel.binding;version="[4.0.0,5.0.0)", - org.hibernate.engine.spi;version="[4.0.0,5.0.0)", - org.hibernate.event.internal;version="[4.0.0,5.0.0)", org.hibernate.cfg;version="[4.0.0,5.0.0)", + org.hibernate.collection.internal;version="[4.0.0,5.0.0)", + org.hibernate.collection.spi;version="[4.0.0,5.0.0)", org.hibernate.criterion;version="[4.0.0,5.0.0)", org.hibernate.engine;version="[4.0.0,5.0.0)", + org.hibernate.engine.spi;version="[4.0.0,5.0.0)", + org.hibernate.event.internal;version="[4.0.0,5.0.0)", + org.hibernate.event.service.spi;version="[4.0.0,5.0.0)", + org.hibernate.event.spi;version="[4.0.0,5.0.0)", org.hibernate.id;version="[4.0.0,5.0.0)", + org.hibernate.internal;version="[4.0.0,5.0.0)", org.hibernate.mapping;version="[4.0.0,5.0.0)", org.hibernate.metadata;version="[4.0.0,5.0.0)", + org.hibernate.metamodel.binding;version="[4.0.0,5.0.0)", + org.hibernate.persister.collection;version="[4.0.0,5.0.0)", org.hibernate.persister.entity;version="[4.0.0,5.0.0)", org.hibernate.property;version="[4.0.0,5.0.0)", org.hibernate.proxy;version="[4.0.0,5.0.0)", + org.hibernate.service;version="[4.0.0,5.0.0)", org.hibernate.tool.hbm2ddl;version="[4.0.0,5.0.0)", org.hibernate.tuple;version="[4.0.0,5.0.0)", org.hibernate.tuple.component;version="[4.0.0,5.0.0)", org.hibernate.tuple.entity;version="[4.0.0,5.0.0)", org.hibernate.type;version="[4.0.0,5.0.0)", - org.hibernate.usertype;version="[4.0.0,5.0.0)", - org.eclipse.emf.teneo;version="[2.0.1, 3.0.0)", - org.eclipse.emf.teneo.util;version="[2.0.1, 3.0.0)", - org.eclipse.emf.teneo.extension;version="[2.0.1, 3.0.0)", - org.eclipse.emf.teneo.annotations.mapper;version="[2.0.1, 3.0.0)", - org.eclipse.emf.teneo.annotations.pamodel;version="[2.0.1, 3.0.0)", - org.eclipse.emf.teneo.hibernate;version="[2.0.1, 3.0.0)", - org.eclipse.emf.teneo.hibernate.mapper;version="[2.0.1, 3.0.0)", - org.eclipse.emf.teneo.hibernate.auditing;version="[2.0.1, 3.0.0)", - org.eclipse.emf.teneo.hibernate.auditing.model.teneoauditing;version="[2.0.1, 3.0.0)" + org.hibernate.usertype;version="[4.0.0,5.0.0)" diff --git a/plugins/org.eclipse.emf.cdo.server.hibernate/src/org/eclipse/emf/cdo/server/internal/hibernate/HibernateQueryHandler.java b/plugins/org.eclipse.emf.cdo.server.hibernate/src/org/eclipse/emf/cdo/server/internal/hibernate/HibernateQueryHandler.java index 99b780eb64..d436bd1ec0 100644 --- a/plugins/org.eclipse.emf.cdo.server.hibernate/src/org/eclipse/emf/cdo/server/internal/hibernate/HibernateQueryHandler.java +++ b/plugins/org.eclipse.emf.cdo.server.hibernate/src/org/eclipse/emf/cdo/server/internal/hibernate/HibernateQueryHandler.java @@ -27,7 +27,6 @@ import org.eclipse.emf.ecore.EReference; import org.eclipse.emf.ecore.EStructuralFeature; import org.eclipse.emf.teneo.hibernate.auditing.model.teneoauditing.TeneoAuditEntry; -import org.hibernate.Hibernate; import org.hibernate.Query; import org.hibernate.ScrollMode; import org.hibernate.ScrollableResults; @@ -43,17 +42,6 @@ import java.lang.reflect.Array; */ public class HibernateQueryHandler implements IQueryHandler { - /** - * @deprecated use {@link IHibernateStore#QUERY_LANGUAGE} - */ - @Deprecated - public static final String QUERY_LANGUAGE = IHibernateStore.QUERY_LANGUAGE; - - /** - * @deprecated use {@link IHibernateStore#FIRST_RESULT} - */ - @Deprecated - public static final String FIRST_RESULT = IHibernateStore.FIRST_RESULT; private HibernateStoreAccessor hibernateStoreAccessor; @@ -75,124 +63,130 @@ public class HibernateQueryHandler implements IQueryHandler // get a transaction, the hibernateStoreAccessor is placed in a threadlocal // so all db access uses the same session. final Session session = hibernateStoreAccessor.getHibernateSession(); - - // create the query - final Query query = session.createQuery(info.getQueryString()); - query.setReadOnly(true); - - // get the parameters with some parameter conversion - int firstResult = -1; - boolean cacheResults = true; - for (String key : info.getParameters().keySet()) + try { - if (key.compareToIgnoreCase(IHibernateStore.CACHE_RESULTS) == 0) - { - try - { - cacheResults = (Boolean)info.getParameters().get(key); - } - catch (ClassCastException e) - { - throw new IllegalArgumentException( - "Parameter " + IHibernateStore.CACHE_RESULTS + " must be a boolean. errorMessage " + e.getMessage()); //$NON-NLS-1$ - } - } - else if (key.compareToIgnoreCase(IHibernateStore.FIRST_RESULT) == 0) + // create the query + final Query query = session.createQuery(info.getQueryString()); + query.setReadOnly(true); + + // get the parameters with some parameter conversion + int firstResult = -1; + boolean cacheResults = true; + for (String key : info.getParameters().keySet()) { - final Object o = info.getParameters().get(key); - if (o != null) + if (key.compareToIgnoreCase(IHibernateStore.CACHE_RESULTS) == 0) { try { - firstResult = (Integer)o; + cacheResults = (Boolean)info.getParameters().get(key); } catch (ClassCastException e) { - throw new IllegalArgumentException("Parameter firstResult must be an integer but it is a " + o //$NON-NLS-1$ - + " class " + o.getClass().getName()); //$NON-NLS-1$ + throw new IllegalArgumentException( + "Parameter " + IHibernateStore.CACHE_RESULTS + " must be a boolean. errorMessage " + e.getMessage()); //$NON-NLS-1$ } } - } - else - { - // in case the parameter is a CDOID get the object from the db - final Object param = info.getParameters().get(key); - if (param instanceof CDOID && HibernateUtil.getInstance().isStoreCreatedID((CDOID)param)) + else if (key.compareToIgnoreCase(IHibernateStore.FIRST_RESULT) == 0) { - final CDOID id = (CDOID)param; - final String entityName = HibernateUtil.getInstance().getEntityName(id); - final Serializable idValue = HibernateUtil.getInstance().getIdValue(id); - final CDORevision revision = (CDORevision)session.get(entityName, idValue); - query.setEntity(key, revision); - if (cacheResults) + final Object o = info.getParameters().get(key); + if (o != null) { - addToRevisionCache(revision); + try + { + firstResult = (Integer)o; + } + catch (ClassCastException e) + { + throw new IllegalArgumentException("Parameter firstResult must be an integer but it is a " + o //$NON-NLS-1$ + + " class " + o.getClass().getName()); //$NON-NLS-1$ + } } } else { - query.setParameter(key, param); + // in case the parameter is a CDOID get the object from the db + final Object param = info.getParameters().get(key); + if (param instanceof CDOID && HibernateUtil.getInstance().isStoreCreatedID((CDOID)param)) + { + final CDOID id = (CDOID)param; + final String entityName = HibernateUtil.getInstance().getEntityName(id); + final Serializable idValue = HibernateUtil.getInstance().getIdValue(id); + final CDORevision revision = (CDORevision)session.get(entityName, idValue); + query.setEntity(key, revision); + if (cacheResults) + { + addToRevisionCache(revision); + } + } + else + { + query.setParameter(key, param); + } } } - } - // set the first result - if (firstResult > -1) - { - query.setFirstResult(firstResult); - } + // set the first result + if (firstResult > -1) + { + query.setFirstResult(firstResult); + } - // the max result - if (info.getMaxResults() != CDOQueryInfo.UNLIMITED_RESULTS) - { - query.setMaxResults(info.getMaxResults()); - } + // the max result + if (info.getMaxResults() != CDOQueryInfo.UNLIMITED_RESULTS) + { + query.setMaxResults(info.getMaxResults()); + } - final ScrollableResults scroller = query.scroll(ScrollMode.FORWARD_ONLY); + final ScrollableResults scroller = query.scroll(ScrollMode.FORWARD_ONLY); - // and go for the query - // future extension: support iterate, scroll through a parameter - int i = 0; - try - { - while (scroller.next()) + // and go for the query + // future extension: support iterate, scroll through a parameter + int i = 0; + try { - Object[] os = scroller.get(); - Object o; - if (os.length == 1) - { - o = handleAuditEntries(os[0]); - } - else + while (scroller.next()) { - o = handleAuditEntries(os); - } + Object[] os = scroller.get(); + Object o; + if (os.length == 1) + { + o = handleAuditEntries(os[0]); + } + else + { + o = handleAuditEntries(os); + } - final boolean addOneMore = context.addResult(o); - if (cacheResults && o instanceof CDORevision) - { - addToRevisionCache((CDORevision)o); - } - if (o instanceof InternalCDORevision) - { - ((InternalCDORevision)o).freeze(); - } + final boolean addOneMore = context.addResult(o); + if (cacheResults && o instanceof CDORevision) + { + addToRevisionCache((CDORevision)o); + } + if (o instanceof InternalCDORevision) + { + ((InternalCDORevision)o).freeze(); + } - // clear the session every 1000 results or so - if (i++ % 1000 == 0) - { - session.clear(); - } + // clear the session every 1000 results or so + if (i++ % 1000 == 0) + { + session.clear(); + } - if (!addOneMore) - { - return; + if (!addOneMore) + { + return; + } } } + finally + { + scroller.close(); + } } finally { - scroller.close(); + session.close(); } } @@ -264,11 +258,8 @@ public class HibernateQueryHandler implements IQueryHandler final Object value = internalRevision.getValue(feature); if (value instanceof WrappedHibernateList) { - Hibernate.initialize(((WrappedHibernateList)value).getDelegate()); - } - else - { - Hibernate.initialize(value); + // force the size to be cached + ((WrappedHibernateList)value).size(); } } } diff --git a/plugins/org.eclipse.emf.cdo.server.hibernate/src/org/eclipse/emf/cdo/server/internal/hibernate/HibernateStore.java b/plugins/org.eclipse.emf.cdo.server.hibernate/src/org/eclipse/emf/cdo/server/internal/hibernate/HibernateStore.java index 4e072897ef..bfafbc03c1 100644 --- a/plugins/org.eclipse.emf.cdo.server.hibernate/src/org/eclipse/emf/cdo/server/internal/hibernate/HibernateStore.java +++ b/plugins/org.eclipse.emf.cdo.server.hibernate/src/org/eclipse/emf/cdo/server/internal/hibernate/HibernateStore.java @@ -224,7 +224,7 @@ public class HibernateStore extends Store implements IHibernateStore return epacks; } - private boolean isAuditEPackage(EPackage ePackage) + boolean isAuditEPackage(EPackage ePackage) { return TeneoauditingPackage.eNS_URI.equals(ePackage.getNsURI()) || ePackage.getEAnnotation(Constants.ANNOTATION_SOURCE_AUDITING) != null; diff --git a/plugins/org.eclipse.emf.cdo.server.hibernate/src/org/eclipse/emf/cdo/server/internal/hibernate/HibernateStoreAccessor.java b/plugins/org.eclipse.emf.cdo.server.hibernate/src/org/eclipse/emf/cdo/server/internal/hibernate/HibernateStoreAccessor.java index 09f6233a70..ab1ab978fc 100644 --- a/plugins/org.eclipse.emf.cdo.server.hibernate/src/org/eclipse/emf/cdo/server/internal/hibernate/HibernateStoreAccessor.java +++ b/plugins/org.eclipse.emf.cdo.server.hibernate/src/org/eclipse/emf/cdo/server/internal/hibernate/HibernateStoreAccessor.java @@ -48,7 +48,6 @@ import org.eclipse.emf.cdo.spi.common.revision.InternalCDORevisionDelta; import org.eclipse.emf.cdo.spi.server.InternalCommitContext; import org.eclipse.emf.cdo.spi.server.Store; import org.eclipse.emf.cdo.spi.server.StoreAccessor; -import org.eclipse.emf.cdo.spi.server.StoreChunkReader; import org.eclipse.net4j.util.HexUtil; import org.eclipse.net4j.util.ObjectUtil; @@ -69,11 +68,9 @@ import org.eclipse.emf.ecore.EPackage; import org.eclipse.emf.ecore.EReference; import org.eclipse.emf.ecore.EStructuralFeature; import org.eclipse.emf.ecore.EcoreFactory; -import org.eclipse.emf.teneo.Constants; import org.eclipse.emf.teneo.PackageRegistryProvider; import org.eclipse.emf.teneo.hibernate.auditing.model.teneoauditing.TeneoAuditCommitInfo; import org.eclipse.emf.teneo.hibernate.auditing.model.teneoauditing.TeneoAuditEntry; -import org.eclipse.emf.teneo.hibernate.auditing.model.teneoauditing.TeneoauditingPackage; import org.hibernate.Criteria; import org.hibernate.FlushMode; @@ -126,6 +123,8 @@ public class HibernateStoreAccessor extends StoreAccessor implements IHibernateS private boolean errorOccured; + private int currentListChunk = -1; + private HibernateRawCommitContext rawCommitContext = new HibernateRawCommitContext(); public void addToRevisionCache(Object object) @@ -326,9 +325,7 @@ public class HibernateStoreAccessor extends StoreAccessor implements IHibernateS } /** - * Note: the Hibernate store does not support the {@link StoreChunkReader} concept!. - * - * @return a {@link HibernateStoreChunkReader} (which throws UnsupportedOperationExceptions for most methods + * @return a {@link HibernateStoreChunkReader} */ public HibernateStoreChunkReader createChunkReader(InternalCDORevision revision, EStructuralFeature feature) { @@ -376,47 +373,54 @@ public class HibernateStoreAccessor extends StoreAccessor implements IHibernateS { return null; } - - if (getStore().isAuditing() && getStore().getHibernateAuditHandler().getCDOAuditHandler().isAudited(id)) + currentListChunk = listChunk; + try { - InternalCDORevision revision = getStore().getHibernateAuditHandler().readRevision(getHibernateSession(), id, - branchPoint.getTimeStamp()); - // found one, use it - if (revision != null) + if (getStore().isAuditing() && getStore().getHibernateAuditHandler().getCDOAuditHandler().isAudited(id)) { + InternalCDORevision revision = getStore().getHibernateAuditHandler().readRevision(getHibernateSession(), id, + branchPoint.getTimeStamp()); + // found one, use it + if (revision != null) + { + + if (cache != null) + { + cache.addRevision(revision); + } + revision.freeze(); - if (cache != null) + return revision; + } + } + + final InternalCDORevision revision = HibernateUtil.getInstance().getCDORevision(id); + if (revision == null) + { + final CDOClassifierRef classifierRef = CDOIDUtil.getClassifierRef(id); + if (classifierRef == null) { - cache.addRevision(revision); + throw new IllegalArgumentException("This CDOID type of " + id + " is not supported by this store."); //$NON-NLS-1$ //$NON-NLS-2$ } - revision.freeze(); - return revision; + final EClass eClass = HibernateUtil.getInstance().getEClass(classifierRef); + return new DetachedCDORevision(eClass, id, branchPoint.getBranch(), 0, 0); } - } - final InternalCDORevision revision = HibernateUtil.getInstance().getCDORevision(id); - if (revision == null) - { - final CDOClassifierRef classifierRef = CDOIDUtil.getClassifierRef(id); - if (classifierRef == null) + revision.setBranchPoint(getStore().getMainBranchHead()); + revision.freeze(); + + if (cache != null) { - throw new IllegalArgumentException("This CDOID type of " + id + " is not supported by this store."); //$NON-NLS-1$ //$NON-NLS-2$ + cache.addRevision(revision); } - final EClass eClass = HibernateUtil.getInstance().getEClass(classifierRef); - return new DetachedCDORevision(eClass, id, branchPoint.getBranch(), 0, 0); + return revision; } - - revision.setBranchPoint(getStore().getMainBranchHead()); - revision.freeze(); - - if (cache != null) + finally { - cache.addRevision(revision); + currentListChunk = -1; } - - return revision; } public Pair<Integer, Long> createBranch(int branchID, BranchInfo branchInfo) @@ -503,7 +507,7 @@ public class HibernateStoreAccessor extends StoreAccessor implements IHibernateS if (eClass != null) { - if (!getStore().isMapped(eClass)) + if (!getStore().isMapped(eClass) || getStore().isAuditEPackage(eClass.getEPackage())) { return; } @@ -515,8 +519,7 @@ public class HibernateStoreAccessor extends StoreAccessor implements IHibernateS for (EPackage ePackage : getStore().getPackageHandler().getEPackages()) { // an auditing epackage - if (ePackage == TeneoauditingPackage.eINSTANCE - || ePackage.getEAnnotation(Constants.ANNOTATION_SOURCE_AUDITING) != null) + if (getStore().isAuditEPackage(ePackage)) { continue; } @@ -896,6 +899,8 @@ public class HibernateStoreAccessor extends StoreAccessor implements IHibernateS // order is 1) insert, 2) update and then delete // this order is the most stable! Do not change it without testing + // System.err.println(getStore().getMappingXml()); + final List<InternalCDORevision> repairContainerIDs = new ArrayList<InternalCDORevision>(); final List<InternalCDORevision> repairResourceIDs = new ArrayList<InternalCDORevision>(); for (InternalCDORevision revision : context.getNewObjects()) @@ -1415,4 +1420,9 @@ public class HibernateStoreAccessor extends StoreAccessor implements IHibernateS protected void doUnpassivate() throws Exception { } + + public int getCurrentListChunk() + { + return currentListChunk; + } } diff --git a/plugins/org.eclipse.emf.cdo.server.hibernate/src/org/eclipse/emf/cdo/server/internal/hibernate/HibernateStoreChunkReader.java b/plugins/org.eclipse.emf.cdo.server.hibernate/src/org/eclipse/emf/cdo/server/internal/hibernate/HibernateStoreChunkReader.java index 30cef28086..5bc577cea2 100644 --- a/plugins/org.eclipse.emf.cdo.server.hibernate/src/org/eclipse/emf/cdo/server/internal/hibernate/HibernateStoreChunkReader.java +++ b/plugins/org.eclipse.emf.cdo.server.hibernate/src/org/eclipse/emf/cdo/server/internal/hibernate/HibernateStoreChunkReader.java @@ -7,15 +7,29 @@ * * Contributors: * Eike Stepper - initial API and implementation + * Martin Taal - Implementation */ package org.eclipse.emf.cdo.server.internal.hibernate; +import org.eclipse.emf.cdo.common.id.CDOID; +import org.eclipse.emf.cdo.common.revision.CDOList; import org.eclipse.emf.cdo.common.revision.CDORevision; import org.eclipse.emf.cdo.server.hibernate.IHibernateStoreChunkReader; +import org.eclipse.emf.cdo.server.internal.hibernate.tuplizer.WrappedHibernateList; +import org.eclipse.emf.cdo.spi.common.revision.InternalCDORevision; import org.eclipse.emf.cdo.spi.server.StoreChunkReader; +import org.eclipse.emf.ecore.EReference; import org.eclipse.emf.ecore.EStructuralFeature; +import org.hibernate.Query; +import org.hibernate.Session; +import org.hibernate.collection.spi.PersistentCollection; +import org.hibernate.engine.spi.CollectionEntry; +import org.hibernate.engine.spi.SessionFactoryImplementor; +import org.hibernate.engine.spi.SessionImplementor; +import org.hibernate.persister.collection.QueryableCollection; + import java.util.List; /** @@ -34,22 +48,187 @@ public class HibernateStoreChunkReader extends StoreChunkReader implements IHibe return (HibernateStoreAccessor)super.getAccessor(); } - @Override - public void addSimpleChunk(int index) + public List<Chunk> executeRead() { - // super.addSimpleChunk(index); - throw new UnsupportedOperationException(); // TODO Implement me + // get a transaction, the hibernateStoreAccessor is placed in a threadlocal + // so all db access uses the same session. + final Session session = getAccessor().getHibernateSession(); + + // reread the revision as it is probably unreferenced + final InternalCDORevision latestRevision = getLatestRevision(session); + Object value = latestRevision.getValue(getFeature()); + if (value instanceof WrappedHibernateList) + { + value = ((WrappedHibernateList)value).getDelegate(); + } + + // hibernate details... + boolean useExtraLazyMode = false; + boolean standardCDOList = false; + QueryableCollection persister = null; + CollectionEntry entry = null; + if (value instanceof PersistentCollection) + { + final PersistentCollection persistentCollection = (PersistentCollection)value; + persister = (QueryableCollection)((SessionFactoryImplementor)session.getSessionFactory()) + .getCollectionPersister(persistentCollection.getRole()); + entry = ((SessionImplementor)session).getPersistenceContext().getCollectionEntry(persistentCollection); + + useExtraLazyMode = !persister.getElementType().isEntityType(); + if (useExtraLazyMode && ((PersistentCollection)value).hasQueuedOperations()) + { + session.flush(); + } + } + else + { + standardCDOList = true; + } + + final List<Chunk> chunks = getChunks(); + for (Chunk chunk : chunks) + { + final int startIndex = chunk.getStartIndex(); + final int maxElements = chunk.size(); + if (standardCDOList) + { + // for eattributes just read them all, no chunking there... + final CDOList list = (CDOList)value; + if (startIndex >= list.size()) + { + return chunks; + } + for (int i = startIndex; i < startIndex + maxElements; i++) + { + if (i >= list.size()) + { + break; + } + addToChunk(chunk, i - startIndex, list.get(i)); + } + } + else if (useExtraLazyMode) + { + if (getFeature() instanceof EReference) + { + for (int i = startIndex; i < startIndex + maxElements; i++) + { + final Object object = persister.getElementByIndex(entry.getLoadedKey(), i, (SessionImplementor)session, + latestRevision); + // could happen if the index > size) + if (object == null) + { + continue; + } + addToChunk(chunk, i - startIndex, object); + } + } + else + { + // for eattributes just read them all, no chunking there... + final List<?> list = (List<?>)value; + if (startIndex >= list.size()) + { + return chunks; + } + for (int i = startIndex; i < startIndex + maxElements; i++) + { + if (i >= list.size()) + { + break; + } + addToChunk(chunk, i - startIndex, list.get(i)); + } + } + } + else + { + final Query filterQuery = session.createFilter(value, ""); + filterQuery.setMaxResults(maxElements); + filterQuery.setFirstResult(startIndex); + int i = 0; + for (Object object : filterQuery.list()) + { + addToChunk(chunk, i++, object); + } + } + } + return chunks; } - @Override - public void addRangedChunk(int fromIndex, int toIndex) + private InternalCDORevision getLatestRevision(Session session) { - // super.addRangedChunk(fromIndex, toIndex); - throw new UnsupportedOperationException(); // TODO Implement me + final CDOID id = getRevision().getID(); + + final HibernateStore store = getAccessor().getStore(); + + if (store.isAuditing() && store.getHibernateAuditHandler().getCDOAuditHandler().isAudited(id)) + { + InternalCDORevision revision = store.getHibernateAuditHandler().readRevision(session, id, + getRevision().getTimeStamp()); + // found one, use it + if (revision != null) + { + return revision; + } + } + + return HibernateUtil.getInstance().getCDORevision(id); } - public List<Chunk> executeRead() + private void addToRevisionCache(Object revision) + { + final InternalCDORevision internalRevision = (InternalCDORevision)revision; + for (EStructuralFeature feature : internalRevision.getEClass().getEAllStructuralFeatures()) + { + if (!isMappedFeature(internalRevision, feature)) + { + continue; + } + + if (feature.isMany() || feature instanceof EReference) + { + final Object value = internalRevision.getValue(feature); + if (value instanceof WrappedHibernateList) + { + // force the size to be cached + ((WrappedHibernateList)value).size(); + } + } + } + + getAccessor().addToRevisionCache(revision); + } + + private void addToChunk(Chunk chunk, int i, Object object) { - throw new UnsupportedOperationException(); // TODO Implement me + if (object instanceof CDORevision) + { + addToRevisionCache(object); + chunk.add(i, HibernateUtil.getInstance().getCDOID(object)); + } + else + { + chunk.add(i, object); + } } + + private boolean isMappedFeature(InternalCDORevision revision, EStructuralFeature feature) + { + try + { + int featureID = revision.getClassInfo().getEClass().getFeatureID(feature); + revision.getClassInfo().getPersistentFeatureIndex(featureID); + return true; + } + catch (IllegalArgumentException ex) + { + return false; + } + catch (ArrayIndexOutOfBoundsException ex) + { + return false; + } + } + } diff --git a/plugins/org.eclipse.emf.cdo.server.hibernate/src/org/eclipse/emf/cdo/server/internal/hibernate/HibernateUtil.java b/plugins/org.eclipse.emf.cdo.server.hibernate/src/org/eclipse/emf/cdo/server/internal/hibernate/HibernateUtil.java index ebb7ae1a67..ff096ac048 100644 --- a/plugins/org.eclipse.emf.cdo.server.hibernate/src/org/eclipse/emf/cdo/server/internal/hibernate/HibernateUtil.java +++ b/plugins/org.eclipse.emf.cdo.server.hibernate/src/org/eclipse/emf/cdo/server/internal/hibernate/HibernateUtil.java @@ -14,6 +14,7 @@ package org.eclipse.emf.cdo.server.internal.hibernate; import org.eclipse.emf.cdo.CDOObject; import org.eclipse.emf.cdo.common.id.CDOID; import org.eclipse.emf.cdo.common.id.CDOIDExternal; +import org.eclipse.emf.cdo.common.id.CDOIDString; import org.eclipse.emf.cdo.common.id.CDOIDTemp; import org.eclipse.emf.cdo.common.id.CDOIDUtil; import org.eclipse.emf.cdo.common.model.CDOClassifierRef; @@ -658,6 +659,10 @@ public class HibernateUtil */ public Serializable getIdValue(CDOID id) { + if (id instanceof CDOIDString) + { + return ((CDOIDString)id).getStringValue(); + } return CDOIDUtil.getLong(id); } diff --git a/plugins/org.eclipse.emf.cdo.server.hibernate/src/org/eclipse/emf/cdo/server/internal/hibernate/tuplizer/CDOManyAttributeSetter.java b/plugins/org.eclipse.emf.cdo.server.hibernate/src/org/eclipse/emf/cdo/server/internal/hibernate/tuplizer/CDOManyAttributeSetter.java index 66138c66ee..9e611bb069 100644 --- a/plugins/org.eclipse.emf.cdo.server.hibernate/src/org/eclipse/emf/cdo/server/internal/hibernate/tuplizer/CDOManyAttributeSetter.java +++ b/plugins/org.eclipse.emf.cdo.server.hibernate/src/org/eclipse/emf/cdo/server/internal/hibernate/tuplizer/CDOManyAttributeSetter.java @@ -64,7 +64,7 @@ public class CDOManyAttributeSetter extends CDOPropertySetter @SuppressWarnings("unchecked") List<Object> valueList = (List<Object>)value; - final WrappedHibernateList whl = new WrappedHibernateList(); + final WrappedHibernateList whl = new WrappedHibernateList(revision, getEStructuralFeature()); whl.setDelegate(valueList); super.set(target, whl, factory); } diff --git a/plugins/org.eclipse.emf.cdo.server.hibernate/src/org/eclipse/emf/cdo/server/internal/hibernate/tuplizer/CDOManyReferenceSetter.java b/plugins/org.eclipse.emf.cdo.server.hibernate/src/org/eclipse/emf/cdo/server/internal/hibernate/tuplizer/CDOManyReferenceSetter.java index 54dc030bd8..d587f2bc78 100644 --- a/plugins/org.eclipse.emf.cdo.server.hibernate/src/org/eclipse/emf/cdo/server/internal/hibernate/tuplizer/CDOManyReferenceSetter.java +++ b/plugins/org.eclipse.emf.cdo.server.hibernate/src/org/eclipse/emf/cdo/server/internal/hibernate/tuplizer/CDOManyReferenceSetter.java @@ -64,7 +64,7 @@ public class CDOManyReferenceSetter extends CDOPropertySetter @SuppressWarnings("unchecked") List<Object> valueList = (List<Object>)value; - final WrappedHibernateList whl = new WrappedHibernateList(); + final WrappedHibernateList whl = new WrappedHibernateList(revision, getEStructuralFeature()); whl.setDelegate(valueList); super.set(target, whl, factory); } diff --git a/plugins/org.eclipse.emf.cdo.server.hibernate/src/org/eclipse/emf/cdo/server/internal/hibernate/tuplizer/WrappedHibernateList.java b/plugins/org.eclipse.emf.cdo.server.hibernate/src/org/eclipse/emf/cdo/server/internal/hibernate/tuplizer/WrappedHibernateList.java index c54b8ebbc6..ff1a57024e 100644 --- a/plugins/org.eclipse.emf.cdo.server.hibernate/src/org/eclipse/emf/cdo/server/internal/hibernate/tuplizer/WrappedHibernateList.java +++ b/plugins/org.eclipse.emf.cdo.server.hibernate/src/org/eclipse/emf/cdo/server/internal/hibernate/tuplizer/WrappedHibernateList.java @@ -16,15 +16,26 @@ import org.eclipse.emf.cdo.common.model.CDOModelUtil; import org.eclipse.emf.cdo.common.model.CDOType; import org.eclipse.emf.cdo.common.revision.CDOListFactory; import org.eclipse.emf.cdo.common.revision.CDORevision; +import org.eclipse.emf.cdo.common.revision.CDORevisionUtil; +import org.eclipse.emf.cdo.server.IStoreChunkReader.Chunk; +import org.eclipse.emf.cdo.server.internal.hibernate.HibernateStoreAccessor; +import org.eclipse.emf.cdo.server.internal.hibernate.HibernateStoreChunkReader; +import org.eclipse.emf.cdo.server.internal.hibernate.HibernateThreadContext; import org.eclipse.emf.cdo.server.internal.hibernate.HibernateUtil; import org.eclipse.emf.cdo.spi.common.revision.CDOReferenceAdjuster; import org.eclipse.emf.cdo.spi.common.revision.InternalCDOList; +import org.eclipse.emf.cdo.spi.common.revision.InternalCDORevision; import org.eclipse.emf.ecore.EClass; import org.eclipse.emf.ecore.EClassifier; import org.eclipse.emf.ecore.EEnumLiteral; +import org.eclipse.emf.ecore.EReference; import org.eclipse.emf.ecore.EStructuralFeature; +import org.hibernate.collection.internal.AbstractPersistentCollection; +import org.hibernate.engine.spi.CollectionEntry; +import org.hibernate.engine.spi.SessionImplementor; +import org.hibernate.persister.collection.CollectionPersister; import org.hibernate.proxy.HibernateProxy; import java.util.ArrayList; @@ -46,8 +57,25 @@ public class WrappedHibernateList implements InternalCDOList private boolean frozen; - public WrappedHibernateList() + private int cachedSize = -1; + + private final EStructuralFeature eFeature; + + private final InternalCDORevision owner; + + private Chunk cachedChunk; + + private int currentListChunk = -1; + + public WrappedHibernateList(InternalCDORevision owner, EStructuralFeature eFeature) { + this.owner = owner; + this.eFeature = eFeature; + final HibernateStoreAccessor accessor = HibernateThreadContext.getCurrentStoreAccessor(); + if (accessor != null) + { + currentListChunk = accessor.getCurrentListChunk(); + } } public void move(int newPosition, Object object) @@ -140,7 +168,7 @@ public class WrappedHibernateList implements InternalCDOList if (classifier instanceof EClass) { - WrappedHibernateList wrapped = new WrappedHibernateList(); + WrappedHibernateList wrapped = new WrappedHibernateList(owner, eFeature); wrapped.setDelegate(list); return wrapped; } @@ -152,9 +180,58 @@ public class WrappedHibernateList implements InternalCDOList */ public List<Object> getDelegate() { + if (delegate instanceof AbstractPersistentCollection && !((AbstractPersistentCollection)delegate).wasInitialized() + && !isConnectedToSession()) + { + // use a dummy auto-expanding list + setDelegate(new ArrayList<Object>() + { + private static final long serialVersionUID = 1L; + + @Override + public Object set(int index, Object element) + { + ensureSize(index); + return super.set(index, element); + } + + @Override + public Object get(int index) + { + ensureSize(index); + final Object o = super.get(index); + if (o == null) + { + return CDORevisionUtil.UNINITIALIZED; + } + return o; + } + + private void ensureSize(int index) + { + if (index >= size()) + { + for (int i = size() - 1; i <= index; i++) + { + add(null); + } + } + } + + }); + } + return delegate; } + protected boolean isConnectedToSession() + { + final AbstractPersistentCollection persistentCollection = (AbstractPersistentCollection)delegate; + final SessionImplementor session = persistentCollection.getSession(); + return session != null && session.isOpen() + && session.getPersistenceContext().containsCollection(persistentCollection); + } + /** * @param delegate * the delegate to set @@ -201,22 +278,28 @@ public class WrappedHibernateList implements InternalCDOList return result; } - protected CDOID getCDOID(Object o) + protected Object getCDOValue(Object o) { if (o instanceof CDOID) { - return (CDOID)o; + return o; + } + + if (o instanceof HibernateProxy || o instanceof CDORevision) + { + return HibernateUtil.getInstance().getCDOID(o); } - return HibernateUtil.getInstance().getCDOID(o); + // primitive type + return o; } - protected List<CDOID> getCDOIDs(Collection<?> c) + protected List<Object> getCDOValues(Collection<?> c) { - List<CDOID> newC = new ArrayList<CDOID>(); + List<Object> newC = new ArrayList<Object>(); for (Object o : c) { - newC.add(getCDOID(o)); + newC.add(getCDOValue(o)); } return newC; @@ -225,25 +308,25 @@ public class WrappedHibernateList implements InternalCDOList public void add(int index, Object element) { checkFrozen(); - getDelegate().add(index, getCDOID(element)); + getDelegate().add(index, getCDOValue(element)); } public boolean add(Object o) { checkFrozen(); - return getDelegate().add(getCDOID(o)); + return getDelegate().add(getCDOValue(o)); } public boolean addAll(Collection<? extends Object> c) { checkFrozen(); - return getDelegate().addAll(getCDOIDs(c)); + return getDelegate().addAll(getCDOValues(c)); } public boolean addAll(int index, Collection<? extends Object> c) { checkFrozen(); - return getDelegate().addAll(index, getCDOIDs(c)); + return getDelegate().addAll(index, getCDOValues(c)); } public void clear() @@ -254,12 +337,12 @@ public class WrappedHibernateList implements InternalCDOList public boolean contains(Object o) { - return getDelegate().contains(getCDOID(o)); + return getDelegate().contains(getCDOValue(o)); } public boolean containsAll(Collection<?> c) { - return getDelegate().containsAll(getCDOIDs(c)); + return getDelegate().containsAll(getCDOValues(c)); } public Object get(int index) @@ -275,14 +358,72 @@ public class WrappedHibernateList implements InternalCDOList public Object get(int index, boolean resolve) { - // Since delegate is a hibernate list, it is never a CDOElementProxy - // so the parameter resolve can be ignored + // if the collection is not initialized then always return + // uninitialized to prevent loading it aggresively + if (!resolve && currentListChunk > -1 && eFeature instanceof EReference + && getDelegate() instanceof AbstractPersistentCollection) + { + final AbstractPersistentCollection collection = (AbstractPersistentCollection)getDelegate(); + if (!collection.wasInitialized()) + { + final Object chunkedValue = getChunkedValue(index); + if (chunkedValue != null) + { + return chunkedValue; + } + return CDORevisionUtil.UNINITIALIZED; + } + } + return get(index); } + private Object getChunkedValue(int index) + { + if (index >= currentListChunk) + { + return null; + } + readInitialChunk(index); + if (cachedChunk != null) + { + // note index must be within the range as the chunk + // is read again if index is too large. + return cachedChunk.get(index); + } + return null; + } + + private void readInitialChunk(int index) + { + + if (cachedChunk != null) + { + if (index < cachedChunk.size()) + { + // a valid chunk + return; + } + // a not valid chunk + // reread it + cachedChunk = null; + } + final HibernateStoreAccessor accessor = HibernateThreadContext.getCurrentStoreAccessor(); + if (accessor == null) + { + return; + } + if (currentListChunk > -1) + { + final HibernateStoreChunkReader chunkReader = accessor.createChunkReader(owner, eFeature); + chunkReader.addRangedChunk(0, currentListChunk); + cachedChunk = chunkReader.executeRead().get(0); + } + } + public int indexOf(Object o) { - return getDelegate().indexOf(getCDOID(o)); + return getDelegate().indexOf(getCDOValue(o)); } public boolean isEmpty() @@ -297,7 +438,7 @@ public class WrappedHibernateList implements InternalCDOList public int lastIndexOf(Object o) { - return getDelegate().lastIndexOf(getCDOID(o)); + return getDelegate().lastIndexOf(getCDOValue(o)); } public ListIterator<Object> listIterator() @@ -319,33 +460,62 @@ public class WrappedHibernateList implements InternalCDOList public boolean remove(Object o) { checkFrozen(); - return getDelegate().remove(getCDOID(o)); + return getDelegate().remove(getCDOValue(o)); } public boolean removeAll(Collection<?> c) { checkFrozen(); - return getDelegate().removeAll(getCDOIDs(c)); + return getDelegate().removeAll(getCDOValues(c)); } public boolean retainAll(Collection<?> c) { - return getDelegate().retainAll(getCDOIDs(c)); + return getDelegate().retainAll(getCDOValues(c)); } public Object set(int index, Object element) { checkFrozen(); + + if (element == CDORevisionUtil.UNINITIALIZED) + { + return null; + } + if (element instanceof CDOID) { return getDelegate().set(index, element); } - return getDelegate().set(index, getCDOID(element)); + return getDelegate().set(index, getCDOValue(element)); } public int size() { + if (cachedSize != -1) + { + return cachedSize; + } + if (getDelegate() instanceof AbstractPersistentCollection) + { + final AbstractPersistentCollection collection = (AbstractPersistentCollection)getDelegate(); + if (collection.wasInitialized()) + { + cachedSize = -1; + return getDelegate().size(); + } + final SessionImplementor session = collection.getSession(); + CollectionEntry entry = session.getPersistenceContext().getCollectionEntry(collection); + CollectionPersister persister = entry.getLoadedPersister(); + if (collection.hasQueuedOperations()) + { + session.flush(); + } + cachedSize = persister.getSize(entry.getLoadedKey(), session); + return cachedSize; + } + return getDelegate().size(); } @@ -475,6 +645,8 @@ public class WrappedHibernateList implements InternalCDOList private void checkFrozen() { + // a frozen check always implies a modification + cachedSize = -1; if (frozen) { throw new IllegalStateException("Cannot modify a frozen list"); @@ -485,4 +657,9 @@ public class WrappedHibernateList implements InternalCDOList { getDelegate().set(i, value); } + + CDORevision getOwner() + { + return owner; + } } diff --git a/plugins/org.eclipse.emf.cdo.tests.hibernate/.settings/org.eclipse.pde.prefs b/plugins/org.eclipse.emf.cdo.tests.hibernate/.settings/org.eclipse.pde.prefs index fe01bb701d..c6b96bb45e 100644 --- a/plugins/org.eclipse.emf.cdo.tests.hibernate/.settings/org.eclipse.pde.prefs +++ b/plugins/org.eclipse.emf.cdo.tests.hibernate/.settings/org.eclipse.pde.prefs @@ -9,7 +9,7 @@ compilers.p.build.missing.output=2 compilers.p.build.output.library=1 compilers.p.build.source.library=1 compilers.p.build.src.includes=1 -compilers.p.deprecated=2 +compilers.p.deprecated=1 compilers.p.discouraged-class=1 compilers.p.internal=1 compilers.p.missing-packages=1 diff --git a/plugins/org.eclipse.emf.cdo.tests.hibernate/META-INF/MANIFEST.MF b/plugins/org.eclipse.emf.cdo.tests.hibernate/META-INF/MANIFEST.MF index c35d114db6..a14d128143 100644 --- a/plugins/org.eclipse.emf.cdo.tests.hibernate/META-INF/MANIFEST.MF +++ b/plugins/org.eclipse.emf.cdo.tests.hibernate/META-INF/MANIFEST.MF @@ -20,8 +20,7 @@ Require-Bundle: org.eclipse.core.runtime;bundle-version="[3.5.0,4.0.0)", com.mysql.jdbc;bundle-version="[5.1.7,6.0.0)", org.dom4j;bundle-version="[1.6.1,2.0.0)", javax.persistence;bundle-version="[2.0.0,3.0.0)" -Export-Package: mappings;version="4.1.100";x-friends:="org.eclipse.emf.cdo.tests.hudson", - org.eclipse.emf.cdo.tests.hibernate;version="4.1.200";x-friends:="org.eclipse.emf.cdo.tests.hudson", +Export-Package: org.eclipse.emf.cdo.tests.hibernate;version="4.1.200";x-friends:="org.eclipse.emf.cdo.tests.hudson", org.eclipse.emf.cdo.tests.hibernate.model.HibernateTest;version="4.1.200", org.eclipse.emf.cdo.tests.hibernate.model.HibernateTest.impl;version="4.1.200", org.eclipse.emf.cdo.tests.hibernate.model.HibernateTest.util;version="4.1.200" diff --git a/plugins/org.eclipse.emf.cdo.tests.hibernate/build.properties b/plugins/org.eclipse.emf.cdo.tests.hibernate/build.properties index 7b11911fe5..731ef791f3 100644 --- a/plugins/org.eclipse.emf.cdo.tests.hibernate/build.properties +++ b/plugins/org.eclipse.emf.cdo.tests.hibernate/build.properties @@ -20,7 +20,10 @@ bin.includes = META-INF/,\ about.ini,\ about.mappings,\ about.properties,\ - modeling32.png + modeling32.png,\ + src/log4j.properties,\ + src/app.properties,\ + src/org/eclipse/emf/cdo/tests/hibernate/cdo_hibernate.persistence.xml src.includes = about.html,\ copyright.txt,\ CDO AllTests (Hibernate).launch,\ diff --git a/plugins/org.eclipse.emf.cdo.tests.hibernate/src/app.properties b/plugins/org.eclipse.emf.cdo.tests.hibernate/src/app.properties index 0d6dc563cd..1ecf9eb2a7 100644 --- a/plugins/org.eclipse.emf.cdo.tests.hibernate/src/app.properties +++ b/plugins/org.eclipse.emf.cdo.tests.hibernate/src/app.properties @@ -1,9 +1,14 @@ +# Teneo options +teneo.mapping.set_proxy=true +teneo.mapping.cascade_policy_on_non_containment=PERSIST,MERGE +teneo.mapping.persistence_xml.parse.lenient=true +teneo.runtime.elist_efficient_size_operation=true + +# Hibernate options hibernate.hbm2ddl.auto=create-drop hibernate.show_sql=false hibernate.connection.pool_size=10 -teneo.mapping.set_proxy=true - # ----------------------------------------------------------- # DEFAULT SETTINGS FOR IN MEMORY HSQLDB DATABASE. # @@ -27,7 +32,4 @@ hibernate.cache.provider_class=org.hibernate.cache.HashtableCacheProvider #hibernate.connection.url=jdbc:mysql://localhost:3306/cdohibernate #hibernate.connection.username=root #hibernate.connection.password=root -#hibernate.dialect=org.hibernate.dialect.MySQL5InnoDBDialect - -teneo.mapping.cascade_policy_on_non_containment=PERSIST,MERGE -teneo.mapping.persistence_xml.parse.lenient=true
\ No newline at end of file +#hibernate.dialect=org.hibernate.dialect.MySQL5InnoDBDialect
\ No newline at end of file diff --git a/plugins/org.eclipse.emf.cdo.tests.hibernate/src/mappings/product.hbm.xml b/plugins/org.eclipse.emf.cdo.tests.hibernate/src/mappings/product.hbm.xml deleted file mode 100644 index 174d68a56f..0000000000 --- a/plugins/org.eclipse.emf.cdo.tests.hibernate/src/mappings/product.hbm.xml +++ /dev/null @@ -1,218 +0,0 @@ -<?xml version="1.0"?> -<!DOCTYPE hibernate-mapping SYSTEM "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd"> - -<hibernate-mapping auto-import="false"> - <class entity-name="Address" abstract="false" lazy="false" discriminator-value="Address" table="`address`"> - <meta attribute="eclassName">Address</meta> - <meta attribute="epackage">http://www.eclipse.org/emf/CDO/tests/model1/1.0.0</meta> - <tuplizer entity-mode="pojo" class="org.eclipse.emf.cdo.server.internal.hibernate.tuplizer.CDORevisionTuplizer"/> - <tuplizer entity-mode="dynamic-map" class="org.eclipse.emf.cdo.server.internal.hibernate.tuplizer.CDORevisionTuplizer"/> - <id type="long" name="e_id" column="e_id" access="org.eclipse.emf.teneo.hibernate.mapping.identifier.IdentifierPropertyHandler"> - <meta attribute="syntheticId">true</meta> - <generator class="native"/> - </id> - <discriminator column="`dtype`" type="string"/> - <version name="e_version" column="e_version" access="org.eclipse.emf.teneo.hibernate.mapping.property.VersionPropertyHandler"> - <meta attribute="syntheticVersion">true</meta> - </version> - <property name="name" lazy="false" insert="true" update="true" not-null="false" unique="false" type="java.lang.String"> - <column not-null="false" unique="false" name="`name`"/> - </property> - <property name="street" lazy="false" insert="true" update="true" not-null="false" unique="false" type="java.lang.String"> - <column not-null="false" unique="false" name="`street`"/> - </property> - <property name="city" lazy="false" insert="true" update="true" not-null="false" unique="false" type="java.lang.String"> - <column not-null="false" unique="false" name="`city`"/> - </property> - </class> - <subclass entity-name="Company" abstract="false" lazy="false" extends="Address" discriminator-value="Company"> - <meta attribute="eclassName">Company</meta> - <meta attribute="epackage">http://www.eclipse.org/emf/CDO/tests/model1/1.0.0</meta> - <tuplizer entity-mode="pojo" class="org.eclipse.emf.cdo.server.internal.hibernate.tuplizer.CDORevisionTuplizer"/> - <tuplizer entity-mode="dynamic-map" class="org.eclipse.emf.cdo.server.internal.hibernate.tuplizer.CDORevisionTuplizer"/> - <list name="categories" lazy="true" cascade="all,delete-orphan"> - <key update="true" foreign-key="company_categories"> - <column name="`company_categories_e_id`" not-null="false" unique="false"/> - </key> - <list-index column="`company_categories_idx`"/> - <one-to-many entity-name="Category"/> - </list> - <list name="suppliers" lazy="true" cascade="all,delete-orphan"> - <key update="true" foreign-key="company_suppliers"> - <column name="`company_suppliers_e_id`" not-null="false" unique="false"/> - </key> - <list-index column="`company_suppliers_idx`"/> - <one-to-many entity-name="Supplier"/> - </list> - <list name="customers" lazy="true" cascade="all,delete-orphan"> - <key update="true" foreign-key="company_customers"> - <column name="`company_customers_e_id`" not-null="false" unique="false"/> - </key> - <list-index column="`company_customers_idx`"/> - <one-to-many entity-name="Customer"/> - </list> - <list name="purchaseOrders" lazy="true" cascade="all,delete-orphan"> - <key update="true" foreign-key="company_purchaseorders"> - <column name="`company_purchaseorders_e_id`" not-null="false" unique="false"/> - </key> - <list-index column="`company_purchaseorders_idx`"/> - <one-to-many entity-name="PurchaseOrder"/> - </list> - <list name="salesOrders" lazy="true" cascade="all,delete-orphan"> - <key update="true" foreign-key="company_salesorders"> - <column name="`company_salesorders_e_id`" not-null="false" unique="false"/> - </key> - <list-index column="`company_salesorders_idx`"/> - <one-to-many entity-name="SalesOrder"/> - </list> - </subclass> - <subclass entity-name="Supplier" abstract="false" lazy="false" extends="Address" discriminator-value="Supplier"> - <meta attribute="eclassName">Supplier</meta> - <meta attribute="epackage">http://www.eclipse.org/emf/CDO/tests/model1/1.0.0</meta> - <tuplizer entity-mode="pojo" class="org.eclipse.emf.cdo.server.internal.hibernate.tuplizer.CDORevisionTuplizer"/> - <tuplizer entity-mode="dynamic-map" class="org.eclipse.emf.cdo.server.internal.hibernate.tuplizer.CDORevisionTuplizer"/> - <list name="purchaseOrders" lazy="true"> - <key update="true"> - <column name="`purchaseorder_supplier_e_id`" not-null="false" unique="false"/> - </key> - <list-index column="`supplier_purchaseorders_idx`"/> - <one-to-many entity-name="PurchaseOrder"/> - </list> - </subclass> - <subclass entity-name="Customer" abstract="false" lazy="false" extends="Address" discriminator-value="Customer"> - <meta attribute="eclassName">Customer</meta> - <meta attribute="epackage">http://www.eclipse.org/emf/CDO/tests/model1/1.0.0</meta> - <tuplizer entity-mode="pojo" class="org.eclipse.emf.cdo.server.internal.hibernate.tuplizer.CDORevisionTuplizer"/> - <tuplizer entity-mode="dynamic-map" class="org.eclipse.emf.cdo.server.internal.hibernate.tuplizer.CDORevisionTuplizer"/> - <list name="salesOrders" lazy="true"> - <key update="true"> - <column name="`salesorder_customer_e_id`" not-null="false" unique="false"/> - </key> - <list-index column="`customer_salesorders_idx`"/> - <one-to-many entity-name="SalesOrder"/> - </list> - </subclass> - <class entity-name="Order" abstract="false" lazy="false" discriminator-value="Order" table="`order`"> - <meta attribute="eclassName">Order</meta> - <meta attribute="epackage">http://www.eclipse.org/emf/CDO/tests/model1/1.0.0</meta> - <tuplizer entity-mode="pojo" class="org.eclipse.emf.cdo.server.internal.hibernate.tuplizer.CDORevisionTuplizer"/> - <tuplizer entity-mode="dynamic-map" class="org.eclipse.emf.cdo.server.internal.hibernate.tuplizer.CDORevisionTuplizer"/> - <id type="long" name="e_id" column="e_id" access="org.eclipse.emf.teneo.hibernate.mapping.identifier.IdentifierPropertyHandler"> - <meta attribute="syntheticId">true</meta> - <generator class="native"/> - </id> - <discriminator column="`dtype`" type="string"/> - <version name="e_version" column="e_version" access="org.eclipse.emf.teneo.hibernate.mapping.property.VersionPropertyHandler"> - <meta attribute="syntheticVersion">true</meta> - </version> - <list name="orderDetails" lazy="true" cascade="all,delete-orphan"> - <key update="true"> - <column name="`orderdetail_order_e_id`" not-null="false" unique="false"/> - </key> - <list-index column="`order_orderdetails_idx`"/> - <one-to-many entity-name="OrderDetail"/> - </list> - </class> - <class entity-name="OrderDetail" abstract="false" lazy="false" discriminator-value="OrderDetail" table="`orderdetail`"> - <meta attribute="eclassName">OrderDetail</meta> - <meta attribute="epackage">http://www.eclipse.org/emf/CDO/tests/model1/1.0.0</meta> - <tuplizer entity-mode="pojo" class="org.eclipse.emf.cdo.server.internal.hibernate.tuplizer.CDORevisionTuplizer"/> - <tuplizer entity-mode="dynamic-map" class="org.eclipse.emf.cdo.server.internal.hibernate.tuplizer.CDORevisionTuplizer"/> - <id type="long" name="e_id" column="e_id" access="org.eclipse.emf.teneo.hibernate.mapping.identifier.IdentifierPropertyHandler"> - <meta attribute="syntheticId">true</meta> - <generator class="native"/> - </id> - <discriminator column="`dtype`" type="string"/> - <version name="e_version" column="e_version" access="org.eclipse.emf.teneo.hibernate.mapping.property.VersionPropertyHandler"> - <meta attribute="syntheticVersion">true</meta> - </version> - <many-to-one name="order" entity-name="Order" foreign-key="orderdetail_order" lazy="false" insert="false" update="false" not-null="false"> - <column not-null="false" unique="false" name="`orderdetail_order_e_id`"/> - </many-to-one> - <many-to-one name="product" entity-name="Product" foreign-key="orderdetail_product" lazy="false" insert="false" update="false" not-null="false"> - <column not-null="false" unique="false" name="`orderdetail_product_e_id`"/> - </many-to-one> - <property name="price" lazy="false" insert="true" update="true" not-null="false" unique="false" type="float"> - <column not-null="false" unique="false" name="`price`"/> - </property> - </class> - <subclass entity-name="PurchaseOrder" abstract="false" lazy="false" extends="Order" discriminator-value="PurchaseOrder"> - <meta attribute="eclassName">PurchaseOrder</meta> - <meta attribute="epackage">http://www.eclipse.org/emf/CDO/tests/model1/1.0.0</meta> - <tuplizer entity-mode="pojo" class="org.eclipse.emf.cdo.server.internal.hibernate.tuplizer.CDORevisionTuplizer"/> - <tuplizer entity-mode="dynamic-map" class="org.eclipse.emf.cdo.server.internal.hibernate.tuplizer.CDORevisionTuplizer"/> - <property name="date" lazy="false" insert="true" update="true" not-null="false" unique="false" type="timestamp"> - <column not-null="false" unique="false" name="`date`"/> - </property> - <many-to-one name="supplier" entity-name="Supplier" foreign-key="purchaseorder_supplier" lazy="false" insert="false" update="false" not-null="false"> - <column not-null="false" unique="false" name="`purchaseorder_supplier_e_id`"/> - </many-to-one> - </subclass> - <subclass entity-name="SalesOrder" abstract="false" lazy="false" extends="Order" discriminator-value="SalesOrder"> - <meta attribute="eclassName">SalesOrder</meta> - <meta attribute="epackage">http://www.eclipse.org/emf/CDO/tests/model1/1.0.0</meta> - <tuplizer entity-mode="pojo" class="org.eclipse.emf.cdo.server.internal.hibernate.tuplizer.CDORevisionTuplizer"/> - <tuplizer entity-mode="dynamic-map" class="org.eclipse.emf.cdo.server.internal.hibernate.tuplizer.CDORevisionTuplizer"/> - <property name="id" lazy="false" insert="true" update="true" not-null="false" unique="false" type="int"> - <column not-null="false" unique="false" name="`id`"/> - </property> - <many-to-one name="customer" entity-name="Customer" foreign-key="salesorder_customer" lazy="false" insert="false" update="false" not-null="false"> - <column not-null="false" unique="false" name="`salesorder_customer_e_id`"/> - </many-to-one> - </subclass> - <class entity-name="Category" abstract="false" lazy="false" discriminator-value="Category" table="`category`"> - <meta attribute="eclassName">Category</meta> - <meta attribute="epackage">http://www.eclipse.org/emf/CDO/tests/model1/1.0.0</meta> - <tuplizer entity-mode="pojo" class="org.eclipse.emf.cdo.server.internal.hibernate.tuplizer.CDORevisionTuplizer"/> - <tuplizer entity-mode="dynamic-map" class="org.eclipse.emf.cdo.server.internal.hibernate.tuplizer.CDORevisionTuplizer"/> - <id type="long" name="e_id" column="e_id" access="org.eclipse.emf.teneo.hibernate.mapping.identifier.IdentifierPropertyHandler"> - <meta attribute="syntheticId">true</meta> - <generator class="native"/> - </id> - <discriminator column="`dtype`" type="string"/> - <version name="e_version" column="e_version" access="org.eclipse.emf.teneo.hibernate.mapping.property.VersionPropertyHandler"> - <meta attribute="syntheticVersion">true</meta> - </version> - <property name="name" lazy="false" insert="true" update="true" not-null="false" unique="false" type="java.lang.String"> - <column not-null="false" unique="false" name="`name`"/> - </property> - <list name="categories" lazy="true" cascade="all,delete-orphan"> - <key update="true" foreign-key="category_categories"> - <column name="`category_categories_e_id`" not-null="false" unique="false"/> - </key> - <list-index column="`category_categories_idx`"/> - <one-to-many entity-name="Category"/> - </list> - <list name="products" lazy="true" cascade="all,delete-orphan"> - <key update="true" foreign-key="category_products"> - <column name="`category_products_e_id`" not-null="false" unique="false"/> - </key> - <list-index column="`category_products_idx`"/> - <one-to-many entity-name="Product"/> - </list> - </class> - <class entity-name="Product" abstract="false" lazy="false" discriminator-value="Product" table="`product`"> - <meta attribute="eclassName">Product</meta> - <meta attribute="epackage">http://www.eclipse.org/emf/CDO/tests/model1/1.0.0</meta> - <tuplizer entity-mode="pojo" class="org.eclipse.emf.cdo.server.internal.hibernate.tuplizer.CDORevisionTuplizer"/> - <tuplizer entity-mode="dynamic-map" class="org.eclipse.emf.cdo.server.internal.hibernate.tuplizer.CDORevisionTuplizer"/> - <id type="long" name="e_id" column="e_id" access="org.eclipse.emf.teneo.hibernate.mapping.identifier.IdentifierPropertyHandler"> - <meta attribute="syntheticId">true</meta> - <generator class="native"/> - </id> - <discriminator column="`dtype`" type="string"/> - <version name="e_version" column="e_version" access="org.eclipse.emf.teneo.hibernate.mapping.property.VersionPropertyHandler"> - <meta attribute="syntheticVersion">true</meta> - </version> - <property name="name" lazy="false" insert="true" update="true" not-null="false" unique="false" type="java.lang.String"> - <column not-null="false" unique="false" name="`name`"/> - </property> - <list name="orderDetails" lazy="true"> - <key update="true"> - <column name="`orderdetail_product_e_id`" not-null="false" unique="false"/> - </key> - <list-index column="`product_orderdetails_idx`"/> - <one-to-many entity-name="OrderDetail"/> - </list> - </class> -</hibernate-mapping> diff --git a/plugins/org.eclipse.emf.cdo.tests.hibernate/src/org/eclipse/emf/cdo/tests/hibernate/AllTestsHibernate.java b/plugins/org.eclipse.emf.cdo.tests.hibernate/src/org/eclipse/emf/cdo/tests/hibernate/AllTestsHibernate.java index 71e0f44a03..a545218506 100644 --- a/plugins/org.eclipse.emf.cdo.tests.hibernate/src/org/eclipse/emf/cdo/tests/hibernate/AllTestsHibernate.java +++ b/plugins/org.eclipse.emf.cdo.tests.hibernate/src/org/eclipse/emf/cdo/tests/hibernate/AllTestsHibernate.java @@ -15,6 +15,7 @@ import org.eclipse.emf.cdo.tests.AllConfigs; import org.eclipse.emf.cdo.tests.AttributeTest; import org.eclipse.emf.cdo.tests.BackupTest; import org.eclipse.emf.cdo.tests.CommitInfoTest; +import org.eclipse.emf.cdo.tests.CrossReferenceTest; import org.eclipse.emf.cdo.tests.DynamicXSDTest; import org.eclipse.emf.cdo.tests.EMFCompareTest; import org.eclipse.emf.cdo.tests.ExternalReferenceTest; @@ -44,9 +45,13 @@ import org.eclipse.emf.cdo.tests.bugzilla.Bugzilla_351393_Test; import org.eclipse.emf.cdo.tests.bugzilla.Bugzilla_352204_Test; import org.eclipse.emf.cdo.tests.bugzilla.Bugzilla_359966_Test; import org.eclipse.emf.cdo.tests.bugzilla.Bugzilla_362270_Test; +import org.eclipse.emf.cdo.tests.bugzilla.Bugzilla_362270b_Test; +import org.eclipse.emf.cdo.tests.bugzilla.Bugzilla_362270c_Test; import org.eclipse.emf.cdo.tests.bugzilla.Bugzilla_365832_Test; import org.eclipse.emf.cdo.tests.bugzilla.Bugzilla_381472_Test; import org.eclipse.emf.cdo.tests.bugzilla.Bugzilla_390185_Test; +import org.eclipse.emf.cdo.tests.bugzilla.Bugzilla_400236_Test; +import org.eclipse.emf.cdo.tests.bugzilla.Bugzilla_405191_Test; import org.eclipse.emf.cdo.tests.config.IRepositoryConfig; import org.eclipse.emf.cdo.tests.config.IScenario; import org.eclipse.emf.cdo.tests.config.impl.ConfigTest; @@ -78,12 +83,13 @@ public class AllTestsHibernate extends AllConfigs protected void initTestClasses(List<Class<? extends ConfigTest>> testClasses, IScenario scenario) { // testClasses.clear(); - // testClasses.add(HibernateBugzilla_380987_Test.class); + // testClasses.add(HibernateQueryTest.class); // if (true) // { // return; // } + testClasses.add(HibernateChunkingTest.class); testClasses.add(Hibernate_Failure_Test.class); testClasses.add(Hibernate_Export_Test.class); testClasses.add(HibernateBugzilla_381013_Test.class); @@ -92,8 +98,6 @@ public class AllTestsHibernate extends AllConfigs testClasses.add(HibernateBugzilla_387752_Test.class); testClasses.add(HibernateBugzilla_387752_True_Test.class); - // testClasses.add(HibernateBugzilla_387752_Test.class); - testClasses.add(HibernateBugzilla_333473_Test.class); testClasses.add(HibernateTimeStampTest.class); @@ -104,14 +108,27 @@ public class AllTestsHibernate extends AllConfigs testClasses.add(HibernateQueryNoCachingTest.class); testClasses.add(HibernateBugzilla_301104_Test.class); - testClasses.add(HibernateBugzilla_362270_Test.class); - super.initTestClasses(testClasses, scenario); + // remove as it tries to persist an eannotation + testClasses.remove(Bugzilla_400236_Test.class); + + testClasses.add(HibernateBugzilla_362270b_Test.class); + testClasses.remove(Bugzilla_362270b_Test.class); + + testClasses.add(HibernateBugzilla_362270c_Test.class); + testClasses.remove(Bugzilla_362270c_Test.class); + + testClasses.add(HibernateBugzilla_405191_Test.class); + testClasses.remove(Bugzilla_405191_Test.class); + // for some reason this test needs to be done first... testClasses.remove(Bugzilla_306998_Test.class); testClasses.add(0, Bugzilla_306998_Test.class); + testClasses.remove(CrossReferenceTest.class); + testClasses.add(HibernateCrossReferenceTest.class); + testClasses.add(HibernateBugzilla_356181_Test.class); // the hb store throws an error on deadlocked transaction @@ -123,6 +140,9 @@ public class AllTestsHibernate extends AllConfigs if (scenario.getCapabilities().contains(IRepositoryConfig.CAPABILITY_AUDITING)) { + // need to add additional auditing annotations + testClasses.remove(HibernateBugzilla_405191_Test.class); + testClasses.add(HibernateBugzilla_395684_Test.class); testClasses.add(CDOObjectHistoryTest.class); @@ -311,7 +331,7 @@ public class AllTestsHibernate extends AllConfigs { final IRepositoryConfig repConfig = getRepositoryConfig(); final HibernateConfig hbConfig = (HibernateConfig)repConfig; - final String persistenceXML = "org/eclipse/emf/cdo/tests/hibernate/external_model1_4.persistence.xml"; + final String persistenceXML = "org/eclipse/emf/cdo/tests/hibernate/cdo_hibernate.persistence.xml"; hbConfig.getAdditionalProperties().put(HibernateStore.PERSISTENCE_XML, persistenceXML); super.doSetUp(); diff --git a/plugins/org.eclipse.emf.cdo.tests.hibernate/src/org/eclipse/emf/cdo/tests/hibernate/AllTestsHibernate.java.orig b/plugins/org.eclipse.emf.cdo.tests.hibernate/src/org/eclipse/emf/cdo/tests/hibernate/AllTestsHibernate.java.orig new file mode 100644 index 0000000000..71e0f44a03 --- /dev/null +++ b/plugins/org.eclipse.emf.cdo.tests.hibernate/src/org/eclipse/emf/cdo/tests/hibernate/AllTestsHibernate.java.orig @@ -0,0 +1,350 @@ +/* + * Copyright (c) 2008-2013 Eike Stepper (Berlin, Germany) and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Eike Stepper - initial API and implementation + */ +package org.eclipse.emf.cdo.tests.hibernate; + +import org.eclipse.emf.cdo.server.internal.hibernate.HibernateStore; +import org.eclipse.emf.cdo.tests.AllConfigs; +import org.eclipse.emf.cdo.tests.AttributeTest; +import org.eclipse.emf.cdo.tests.BackupTest; +import org.eclipse.emf.cdo.tests.CommitInfoTest; +import org.eclipse.emf.cdo.tests.DynamicXSDTest; +import org.eclipse.emf.cdo.tests.EMFCompareTest; +import org.eclipse.emf.cdo.tests.ExternalReferenceTest; +import org.eclipse.emf.cdo.tests.FeatureMapTest; +import org.eclipse.emf.cdo.tests.LockingManagerRestartRepositoryTest; +import org.eclipse.emf.cdo.tests.LockingManagerRestartSessionTest; +import org.eclipse.emf.cdo.tests.LockingManagerRestartTransactionTest; +import org.eclipse.emf.cdo.tests.LockingManagerTest; +import org.eclipse.emf.cdo.tests.LockingNotificationsTest; +import org.eclipse.emf.cdo.tests.MEMStoreQueryTest; +import org.eclipse.emf.cdo.tests.MultiValuedOfAttributeTest; +import org.eclipse.emf.cdo.tests.PackageRegistryTest; +import org.eclipse.emf.cdo.tests.SecurityManagerTest; +import org.eclipse.emf.cdo.tests.UnsetTest; +import org.eclipse.emf.cdo.tests.WorkspaceTest; +import org.eclipse.emf.cdo.tests.XATransactionTest; +import org.eclipse.emf.cdo.tests.bugzilla.Bugzilla_258933_Test; +import org.eclipse.emf.cdo.tests.bugzilla.Bugzilla_272861_Test; +import org.eclipse.emf.cdo.tests.bugzilla.Bugzilla_279982_Test; +import org.eclipse.emf.cdo.tests.bugzilla.Bugzilla_303466_Test; +import org.eclipse.emf.cdo.tests.bugzilla.Bugzilla_306998_Test; +import org.eclipse.emf.cdo.tests.bugzilla.Bugzilla_322804_Test; +import org.eclipse.emf.cdo.tests.bugzilla.Bugzilla_329254_Test; +import org.eclipse.emf.cdo.tests.bugzilla.Bugzilla_334995_Test; +import org.eclipse.emf.cdo.tests.bugzilla.Bugzilla_347964_Test; +import org.eclipse.emf.cdo.tests.bugzilla.Bugzilla_351393_Test; +import org.eclipse.emf.cdo.tests.bugzilla.Bugzilla_352204_Test; +import org.eclipse.emf.cdo.tests.bugzilla.Bugzilla_359966_Test; +import org.eclipse.emf.cdo.tests.bugzilla.Bugzilla_362270_Test; +import org.eclipse.emf.cdo.tests.bugzilla.Bugzilla_365832_Test; +import org.eclipse.emf.cdo.tests.bugzilla.Bugzilla_381472_Test; +import org.eclipse.emf.cdo.tests.bugzilla.Bugzilla_390185_Test; +import org.eclipse.emf.cdo.tests.config.IRepositoryConfig; +import org.eclipse.emf.cdo.tests.config.IScenario; +import org.eclipse.emf.cdo.tests.config.impl.ConfigTest; +import org.eclipse.emf.cdo.util.CommitException; + +import java.util.List; + +import junit.framework.Test; +import junit.framework.TestSuite; + +/** + * @author Eike Stepper + */ +public class AllTestsHibernate extends AllConfigs +{ + public static Test suite() + { + return new AllTestsHibernate().getTestSuite(); + } + + @Override + protected void initConfigSuites(TestSuite parent) + { + addScenario(parent, HibernateConfig.INSTANCE, JVM, NATIVE); + addScenario(parent, HibernateConfig.AUDIT_INSTANCE, JVM, NATIVE); + } + + @Override + protected void initTestClasses(List<Class<? extends ConfigTest>> testClasses, IScenario scenario) + { + // testClasses.clear(); + // testClasses.add(HibernateBugzilla_380987_Test.class); + // if (true) + // { + // return; + // } + + testClasses.add(Hibernate_Failure_Test.class); + testClasses.add(Hibernate_Export_Test.class); + testClasses.add(HibernateBugzilla_381013_Test.class); + testClasses.add(HibernateBugzilla_380987_Test.class); + testClasses.add(HibernateBugzilla_392653_Test.class); + testClasses.add(HibernateBugzilla_387752_Test.class); + testClasses.add(HibernateBugzilla_387752_True_Test.class); + + // testClasses.add(HibernateBugzilla_387752_Test.class); + + testClasses.add(HibernateBugzilla_333473_Test.class); + + testClasses.add(HibernateTimeStampTest.class); + // removed stalls + // testClasses.add(HibernateXATransactionTest.class); + testClasses.add(HibernateExternalAnnotationTest.class); + testClasses.add(HibernateQueryTest.class); + testClasses.add(HibernateQueryNoCachingTest.class); + testClasses.add(HibernateBugzilla_301104_Test.class); + + testClasses.add(HibernateBugzilla_362270_Test.class); + + super.initTestClasses(testClasses, scenario); + + // for some reason this test needs to be done first... + testClasses.remove(Bugzilla_306998_Test.class); + testClasses.add(0, Bugzilla_306998_Test.class); + + testClasses.add(HibernateBugzilla_356181_Test.class); + + // the hb store throws an error on deadlocked transaction + // and does not block + testClasses.remove(Bugzilla_390185_Test.class); + + testClasses.add(HibernateBugzilla_398057_Test.class); + testClasses.add(HibernateBugzilla_397682_Test.class); + + if (scenario.getCapabilities().contains(IRepositoryConfig.CAPABILITY_AUDITING)) + { + testClasses.add(HibernateBugzilla_395684_Test.class); + + testClasses.add(CDOObjectHistoryTest.class); + + // the security model inherits from the ecore model + // not so well supported for now for auditing + testClasses.remove(SecurityManagerTest.class); + + // the package registry count changes when auditing + // as auditing adds epackages + testClasses.remove(PackageRegistryTest.class); + testClasses.add(HibernatePackageRegistryTest.class); + testClasses.remove(Bugzilla_303466_Test.class); + testClasses.add(Hibernate_Bugzilla_303466_Test.class); + + // feature maps are not handled correctly in CDO with auditing + testClasses.remove(FeatureMapTest.class); + } + else + { + // these testcases uses commitinfo + // only supported with auditing + testClasses.remove(Bugzilla_329254_Test.class); + testClasses.remove(Hibernate_Bugzilla_329254_Test.class); + + // Commit info only works with auditing + testClasses.remove(CommitInfoTest.class); + } + + // renaming a resource is not possible in the hibernate store. + testClasses.remove(Bugzilla_334995_Test.class); + + // repository restart is not supported in the hibernate store + // as it clears the database + testClasses.remove(Bugzilla_347964_Test.class); + + // workspaces are not supported + testClasses.remove(WorkspaceTest.class); + + testClasses.remove(DynamicXSDTest.class); + + // delete repo is not yet supported + testClasses.remove(Bugzilla_381472_Test.class); + + testClasses.remove(Bugzilla_362270_Test.class); + + // persisting models in a resource is not supported + testClasses.remove(Bugzilla_365832_Test.class); + testClasses.remove(Bugzilla_352204_Test.class); + testClasses.remove(Bugzilla_359966_Test.class); + + // external reference in a resource not supported + testClasses.remove(Bugzilla_351393_Test.class); + + // hibernate does not support persisting + // java class and object + testClasses.add(HibernateAttributeTest.class); + testClasses.remove(AttributeTest.class); + + // Use a hibernate specific test class + // https://bugs.eclipse.org/bugs/show_bug.cgi?id=339492 + testClasses.add(Hibernate_BackupTest.class); + testClasses.remove(BackupTest.class); + + // Teneo does not yet support lists of int arrays: + // https://bugs.eclipse.org/bugs/show_bug.cgi?id=330212 + testClasses.remove(Bugzilla_322804_Test.class); + + // overridden because Hibernate will treat all stale references as an exception + testClasses.add(Hibernate_Bugzilla_279982_Test.class); + testClasses.remove(Bugzilla_279982_Test.class); + + // locking not supported + testClasses.remove(LockingManagerRestartRepositoryTest.class); + testClasses.remove(LockingManagerRestartSessionTest.class); + testClasses.remove(LockingManagerRestartTransactionTest.class); + testClasses.remove(LockingNotificationsTest.class); + testClasses.remove(LockingManagerRestartRepositoryTest.class); + + // Locking manager not supported + testClasses.remove(LockingManagerTest.class); + + // problem with wrong version of EMF Compare + testClasses.remove(EMFCompareTest.class); + + // replace a test with our local implementation: + // the MultiValueOfAttributeTest class has a method + // testListOfInteger which has a List with a null value + // this is not nicely supported by Hibernate + // therefore this step is removed + testClasses.add(HibernateMultiValuedOfAttributeTest.class); + testClasses.remove(MultiValuedOfAttributeTest.class); + + // MemStore is not relevant + testClasses.remove(MEMStoreQueryTest.class); + + // replace test case to do external mapping + testClasses.remove(XATransactionTest.class); + + // replace test case with one, disabling some non working testcases + // see the HibernateExternalReferenceTest for a description + testClasses.add(HibernateExternalReferenceTest.class); + testClasses.remove(ExternalReferenceTest.class); + + // this testcases removes and creates a resource with the + // same path in one transaction, that's not supported + // by hibernate.. because of unique key constraints + testClasses.remove(Bugzilla_272861_Test.class); + + // override a testcase because the hibernate store + // has a different meaning of unset + testClasses.add(HibernateBugzilla_258933_Test.class); + testClasses.remove(Bugzilla_258933_Test.class); + + // replace as unsettable has to be re-visited for the hb store + // see Bug 298579, it does not work for object types + testClasses.add(HibernateUnsetTest.class); + testClasses.remove(UnsetTest.class); + } + + /** + * Overridden because one testcase does not pass as Hibernate currently does not store the isset boolean values in the + * database. + * + * @author Eike Stepper + */ + public static class HibernateUnsetTest extends UnsetTest + { + @Override + public void testUnsettableBaseTypeVsObjectType() + { + } + } + + public static class HibernatePackageRegistryTest extends PackageRegistryTest + { + + @Override + public void testCommitNestedPackages() throws Exception + { + } + + @Override + public void testCommitTopLevelPackages() throws Exception + { + } + } + + // overridden because Hibernate will treat all stale references as an exception + public static class Hibernate_Bugzilla_279982_Test extends Bugzilla_279982_Test + { + @Override + public void testBugzilla_279982_Single() throws Exception + { + try + { + super.testBugzilla_279982_Single(); + } + catch (Exception e) + { + assertEquals(true, e instanceof CommitException); + assertEquals(true, e.getMessage().contains("org.hibernate.ObjectNotFoundException")); + } + } + + @Override + public void testBugzilla_279982_Multi_RevisionPrefetchingPolicy() throws Exception + { + try + { + super.testBugzilla_279982_Multi_RevisionPrefetchingPolicy(); + } + catch (Exception e) + { + assertEquals(true, e instanceof CommitException); + assertEquals(true, e.getMessage().contains("org.hibernate.ObjectNotFoundException")); + } + } + } + + public static class Hibernate_BackupTest extends BackupTest + { + + @Override + protected void doSetUp() throws Exception + { + final IRepositoryConfig repConfig = getRepositoryConfig(); + final HibernateConfig hbConfig = (HibernateConfig)repConfig; + final String persistenceXML = "org/eclipse/emf/cdo/tests/hibernate/external_model1_4.persistence.xml"; + hbConfig.getAdditionalProperties().put(HibernateStore.PERSISTENCE_XML, persistenceXML); + + super.doSetUp(); + } + + @Override + protected void doTearDown() throws Exception + { + final IRepositoryConfig repConfig = getRepositoryConfig(); + final HibernateConfig hbConfig = (HibernateConfig)repConfig; + hbConfig.getAdditionalProperties().clear(); + super.doTearDown(); + } + } + + public static class Hibernate_Bugzilla_303466_Test extends Bugzilla_303466_Test + { + + @Override + public void test_missingDependency() throws Exception + { + } + + } + + public static class Hibernate_Bugzilla_329254_Test extends Bugzilla_329254_Test + { + + // does not work for non audited cases + @Override + public void testCommitTimeStampUpdateOnError() throws Exception + { + } + + } +} diff --git a/plugins/org.eclipse.emf.cdo.tests.hibernate/src/org/eclipse/emf/cdo/tests/hibernate/HibernateBugzilla_362270_Test.java b/plugins/org.eclipse.emf.cdo.tests.hibernate/src/org/eclipse/emf/cdo/tests/hibernate/HibernateBugzilla_362270b_Test.java index 86899a6cfb..894fb053fb 100644 --- a/plugins/org.eclipse.emf.cdo.tests.hibernate/src/org/eclipse/emf/cdo/tests/hibernate/HibernateBugzilla_362270_Test.java +++ b/plugins/org.eclipse.emf.cdo.tests.hibernate/src/org/eclipse/emf/cdo/tests/hibernate/HibernateBugzilla_362270b_Test.java @@ -11,7 +11,7 @@ package org.eclipse.emf.cdo.tests.hibernate; import org.eclipse.emf.cdo.server.internal.hibernate.HibernateStore; -import org.eclipse.emf.cdo.tests.ExternalReferenceTest; +import org.eclipse.emf.cdo.tests.bugzilla.Bugzilla_362270b_Test; import org.eclipse.emf.cdo.tests.config.IRepositoryConfig; /** @@ -19,34 +19,15 @@ import org.eclipse.emf.cdo.tests.config.IRepositoryConfig; * * @author Martin Taal */ -public class HibernateBugzilla_362270_Test extends ExternalReferenceTest +public class HibernateBugzilla_362270b_Test extends Bugzilla_362270b_Test { - @Override - public void testOneXMIResourceManyViewsOnOneResourceSet() throws Exception - { - } - - @Override - public void testUsingObjectsBetweenSameTransaction() throws Exception - { - } - - @Override - public void testManyViewsOnOneResourceSet() throws Exception - { - } - - @Override - public void testXRefExternalObject() throws Exception - { - } @Override protected void doSetUp() throws Exception { final IRepositoryConfig repConfig = getRepositoryConfig(); final HibernateConfig hbConfig = (HibernateConfig)repConfig; - final String persistenceXML = "org/eclipse/emf/cdo/tests/hibernate/external_model1_4.persistence.xml"; + final String persistenceXML = "org/eclipse/emf/cdo/tests/hibernate/cdo_hibernate.persistence.xml"; hbConfig.getAdditionalProperties().put(HibernateStore.PERSISTENCE_XML, persistenceXML); super.doSetUp(); diff --git a/plugins/org.eclipse.emf.cdo.tests.hibernate/src/org/eclipse/emf/cdo/tests/hibernate/HibernateBugzilla_362270c_Test.java b/plugins/org.eclipse.emf.cdo.tests.hibernate/src/org/eclipse/emf/cdo/tests/hibernate/HibernateBugzilla_362270c_Test.java new file mode 100644 index 0000000000..922d5397d9 --- /dev/null +++ b/plugins/org.eclipse.emf.cdo.tests.hibernate/src/org/eclipse/emf/cdo/tests/hibernate/HibernateBugzilla_362270c_Test.java @@ -0,0 +1,44 @@ +/* + * Copyright (c) 2012 Eike Stepper (Berlin, Germany) and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Martin Taal + */ +package org.eclipse.emf.cdo.tests.hibernate; + +import org.eclipse.emf.cdo.server.internal.hibernate.HibernateStore; +import org.eclipse.emf.cdo.tests.bugzilla.Bugzilla_362270c_Test; +import org.eclipse.emf.cdo.tests.config.IRepositoryConfig; + +/** + * Read external reference annotation. + * + * @author Martin Taal + */ +public class HibernateBugzilla_362270c_Test extends Bugzilla_362270c_Test +{ + + @Override + protected void doSetUp() throws Exception + { + final IRepositoryConfig repConfig = getRepositoryConfig(); + final HibernateConfig hbConfig = (HibernateConfig)repConfig; + final String persistenceXML = "org/eclipse/emf/cdo/tests/hibernate/cdo_hibernate.persistence.xml"; + hbConfig.getAdditionalProperties().put(HibernateStore.PERSISTENCE_XML, persistenceXML); + + super.doSetUp(); + } + + @Override + protected void doTearDown() throws Exception + { + final IRepositoryConfig repConfig = getRepositoryConfig(); + final HibernateConfig hbConfig = (HibernateConfig)repConfig; + hbConfig.getAdditionalProperties().clear(); + super.doTearDown(); + } +} diff --git a/plugins/org.eclipse.emf.cdo.tests.hibernate/src/org/eclipse/emf/cdo/tests/hibernate/HibernateBugzilla_387752_Test.java b/plugins/org.eclipse.emf.cdo.tests.hibernate/src/org/eclipse/emf/cdo/tests/hibernate/HibernateBugzilla_387752_Test.java index 059d876b1e..d519ebfe48 100644 --- a/plugins/org.eclipse.emf.cdo.tests.hibernate/src/org/eclipse/emf/cdo/tests/hibernate/HibernateBugzilla_387752_Test.java +++ b/plugins/org.eclipse.emf.cdo.tests.hibernate/src/org/eclipse/emf/cdo/tests/hibernate/HibernateBugzilla_387752_Test.java @@ -59,7 +59,7 @@ public class HibernateBugzilla_387752_Test extends AbstractCDOTest CDOSession session = openSession(); CDOTransaction transaction = session.openTransaction(); - CDOResource resource = transaction.createResource(getResourcePath("/test1")); + CDOResource resource = transaction.getResource(getResourcePath("/test1")); Bz387752_Main main = HibernateTestFactory.eINSTANCE.createBz387752_Main(); main.setEnumSettable(null); diff --git a/plugins/org.eclipse.emf.cdo.tests.hibernate/src/org/eclipse/emf/cdo/tests/hibernate/HibernateBugzilla_392653_Test.java b/plugins/org.eclipse.emf.cdo.tests.hibernate/src/org/eclipse/emf/cdo/tests/hibernate/HibernateBugzilla_392653_Test.java index aa83bf7920..48581a4e65 100644 --- a/plugins/org.eclipse.emf.cdo.tests.hibernate/src/org/eclipse/emf/cdo/tests/hibernate/HibernateBugzilla_392653_Test.java +++ b/plugins/org.eclipse.emf.cdo.tests.hibernate/src/org/eclipse/emf/cdo/tests/hibernate/HibernateBugzilla_392653_Test.java @@ -61,7 +61,7 @@ public class HibernateBugzilla_392653_Test extends AbstractCDOTest CDOTransaction transaction2 = session2.openTransaction(); // Read all repo contents - TreeIterator<EObject> iter = transaction2.getRootResource().getAllContents(); + TreeIterator<EObject> iter = transaction2.getResource(getResourcePath("/")).getAllContents(); while (iter.hasNext()) { iter.next(); diff --git a/plugins/org.eclipse.emf.cdo.tests.hibernate/src/org/eclipse/emf/cdo/tests/hibernate/HibernateBugzilla_405191_Test.java b/plugins/org.eclipse.emf.cdo.tests.hibernate/src/org/eclipse/emf/cdo/tests/hibernate/HibernateBugzilla_405191_Test.java new file mode 100644 index 0000000000..5023118e61 --- /dev/null +++ b/plugins/org.eclipse.emf.cdo.tests.hibernate/src/org/eclipse/emf/cdo/tests/hibernate/HibernateBugzilla_405191_Test.java @@ -0,0 +1,42 @@ +/* + * Copyright (c) 2012 Eike Stepper (Berlin, Germany) and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Martin Taal + */ +package org.eclipse.emf.cdo.tests.hibernate; + +import org.eclipse.emf.cdo.server.internal.hibernate.HibernateStore; +import org.eclipse.emf.cdo.tests.bugzilla.Bugzilla_405191_Test; +import org.eclipse.emf.cdo.tests.config.IRepositoryConfig; + +/** + * @author Martin Taal + */ +public class HibernateBugzilla_405191_Test extends Bugzilla_405191_Test +{ + + @Override + protected void doSetUp() throws Exception + { + final IRepositoryConfig repConfig = getRepositoryConfig(); + final HibernateConfig hbConfig = (HibernateConfig)repConfig; + final String persistenceXML = "org/eclipse/emf/cdo/tests/hibernate/cdo_hibernate.persistence.xml"; + hbConfig.getAdditionalProperties().put(HibernateStore.PERSISTENCE_XML, persistenceXML); + + super.doSetUp(); + } + + @Override + protected void doTearDown() throws Exception + { + final IRepositoryConfig repConfig = getRepositoryConfig(); + final HibernateConfig hbConfig = (HibernateConfig)repConfig; + hbConfig.getAdditionalProperties().clear(); + super.doTearDown(); + } +} diff --git a/plugins/org.eclipse.emf.cdo.tests.hibernate/src/org/eclipse/emf/cdo/tests/hibernate/HibernateChunkingTest.java b/plugins/org.eclipse.emf.cdo.tests.hibernate/src/org/eclipse/emf/cdo/tests/hibernate/HibernateChunkingTest.java new file mode 100644 index 0000000000..ff0667d759 --- /dev/null +++ b/plugins/org.eclipse.emf.cdo.tests.hibernate/src/org/eclipse/emf/cdo/tests/hibernate/HibernateChunkingTest.java @@ -0,0 +1,118 @@ +/* + * Copyright (c) 2007-2013 Eike Stepper (Berlin, Germany) and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Eike Stepper - initial API and implementation + * Martin Taal - Changes for hibernate + */ +package org.eclipse.emf.cdo.tests.hibernate; + +import org.eclipse.emf.cdo.eresource.CDOResource; +import org.eclipse.emf.cdo.session.CDOSession; +import org.eclipse.emf.cdo.tests.AbstractCDOTest; +import org.eclipse.emf.cdo.tests.model1.Company; +import org.eclipse.emf.cdo.tests.model1.Customer; +import org.eclipse.emf.cdo.tests.model1.SalesOrder; +import org.eclipse.emf.cdo.transaction.CDOTransaction; +import org.eclipse.emf.cdo.util.CDOUtil; + +import org.eclipse.net4j.util.io.IOUtil; + +import org.eclipse.emf.common.util.EList; + +import java.util.Iterator; + +/** + * @author Eike Stepper + */ +public class HibernateChunkingTest extends AbstractCDOTest +{ + public void testReadNative() throws Exception + { + { + CDOSession session = openSession(); + CDOTransaction transaction = session.openTransaction(); + CDOResource resource = transaction.createResource(getResourcePath("/test1")); + + Company company = getModel1Factory().createCompany(); + company.setName("company"); + resource.getContents().add(company); + + for (int i = 0; i < 100; i++) + { + SalesOrder salesOrder = getModel1Factory().createSalesOrder(); + salesOrder.setId(i); + company.getSalesOrders().add(salesOrder); + } + + transaction.commit(); + session.close(); + } + + clearCache(getRepository().getRevisionManager()); + + CDOSession session = openSession(); + session.options().setCollectionLoadingPolicy(CDOUtil.createCollectionLoadingPolicy(10, 10)); + + CDOTransaction transaction = session.openTransaction(); + CDOResource resource = transaction.getResource(getResourcePath("/test1")); + + Company company = (Company)resource.getContents().get(0); + EList<SalesOrder> salesOrders = company.getSalesOrders(); + int i = 0; + for (Iterator<SalesOrder> it = salesOrders.iterator(); it.hasNext();) + { + IOUtil.OUT().println(i++); + SalesOrder salesOrder = it.next(); + IOUtil.OUT().println(salesOrder); + } + } + + public void testWriteNative() throws Exception + { + { + CDOSession session = openSession(); + CDOTransaction transaction = session.openTransaction(); + CDOResource resource = transaction.createResource(getResourcePath("/test1")); + + Customer customer = getModel1Factory().createCustomer(); + customer.setName("customer"); + resource.getContents().add(customer); + + for (int i = 0; i < 100; i++) + { + SalesOrder salesOrder = getModel1Factory().createSalesOrder(); + salesOrder.setId(i); + salesOrder.setCustomer(customer); + resource.getContents().add(salesOrder); + } + + transaction.commit(); + session.close(); + } + + clearCache(getRepository().getRevisionManager()); + + CDOSession session = openSession(); + session.options().setCollectionLoadingPolicy(CDOUtil.createCollectionLoadingPolicy(10, 10)); + + CDOTransaction transaction = session.openTransaction(); + CDOResource resource = transaction.getResource(getResourcePath("/test1")); + + Customer customer = (Customer)resource.getContents().get(0); + EList<SalesOrder> salesOrders = customer.getSalesOrders(); + for (int i = 50; i < 70; i++) + { + SalesOrder salesOrder = getModel1Factory().createSalesOrder(); + salesOrder.setId(i + 1000); + resource.getContents().add(salesOrder); + salesOrders.set(i, salesOrder); + } + + transaction.commit(); + } +} diff --git a/plugins/org.eclipse.emf.cdo.tests.hibernate/src/org/eclipse/emf/cdo/tests/hibernate/HibernateCrossReferenceTest.java b/plugins/org.eclipse.emf.cdo.tests.hibernate/src/org/eclipse/emf/cdo/tests/hibernate/HibernateCrossReferenceTest.java new file mode 100644 index 0000000000..efb1fd6bfc --- /dev/null +++ b/plugins/org.eclipse.emf.cdo.tests.hibernate/src/org/eclipse/emf/cdo/tests/hibernate/HibernateCrossReferenceTest.java @@ -0,0 +1,44 @@ +/* + * Copyright (c) 2009, 2011, 2012 Eike Stepper (Berlin, Germany) and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Martin Taal + */ +package org.eclipse.emf.cdo.tests.hibernate; + +import org.eclipse.emf.cdo.server.internal.hibernate.HibernateStore; +import org.eclipse.emf.cdo.tests.CrossReferenceTest; +import org.eclipse.emf.cdo.tests.config.IRepositoryConfig; + +/** + * Tests with a separate annotations.xml. + * + * @author Martin Taal + */ +public class HibernateCrossReferenceTest extends CrossReferenceTest +{ + + @Override + protected void doSetUp() throws Exception + { + final IRepositoryConfig repConfig = getRepositoryConfig(); + final HibernateConfig hbConfig = (HibernateConfig)repConfig; + final String persistenceXML = "org/eclipse/emf/cdo/tests/hibernate/cdo_hibernate.persistence.xml"; + hbConfig.getAdditionalProperties().put(HibernateStore.PERSISTENCE_XML, persistenceXML); + + super.doSetUp(); + } + + @Override + protected void doTearDown() throws Exception + { + final IRepositoryConfig repConfig = getRepositoryConfig(); + final HibernateConfig hbConfig = (HibernateConfig)repConfig; + hbConfig.getAdditionalProperties().clear(); + super.doTearDown(); + } +} diff --git a/plugins/org.eclipse.emf.cdo.tests.hibernate/src/org/eclipse/emf/cdo/tests/hibernate/HibernateExternalAnnotationTest.java b/plugins/org.eclipse.emf.cdo.tests.hibernate/src/org/eclipse/emf/cdo/tests/hibernate/HibernateExternalAnnotationTest.java index 98c7a64897..728ca46147 100644 --- a/plugins/org.eclipse.emf.cdo.tests.hibernate/src/org/eclipse/emf/cdo/tests/hibernate/HibernateExternalAnnotationTest.java +++ b/plugins/org.eclipse.emf.cdo.tests.hibernate/src/org/eclipse/emf/cdo/tests/hibernate/HibernateExternalAnnotationTest.java @@ -48,7 +48,7 @@ public class HibernateExternalAnnotationTest extends AbstractCDOTest { final IRepositoryConfig repConfig = getRepositoryConfig(); final HibernateConfig hbConfig = (HibernateConfig)repConfig; - final String persistenceXML = "org/eclipse/emf/cdo/tests/hibernate/external_model1_4.persistence.xml"; + final String persistenceXML = "org/eclipse/emf/cdo/tests/hibernate/cdo_hibernate.persistence.xml"; hbConfig.getAdditionalProperties().put(HibernateStore.PERSISTENCE_XML, persistenceXML); super.doSetUp(); diff --git a/plugins/org.eclipse.emf.cdo.tests.hibernate/src/org/eclipse/emf/cdo/tests/hibernate/HibernateExternalReferenceTest.java b/plugins/org.eclipse.emf.cdo.tests.hibernate/src/org/eclipse/emf/cdo/tests/hibernate/HibernateExternalReferenceTest.java index cf867c4c39..a72c1cfdca 100644 --- a/plugins/org.eclipse.emf.cdo.tests.hibernate/src/org/eclipse/emf/cdo/tests/hibernate/HibernateExternalReferenceTest.java +++ b/plugins/org.eclipse.emf.cdo.tests.hibernate/src/org/eclipse/emf/cdo/tests/hibernate/HibernateExternalReferenceTest.java @@ -62,7 +62,7 @@ public class HibernateExternalReferenceTest extends ExternalReferenceTest { final IRepositoryConfig repConfig = getRepositoryConfig(); final HibernateConfig hbConfig = (HibernateConfig)repConfig; - final String persistenceXML = "org/eclipse/emf/cdo/tests/hibernate/external_model1_4.persistence.xml"; + final String persistenceXML = "org/eclipse/emf/cdo/tests/hibernate/cdo_hibernate.persistence.xml"; hbConfig.getAdditionalProperties().put(HibernateStore.PERSISTENCE_XML, persistenceXML); super.doSetUp(); diff --git a/plugins/org.eclipse.emf.cdo.tests.hibernate/src/org/eclipse/emf/cdo/tests/hibernate/HibernateExternalReferenceTest.java.orig b/plugins/org.eclipse.emf.cdo.tests.hibernate/src/org/eclipse/emf/cdo/tests/hibernate/HibernateExternalReferenceTest.java.orig new file mode 100644 index 0000000000..cf867c4c39 --- /dev/null +++ b/plugins/org.eclipse.emf.cdo.tests.hibernate/src/org/eclipse/emf/cdo/tests/hibernate/HibernateExternalReferenceTest.java.orig @@ -0,0 +1,79 @@ +/* + * Copyright (c) 2009, 2011, 2012 Eike Stepper (Berlin, Germany) and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Martin Taal + */ +package org.eclipse.emf.cdo.tests.hibernate; + +import org.eclipse.emf.cdo.server.internal.hibernate.HibernateStore; +import org.eclipse.emf.cdo.tests.ExternalReferenceTest; +import org.eclipse.emf.cdo.tests.config.IRepositoryConfig; + +/** + * Test {@link ExternalReferenceTest}, disables some testcases which will never work anyway. + * + * @author Martin Taal + */ +public class HibernateExternalReferenceTest extends ExternalReferenceTest +{ + + @Override + public void testXRefExternalObject() throws Exception + { + // xreffing an external object is not possible as the + // external reference does not hold type information + } + + @Override + public void testManyViewsOnOneResourceSet() throws Exception + { + // this testcase does not work because it there are external temporary references between two + // objects and the objects are stored at the same time. The temporary references are then + // stored in the database (as external), when retrieving the objects the temporary references + // can not be resolved to real ones. + // one note in the second part of the test the supplier is read. The supplier is not read + // from the database but is cached server side + // super.testManyViewsOnOneResourceSet(); + } + + @Override + public void testUsingObjectsBetweenSameTransaction() throws Exception + { + // note this testcase requires that no id's are mapped externally + // this testcase does not work for hibernate because 2 objects reference eachother and + // are added in different transactions, hibernate/mysql will throw a fk-constraint + // exception. This is correct behavior. + // super.testUsingObjectsBetweenSameTransaction(); + } + + @Override + public void testOneXMIResourceManyViewsOnOneResourceSet() + { + + } + + @Override + protected void doSetUp() throws Exception + { + final IRepositoryConfig repConfig = getRepositoryConfig(); + final HibernateConfig hbConfig = (HibernateConfig)repConfig; + final String persistenceXML = "org/eclipse/emf/cdo/tests/hibernate/external_model1_4.persistence.xml"; + hbConfig.getAdditionalProperties().put(HibernateStore.PERSISTENCE_XML, persistenceXML); + + super.doSetUp(); + } + + @Override + protected void doTearDown() throws Exception + { + final IRepositoryConfig repConfig = getRepositoryConfig(); + final HibernateConfig hbConfig = (HibernateConfig)repConfig; + hbConfig.getAdditionalProperties().clear(); + super.doTearDown(); + } +} diff --git a/plugins/org.eclipse.emf.cdo.tests.hibernate/src/org/eclipse/emf/cdo/tests/hibernate/HibernateLazyLoadTest.java b/plugins/org.eclipse.emf.cdo.tests.hibernate/src/org/eclipse/emf/cdo/tests/hibernate/HibernateLazyLoadTest.java new file mode 100644 index 0000000000..f6eed9d92f --- /dev/null +++ b/plugins/org.eclipse.emf.cdo.tests.hibernate/src/org/eclipse/emf/cdo/tests/hibernate/HibernateLazyLoadTest.java @@ -0,0 +1,213 @@ +/* + * Copyright (c) 2009-2013 Eike Stepper (Berlin, Germany) and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Martin Taal + */ +package org.eclipse.emf.cdo.tests.hibernate; + +import org.eclipse.emf.cdo.eresource.CDOResource; +import org.eclipse.emf.cdo.server.hibernate.IHibernateStore; +import org.eclipse.emf.cdo.session.CDOSession; +import org.eclipse.emf.cdo.tests.AbstractCDOTest; +import org.eclipse.emf.cdo.tests.model1.Customer; +import org.eclipse.emf.cdo.tests.model1.Order; +import org.eclipse.emf.cdo.tests.model1.OrderDetail; +import org.eclipse.emf.cdo.tests.model1.Product1; +import org.eclipse.emf.cdo.tests.model1.SalesOrder; +import org.eclipse.emf.cdo.tests.model1.Supplier; +import org.eclipse.emf.cdo.tests.model1.VAT; +import org.eclipse.emf.cdo.transaction.CDOTransaction; +import org.eclipse.emf.cdo.util.CommitException; +import org.eclipse.emf.cdo.view.CDOQuery; + +import org.eclipse.net4j.util.WrappedException; + +import java.util.ArrayList; +import java.util.List; + +/** + * Test lazy load behavior of hibernate + * + * @author Martin Taal + */ +public class HibernateLazyLoadTest extends AbstractCDOTest +{ + private static final int NUM_OF_PRODUCTS = 10; + + private static final int NUM_OF_CUSTOMERS = 2; + + private static final int NUM_OF_PRODUCTS_CUSTOMER = NUM_OF_PRODUCTS / NUM_OF_CUSTOMERS; + + private static final int NUM_OF_SALES_ORDERS = 5; + + private static final int NUM_OF_SUPPLIERS = 5; + + @Override + public void doSetUp() throws Exception + { + org.eclipse.emf.cdo.tests.model1.Model1Package.eINSTANCE.getSupplier_Preferred().setLowerBound(1); + org.eclipse.emf.cdo.tests.model1.legacy.Model1Package.eINSTANCE.getSupplier_Preferred().setLowerBound(1); + super.doSetUp(); + } + + @Override + public void doTearDown() throws Exception + { + org.eclipse.emf.cdo.tests.model1.Model1Package.eINSTANCE.getSupplier_Preferred().setLowerBound(0); + org.eclipse.emf.cdo.tests.model1.legacy.Model1Package.eINSTANCE.getSupplier_Preferred().setLowerBound(0); + super.doTearDown(); + } + + public void testSimpleQueries() throws Exception + { + msg("Opening session"); + CDOSession session = openSession(); + + createTestSet(session); + + session.close(); + session = openSession(); + msg("Opening transaction for querying"); + CDOTransaction transaction = session.openTransaction(); + + clearCache(getRepository().getRevisionManager()); + + { + msg("Query for products"); + CDOQuery cdoQuery = transaction.createQuery("hql", "from SalesOrder"); + addCacheParameter(cdoQuery); + cdoQuery.setMaxResults(1); + final List<SalesOrder> orders = cdoQuery.getResult(SalesOrder.class); + System.err.println(orders.get(0).getOrderDetails().get(0).getPrice()); + System.err.println(orders.get(0).getCustomer().getName()); + assertEquals(orders.size(), 1); + } + + transaction.commit(); + enableConsole(); + } + + private void createTestSet(CDOSession session) + { + disableConsole(); + msg("Opening transaction"); + CDOTransaction transaction = session.openTransaction(); + + msg("Creating resource"); + CDOResource resource = transaction.createResource(getResourcePath("/test1")); + + fillResource(resource); + + try + { + msg("Committing"); + transaction.commit(); + } + catch (CommitException ex) + { + throw WrappedException.wrap(ex); + } + + enableConsole(); + } + + private void fillResource(CDOResource resource) + { + msg("Creating Testset"); + final List<Product1> products = new ArrayList<Product1>(); + for (int i = 0; i < NUM_OF_PRODUCTS; i++) + { + products.add(createProduct(i)); + } + + resource.getContents().addAll(products); + + int productCounter = 0; + for (int i = 0; i < NUM_OF_CUSTOMERS; i++) + { + final Customer customer = getModel1Factory().createCustomer(); + customer.setCity("City " + i); + customer.setName(i + ""); + customer.setStreet("Street " + i); + resource.getContents().add(customer); + + final List<Product1> customerProducts = products.subList(productCounter, productCounter + + NUM_OF_PRODUCTS_CUSTOMER); + for (int k = 0; k < NUM_OF_SALES_ORDERS; k++) + { + resource.getContents().add(createSalesOrder(i * 10 + k, customer, customerProducts)); + } + + productCounter += NUM_OF_PRODUCTS_CUSTOMER; + } + + final List<Supplier> suppliers = new ArrayList<Supplier>(); + for (int i = 0; i < NUM_OF_SUPPLIERS; i++) + { + suppliers.add(createSupplier(i)); + } + + resource.getContents().addAll(suppliers); + } + + private Supplier createSupplier(int i) + { + Supplier supplier = getModel1Factory().createSupplier(); + supplier.setCity("City " + i); + supplier.setName(i + ""); + supplier.setStreet("Street " + i); + // supplier.setPreferred(false); // will be persisted with its default value + return supplier; + } + + private SalesOrder createSalesOrder(int num, Customer customer, List<Product1> products) + { + SalesOrder salesOrder = getModel1Factory().createSalesOrder(); + salesOrder.setCustomer(customer); + salesOrder.setId(num); + createOrderDetail(salesOrder, num, products); + return salesOrder; + } + + private List<OrderDetail> createOrderDetail(Order order, int index, List<Product1> products) + { + final List<OrderDetail> orderDetails = new ArrayList<OrderDetail>(); + int count = 0; + for (Product1 product : products) + { + OrderDetail orderDetail = getModel1Factory().createOrderDetail(); + orderDetail.setOrder(order); + orderDetail.setPrice(count++ * index * 1.1f); + orderDetail.setProduct(product); + } + + return orderDetails; + } + + private Product1 createProduct(int index) + { + Product1 product = getModel1Factory().createProduct1(); + product.setDescription("Description " + index); + product.setName("" + index); + if (index < 10) + { + product.setVat(VAT.VAT15); + } + else + { + product.setVat(VAT.VAT7); + } + + return product; + } + + protected void addCacheParameter(CDOQuery query) + { + query.setParameter(IHibernateStore.CACHE_RESULTS, true); + } +} diff --git a/plugins/org.eclipse.emf.cdo.tests.hibernate/src/org/eclipse/emf/cdo/tests/hibernate/HibernateQueryTest.java b/plugins/org.eclipse.emf.cdo.tests.hibernate/src/org/eclipse/emf/cdo/tests/hibernate/HibernateQueryTest.java index d7176a6930..8ecaf6c17e 100644 --- a/plugins/org.eclipse.emf.cdo.tests.hibernate/src/org/eclipse/emf/cdo/tests/hibernate/HibernateQueryTest.java +++ b/plugins/org.eclipse.emf.cdo.tests.hibernate/src/org/eclipse/emf/cdo/tests/hibernate/HibernateQueryTest.java @@ -265,6 +265,7 @@ public class HibernateQueryTest extends AbstractCDOTest orderQuery.setParameter("od", orderDetail); final List<SalesOrder> sos = orderQuery.getResult(SalesOrder.class); assertEquals(1, sos.size()); + assertNotNull(sos.get(0).getCustomer().getName()); assertEquals(orderDetail.getOrder(), sos.get(0)); } } diff --git a/plugins/org.eclipse.emf.cdo.tests.hibernate/src/org/eclipse/emf/cdo/tests/hibernate/HibernateXATransactionTest.java b/plugins/org.eclipse.emf.cdo.tests.hibernate/src/org/eclipse/emf/cdo/tests/hibernate/HibernateXATransactionTest.java index 1872e434db..99823357c1 100644 --- a/plugins/org.eclipse.emf.cdo.tests.hibernate/src/org/eclipse/emf/cdo/tests/hibernate/HibernateXATransactionTest.java +++ b/plugins/org.eclipse.emf.cdo.tests.hibernate/src/org/eclipse/emf/cdo/tests/hibernate/HibernateXATransactionTest.java @@ -26,7 +26,7 @@ public class HibernateXATransactionTest extends XATransactionTest { final IRepositoryConfig repConfig = getRepositoryConfig(); final HibernateConfig hbConfig = (HibernateConfig)repConfig; - final String persistenceXML = "org/eclipse/emf/cdo/tests/hibernate/external_model1_4.persistence.xml"; + final String persistenceXML = "org/eclipse/emf/cdo/tests/hibernate/cdo_hibernate.persistence.xml"; hbConfig.getAdditionalProperties().put(HibernateStore.PERSISTENCE_XML, persistenceXML); super.doSetUp(); diff --git a/plugins/org.eclipse.emf.cdo.tests.hibernate/src/org/eclipse/emf/cdo/tests/hibernate/external_model1_4.persistence.xml b/plugins/org.eclipse.emf.cdo.tests.hibernate/src/org/eclipse/emf/cdo/tests/hibernate/cdo_hibernate.persistence.xml index 72f7426704..d180ab06d2 100644 --- a/plugins/org.eclipse.emf.cdo.tests.hibernate/src/org/eclipse/emf/cdo/tests/hibernate/external_model1_4.persistence.xml +++ b/plugins/org.eclipse.emf.cdo.tests.hibernate/src/org/eclipse/emf/cdo/tests/hibernate/cdo_hibernate.persistence.xml @@ -2,6 +2,21 @@ <persistence-mapping xmlns="http://www.eclipse.org/emft/teneo" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> + <epackage namespace-uri="http://www.eclipse.org/emf/CDO/tests/model6/1.0.0"> + + <eclass name="UnsettableAttributes"> + <property name="attrJavaClass"> + <type type="string"/> + </property> + </eclass> + + <eclass name="RefSingleNonContainedNPL"> + <property name="element"> + <external>org.eclipse.emf.cdo.server.internal.hibernate.tuplizer.CDOIDExternalUserType</external> + </property> + </eclass> + </epackage> + <epackage namespace-uri="http://www.eclipse.org/emf/CDO/tests/model4/1.0.0"> <eclass name="GenRefSingleNonContained"> @@ -9,10 +24,21 @@ <external>org.eclipse.emf.cdo.server.internal.hibernate.tuplizer.CDOIDExternalUserType</external> </property> </eclass> + + <eclass name="RefSingleNonContainedNPL"> + <property name="element"> + <external>org.eclipse.emf.cdo.server.internal.hibernate.tuplizer.CDOIDExternalUserType</external> + </property> + </eclass> </epackage> <epackage namespace-uri="http://www.eclipse.org/emf/CDO/tests/model1/1.0.0"> + <eclass name="Company"> + <property name="customers"> + <external>org.eclipse.emf.cdo.server.internal.hibernate.tuplizer.CDOIDExternalUserType</external> + </property> + </eclass> <eclass name="SalesOrder"> <property name="customer"> <external>org.eclipse.emf.cdo.server.internal.hibernate.tuplizer.CDOIDExternalUserType</external> |