diff options
102 files changed, 11157 insertions, 0 deletions
diff --git a/plugins/org.eclipse.emf.cdo.server.hibernate.teneo/.classpath b/plugins/org.eclipse.emf.cdo.server.hibernate.teneo/.classpath new file mode 100644 index 0000000000..304e86186a --- /dev/null +++ b/plugins/org.eclipse.emf.cdo.server.hibernate.teneo/.classpath @@ -0,0 +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="output" path="bin"/> +</classpath> diff --git a/plugins/org.eclipse.emf.cdo.server.hibernate.teneo/.project b/plugins/org.eclipse.emf.cdo.server.hibernate.teneo/.project new file mode 100644 index 0000000000..96fd1e4a66 --- /dev/null +++ b/plugins/org.eclipse.emf.cdo.server.hibernate.teneo/.project @@ -0,0 +1,28 @@ +<?xml version="1.0" encoding="UTF-8"?> +<projectDescription> + <name>org.eclipse.emf.cdo.server.hibernate.teneo</name> + <comment></comment> + <projects> + </projects> + <buildSpec> + <buildCommand> + <name>org.eclipse.jdt.core.javabuilder</name> + <arguments> + </arguments> + </buildCommand> + <buildCommand> + <name>org.eclipse.pde.ManifestBuilder</name> + <arguments> + </arguments> + </buildCommand> + <buildCommand> + <name>org.eclipse.pde.SchemaBuilder</name> + <arguments> + </arguments> + </buildCommand> + </buildSpec> + <natures> + <nature>org.eclipse.pde.PluginNature</nature> + <nature>org.eclipse.jdt.core.javanature</nature> + </natures> +</projectDescription> 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 new file mode 100644 index 0000000000..2b7f713e36 --- /dev/null +++ b/plugins/org.eclipse.emf.cdo.server.hibernate.teneo/.settings/org.eclipse.jdt.core.prefs @@ -0,0 +1,260 @@ +#Sat Feb 23 08:26:13 CET 2008 +eclipse.preferences.version=1 +org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5 +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_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_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_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.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=true +org.eclipse.jdt.core.formatter.comment.format_line_comments=true +org.eclipse.jdt.core.formatter.comment.format_source_code=true +org.eclipse.jdt.core.formatter.comment.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.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.format_guardian_clause_on_one_line=false +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_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_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_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_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_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_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.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=true +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_tabs_only_for_leading_indentations=false +org.eclipse.jdt.core.formatter.wrap_before_binary_operator=true diff --git a/plugins/org.eclipse.emf.cdo.server.hibernate.teneo/.settings/org.eclipse.jdt.ui.prefs b/plugins/org.eclipse.emf.cdo.server.hibernate.teneo/.settings/org.eclipse.jdt.ui.prefs new file mode 100644 index 0000000000..77c2af5b2d --- /dev/null +++ b/plugins/org.eclipse.emf.cdo.server.hibernate.teneo/.settings/org.eclipse.jdt.ui.prefs @@ -0,0 +1,8 @@ +#Wed Feb 06 08:11:31 CET 2008 +eclipse.preferences.version=1 +formatter_profile=_EMFT +formatter_settings_version=11 +org.eclipse.jdt.ui.ignorelowercasenames=true +org.eclipse.jdt.ui.importorder=org.eclipse.emf.cdo;org.eclipse.emf.internal.cdo;org.eclipse.net4j;org.eclipse.internal.net4j;org.eclipse.emf;org.eclipse;com;org;javax;java; +org.eclipse.jdt.ui.ondemandthreshold=99 +org.eclipse.jdt.ui.staticondemandthreshold=99 diff --git a/plugins/org.eclipse.emf.cdo.server.hibernate.teneo/META-INF/MANIFEST.MF b/plugins/org.eclipse.emf.cdo.server.hibernate.teneo/META-INF/MANIFEST.MF new file mode 100644 index 0000000000..d63d16b762 --- /dev/null +++ b/plugins/org.eclipse.emf.cdo.server.hibernate.teneo/META-INF/MANIFEST.MF @@ -0,0 +1,13 @@ +Manifest-Version: 1.0 +Bundle-ManifestVersion: 2 +Bundle-SymbolicName: org.eclipse.emf.cdo.server.hibernate.teneo;singleton:=true +Bundle-Name: %pluginName +Bundle-Version: 0.8.0.qualifier +Bundle-Vendor: %providerName +Bundle-RequiredExecutionEnvironment: J2SE-1.5 +Require-Bundle: org.eclipse.emf.ecore.xmi;bundle-version="[2.4.0,3.0.0)";visibility:=reexport, + org.eclipse.emf.cdo.server.hibernate;bundle-version="[0.8.0,0.9.0)";visibility:=reexport, + org.eclipse.emf.teneo;bundle-version="[0.8.0,0.9.0)";visibility:=reexport, + org.eclipse.emf.teneo.annotations;bundle-version="[0.8.0,0.9.0)";visibility:=reexport, + org.eclipse.emf.teneo.hibernate.mapper;bundle-version="[0.8.0,0.9.0)";visibility:=reexport +Export-Package: org.eclipse.emf.cdo.server.hibernate.teneo diff --git a/plugins/org.eclipse.emf.cdo.server.hibernate.teneo/build.properties b/plugins/org.eclipse.emf.cdo.server.hibernate.teneo/build.properties new file mode 100644 index 0000000000..34d2e4d2da --- /dev/null +++ b/plugins/org.eclipse.emf.cdo.server.hibernate.teneo/build.properties @@ -0,0 +1,4 @@ +source.. = src/ +output.. = bin/ +bin.includes = META-INF/,\ + . diff --git a/plugins/org.eclipse.emf.cdo.server.hibernate.teneo/copyright.txt b/plugins/org.eclipse.emf.cdo.server.hibernate.teneo/copyright.txt new file mode 100644 index 0000000000..ae21640f79 --- /dev/null +++ b/plugins/org.eclipse.emf.cdo.server.hibernate.teneo/copyright.txt @@ -0,0 +1,8 @@ +Copyright (c) 2004 - 2008 Eike Stepper, Germany. +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 - initial API and implementation diff --git a/plugins/org.eclipse.emf.cdo.server.hibernate.teneo/epl-v10.html b/plugins/org.eclipse.emf.cdo.server.hibernate.teneo/epl-v10.html new file mode 100644 index 0000000000..d7b88e9416 --- /dev/null +++ b/plugins/org.eclipse.emf.cdo.server.hibernate.teneo/epl-v10.html @@ -0,0 +1,319 @@ +<html xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns="http://www.w3.org/TR/REC-html40"><head> +<meta http-equiv="Content-Type" content="text/html; charset=windows-1252"> +<meta name="ProgId" content="Word.Document"> +<meta name="Generator" content="Microsoft Word 9"> +<meta name="Originator" content="Microsoft Word 9"> +<link rel="File-List" href="http://www.eclipse.org/org/documents/Eclipse%20EPL%202003_11_10%20Final_files/filelist.xml"><title>Eclipse Public License - Version 1.0</title><!--[if gte mso 9]><xml> + <o:DocumentProperties> + <o:Revision>2</o:Revision> + <o:TotalTime>3</o:TotalTime> + <o:Created>2004-03-05T23:03:00Z</o:Created> + <o:LastSaved>2004-03-05T23:03:00Z</o:LastSaved> + <o:Pages>4</o:Pages> + <o:Words>1626</o:Words> + <o:Characters>9270</o:Characters> + <o:Lines>77</o:Lines> + <o:Paragraphs>18</o:Paragraphs> + <o:CharactersWithSpaces>11384</o:CharactersWithSpaces> + <o:Version>9.4402</o:Version> + </o:DocumentProperties> +</xml><![endif]--><!--[if gte mso 9]><xml> + <w:WordDocument> + <w:TrackRevisions/> + </w:WordDocument> +</xml><![endif]--> + + +<style> +<!-- + /* Font Definitions */ +@font-face + {font-family:Tahoma; + panose-1:2 11 6 4 3 5 4 4 2 4; + mso-font-charset:0; + mso-generic-font-family:swiss; + mso-font-pitch:variable; + mso-font-signature:553679495 -2147483648 8 0 66047 0;} + /* Style Definitions */ +p.MsoNormal, li.MsoNormal, div.MsoNormal + {mso-style-parent:""; + margin:0in; + margin-bottom:.0001pt; + mso-pagination:widow-orphan; + font-size:12.0pt; + font-family:"Times New Roman"; + mso-fareast-font-family:"Times New Roman";} +p + {margin-right:0in; + mso-margin-top-alt:auto; + mso-margin-bottom-alt:auto; + margin-left:0in; + mso-pagination:widow-orphan; + font-size:12.0pt; + font-family:"Times New Roman"; + mso-fareast-font-family:"Times New Roman";} +p.BalloonText, li.BalloonText, div.BalloonText + {mso-style-name:"Balloon Text"; + margin:0in; + margin-bottom:.0001pt; + mso-pagination:widow-orphan; + font-size:8.0pt; + font-family:Tahoma; + mso-fareast-font-family:"Times New Roman";} +@page Section1 + {size:8.5in 11.0in; + margin:1.0in 1.25in 1.0in 1.25in; + mso-header-margin:.5in; + mso-footer-margin:.5in; + mso-paper-source:0;} +div.Section1 + {page:Section1;} +--> +</style></head> + +<body style="" lang="EN-US"> + +<div class="Section1"> + +<p style="text-align: center;" align="center"><b>Eclipse Public License - v 1.0</b> +</p> + +<p><span style="font-size: 10pt;">THE ACCOMPANYING PROGRAM IS PROVIDED UNDER +THE TERMS OF THIS ECLIPSE PUBLIC LICENSE ("AGREEMENT"). ANY USE, +REPRODUCTION OR DISTRIBUTION OF THE PROGRAM CONSTITUTES RECIPIENT'S ACCEPTANCE +OF THIS AGREEMENT.</span> </p> + +<p><b><span style="font-size: 10pt;">1. DEFINITIONS</span></b> </p> + +<p><span style="font-size: 10pt;">"Contribution" means:</span> </p> + +<p class="MsoNormal" style="margin-left: 0.5in;"><span style="font-size: 10pt;">a) +in the case of the initial Contributor, the initial code and documentation +distributed under this Agreement, and<br clear="left"> +b) in the case of each subsequent Contributor:</span></p> + +<p class="MsoNormal" style="margin-left: 0.5in;"><span style="font-size: 10pt;">i) +changes to the Program, and</span></p> + +<p class="MsoNormal" style="margin-left: 0.5in;"><span style="font-size: 10pt;">ii) +additions to the Program;</span></p> + +<p class="MsoNormal" style="margin-left: 0.5in;"><span style="font-size: 10pt;">where +such changes and/or additions to the Program originate from and are distributed +by that particular Contributor. A Contribution 'originates' from a Contributor +if it was added to the Program by such Contributor itself or anyone acting on +such Contributor's behalf. Contributions do not include additions to the +Program which: (i) are separate modules of software distributed in conjunction +with the Program under their own license agreement, and (ii) are not derivative +works of the Program. </span></p> + +<p><span style="font-size: 10pt;">"Contributor" means any person or +entity that distributes the Program.</span> </p> + +<p><span style="font-size: 10pt;">"Licensed Patents " mean patent +claims licensable by a Contributor which are necessarily infringed by the use +or sale of its Contribution alone or when combined with the Program. </span></p> + +<p><span style="font-size: 10pt;">"Program" means the Contributions +distributed in accordance with this Agreement.</span> </p> + +<p><span style="font-size: 10pt;">"Recipient" means anyone who +receives the Program under this Agreement, including all Contributors.</span> </p> + +<p><b><span style="font-size: 10pt;">2. GRANT OF RIGHTS</span></b> </p> + +<p class="MsoNormal" style="margin-left: 0.5in;"><span style="font-size: 10pt;">a) +Subject to the terms of this Agreement, each Contributor hereby grants Recipient +a non-exclusive, worldwide, royalty-free copyright license to<span style="color: red;"> </span>reproduce, prepare derivative works of, publicly +display, publicly perform, distribute and sublicense the Contribution of such +Contributor, if any, and such derivative works, in source code and object code +form.</span></p> + +<p class="MsoNormal" style="margin-left: 0.5in;"><span style="font-size: 10pt;">b) +Subject to the terms of this Agreement, each Contributor hereby grants +Recipient a non-exclusive, worldwide,<span style="color: green;"> </span>royalty-free +patent license under Licensed Patents to make, use, sell, offer to sell, import +and otherwise transfer the Contribution of such Contributor, if any, in source +code and object code form. This patent license shall apply to the combination +of the Contribution and the Program if, at the time the Contribution is added +by the Contributor, such addition of the Contribution causes such combination +to be covered by the Licensed Patents. The patent license shall not apply to +any other combinations which include the Contribution. No hardware per se is +licensed hereunder. </span></p> + +<p class="MsoNormal" style="margin-left: 0.5in;"><span style="font-size: 10pt;">c) +Recipient understands that although each Contributor grants the licenses to its +Contributions set forth herein, no assurances are provided by any Contributor +that the Program does not infringe the patent or other intellectual property +rights of any other entity. Each Contributor disclaims any liability to Recipient +for claims brought by any other entity based on infringement of intellectual +property rights or otherwise. As a condition to exercising the rights and +licenses granted hereunder, each Recipient hereby assumes sole responsibility +to secure any other intellectual property rights needed, if any. For example, +if a third party patent license is required to allow Recipient to distribute +the Program, it is Recipient's responsibility to acquire that license before +distributing the Program.</span></p> + +<p class="MsoNormal" style="margin-left: 0.5in;"><span style="font-size: 10pt;">d) +Each Contributor represents that to its knowledge it has sufficient copyright +rights in its Contribution, if any, to grant the copyright license set forth in +this Agreement. </span></p> + +<p><b><span style="font-size: 10pt;">3. REQUIREMENTS</span></b> </p> + +<p><span style="font-size: 10pt;">A Contributor may choose to distribute the +Program in object code form under its own license agreement, provided that:</span> +</p> + +<p class="MsoNormal" style="margin-left: 0.5in;"><span style="font-size: 10pt;">a) +it complies with the terms and conditions of this Agreement; and</span></p> + +<p class="MsoNormal" style="margin-left: 0.5in;"><span style="font-size: 10pt;">b) +its license agreement:</span></p> + +<p class="MsoNormal" style="margin-left: 0.5in;"><span style="font-size: 10pt;">i) +effectively disclaims on behalf of all Contributors all warranties and +conditions, express and implied, including warranties or conditions of title +and non-infringement, and implied warranties or conditions of merchantability +and fitness for a particular purpose; </span></p> + +<p class="MsoNormal" style="margin-left: 0.5in;"><span style="font-size: 10pt;">ii) +effectively excludes on behalf of all Contributors all liability for damages, +including direct, indirect, special, incidental and consequential damages, such +as lost profits; </span></p> + +<p class="MsoNormal" style="margin-left: 0.5in;"><span style="font-size: 10pt;">iii) +states that any provisions which differ from this Agreement are offered by that +Contributor alone and not by any other party; and</span></p> + +<p class="MsoNormal" style="margin-left: 0.5in;"><span style="font-size: 10pt;">iv) +states that source code for the Program is available from such Contributor, and +informs licensees how to obtain it in a reasonable manner on or through a +medium customarily used for software exchange.<span style="color: blue;"> </span></span></p> + +<p><span style="font-size: 10pt;">When the Program is made available in source +code form:</span> </p> + +<p class="MsoNormal" style="margin-left: 0.5in;"><span style="font-size: 10pt;">a) +it must be made available under this Agreement; and </span></p> + +<p class="MsoNormal" style="margin-left: 0.5in;"><span style="font-size: 10pt;">b) a +copy of this Agreement must be included with each copy of the Program. </span></p> + +<p><span style="font-size: 10pt;">Contributors may not remove or alter any +copyright notices contained within the Program. </span></p> + +<p><span style="font-size: 10pt;">Each Contributor must identify itself as the +originator of its Contribution, if any, in a manner that reasonably allows +subsequent Recipients to identify the originator of the Contribution. </span></p> + +<p><b><span style="font-size: 10pt;">4. COMMERCIAL DISTRIBUTION</span></b> </p> + +<p><span style="font-size: 10pt;">Commercial distributors of software may +accept certain responsibilities with respect to end users, business partners +and the like. While this license is intended to facilitate the commercial use +of the Program, the Contributor who includes the Program in a commercial +product offering should do so in a manner which does not create potential +liability for other Contributors. Therefore, if a Contributor includes the +Program in a commercial product offering, such Contributor ("Commercial +Contributor") hereby agrees to defend and indemnify every other +Contributor ("Indemnified Contributor") against any losses, damages and +costs (collectively "Losses") arising from claims, lawsuits and other +legal actions brought by a third party against the Indemnified Contributor to +the extent caused by the acts or omissions of such Commercial Contributor in +connection with its distribution of the Program in a commercial product +offering. The obligations in this section do not apply to any claims or Losses +relating to any actual or alleged intellectual property infringement. In order +to qualify, an Indemnified Contributor must: a) promptly notify the Commercial +Contributor in writing of such claim, and b) allow the Commercial Contributor +to control, and cooperate with the Commercial Contributor in, the defense and +any related settlement negotiations. The Indemnified Contributor may participate +in any such claim at its own expense.</span> </p> + +<p><span style="font-size: 10pt;">For example, a Contributor might include the +Program in a commercial product offering, Product X. That Contributor is then a +Commercial Contributor. If that Commercial Contributor then makes performance +claims, or offers warranties related to Product X, those performance claims and +warranties are such Commercial Contributor's responsibility alone. Under this +section, the Commercial Contributor would have to defend claims against the +other Contributors related to those performance claims and warranties, and if a +court requires any other Contributor to pay any damages as a result, the +Commercial Contributor must pay those damages.</span> </p> + +<p><b><span style="font-size: 10pt;">5. NO WARRANTY</span></b> </p> + +<p><span style="font-size: 10pt;">EXCEPT AS EXPRESSLY SET FORTH IN THIS +AGREEMENT, THE PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT +WARRANTIES OR CONDITIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED INCLUDING, +WITHOUT LIMITATION, ANY WARRANTIES OR CONDITIONS OF TITLE, NON-INFRINGEMENT, +MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. Each Recipient is solely +responsible for determining the appropriateness of using and distributing the +Program and assumes all risks associated with its exercise of rights under this +Agreement , including but not limited to the risks and costs of program errors, +compliance with applicable laws, damage to or loss of data, programs or +equipment, and unavailability or interruption of operations. </span></p> + +<p><b><span style="font-size: 10pt;">6. DISCLAIMER OF LIABILITY</span></b> </p> + +<p><span style="font-size: 10pt;">EXCEPT AS EXPRESSLY SET FORTH IN THIS +AGREEMENT, NEITHER RECIPIENT NOR ANY CONTRIBUTORS SHALL HAVE ANY LIABILITY FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING WITHOUT LIMITATION LOST PROFITS), HOWEVER CAUSED AND ON ANY THEORY +OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING +NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OR DISTRIBUTION OF +THE PROGRAM OR THE EXERCISE OF ANY RIGHTS GRANTED HEREUNDER, EVEN IF ADVISED OF +THE POSSIBILITY OF SUCH DAMAGES.</span> </p> + +<p><b><span style="font-size: 10pt;">7. GENERAL</span></b> </p> + +<p><span style="font-size: 10pt;">If any provision of this Agreement is invalid +or unenforceable under applicable law, it shall not affect the validity or +enforceability of the remainder of the terms of this Agreement, and without +further action by the parties hereto, such provision shall be reformed to the +minimum extent necessary to make such provision valid and enforceable.</span> </p> + +<p><span style="font-size: 10pt;">If Recipient institutes patent litigation +against any entity (including a cross-claim or counterclaim in a lawsuit) +alleging that the Program itself (excluding combinations of the Program with +other software or hardware) infringes such Recipient's patent(s), then such +Recipient's rights granted under Section 2(b) shall terminate as of the date +such litigation is filed. </span></p> + +<p><span style="font-size: 10pt;">All Recipient's rights under this Agreement +shall terminate if it fails to comply with any of the material terms or +conditions of this Agreement and does not cure such failure in a reasonable +period of time after becoming aware of such noncompliance. If all Recipient's +rights under this Agreement terminate, Recipient agrees to cease use and +distribution of the Program as soon as reasonably practicable. However, +Recipient's obligations under this Agreement and any licenses granted by +Recipient relating to the Program shall continue and survive. </span></p> + +<p><span style="font-size: 10pt;">Everyone is permitted to copy and distribute +copies of this Agreement, but in order to avoid inconsistency the Agreement is +copyrighted and may only be modified in the following manner. The Agreement +Steward reserves the right to publish new versions (including revisions) of +this Agreement from time to time. No one other than the Agreement Steward has +the right to modify this Agreement. The Eclipse Foundation is the initial +Agreement Steward. The Eclipse Foundation may assign the responsibility to +serve as the Agreement Steward to a suitable separate entity. Each new version +of the Agreement will be given a distinguishing version number. The Program +(including Contributions) may always be distributed subject to the version of +the Agreement under which it was received. In addition, after a new version of +the Agreement is published, Contributor may elect to distribute the Program +(including its Contributions) under the new version. Except as expressly stated +in Sections 2(a) and 2(b) above, Recipient receives no rights or licenses to +the intellectual property of any Contributor under this Agreement, whether +expressly, by implication, estoppel or otherwise. All rights in the Program not +expressly granted under this Agreement are reserved.</span> </p> + +<p><span style="font-size: 10pt;">This Agreement is governed by the laws of the +State of New York and the intellectual property laws of the United States of +America. No party to this Agreement will bring a legal action under this +Agreement more than one year after the cause of action arose. Each party waives +its rights to a jury trial in any resulting litigation.</span> </p> + +<p class="MsoNormal"><!--[if !supportEmptyParas]--> <!--[endif]--><o:p></o:p></p> + +</div> + +</body></html>
\ No newline at end of file diff --git a/plugins/org.eclipse.emf.cdo.server.hibernate.teneo/license.html b/plugins/org.eclipse.emf.cdo.server.hibernate.teneo/license.html new file mode 100644 index 0000000000..d7b88e9416 --- /dev/null +++ b/plugins/org.eclipse.emf.cdo.server.hibernate.teneo/license.html @@ -0,0 +1,319 @@ +<html xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns="http://www.w3.org/TR/REC-html40"><head> +<meta http-equiv="Content-Type" content="text/html; charset=windows-1252"> +<meta name="ProgId" content="Word.Document"> +<meta name="Generator" content="Microsoft Word 9"> +<meta name="Originator" content="Microsoft Word 9"> +<link rel="File-List" href="http://www.eclipse.org/org/documents/Eclipse%20EPL%202003_11_10%20Final_files/filelist.xml"><title>Eclipse Public License - Version 1.0</title><!--[if gte mso 9]><xml> + <o:DocumentProperties> + <o:Revision>2</o:Revision> + <o:TotalTime>3</o:TotalTime> + <o:Created>2004-03-05T23:03:00Z</o:Created> + <o:LastSaved>2004-03-05T23:03:00Z</o:LastSaved> + <o:Pages>4</o:Pages> + <o:Words>1626</o:Words> + <o:Characters>9270</o:Characters> + <o:Lines>77</o:Lines> + <o:Paragraphs>18</o:Paragraphs> + <o:CharactersWithSpaces>11384</o:CharactersWithSpaces> + <o:Version>9.4402</o:Version> + </o:DocumentProperties> +</xml><![endif]--><!--[if gte mso 9]><xml> + <w:WordDocument> + <w:TrackRevisions/> + </w:WordDocument> +</xml><![endif]--> + + +<style> +<!-- + /* Font Definitions */ +@font-face + {font-family:Tahoma; + panose-1:2 11 6 4 3 5 4 4 2 4; + mso-font-charset:0; + mso-generic-font-family:swiss; + mso-font-pitch:variable; + mso-font-signature:553679495 -2147483648 8 0 66047 0;} + /* Style Definitions */ +p.MsoNormal, li.MsoNormal, div.MsoNormal + {mso-style-parent:""; + margin:0in; + margin-bottom:.0001pt; + mso-pagination:widow-orphan; + font-size:12.0pt; + font-family:"Times New Roman"; + mso-fareast-font-family:"Times New Roman";} +p + {margin-right:0in; + mso-margin-top-alt:auto; + mso-margin-bottom-alt:auto; + margin-left:0in; + mso-pagination:widow-orphan; + font-size:12.0pt; + font-family:"Times New Roman"; + mso-fareast-font-family:"Times New Roman";} +p.BalloonText, li.BalloonText, div.BalloonText + {mso-style-name:"Balloon Text"; + margin:0in; + margin-bottom:.0001pt; + mso-pagination:widow-orphan; + font-size:8.0pt; + font-family:Tahoma; + mso-fareast-font-family:"Times New Roman";} +@page Section1 + {size:8.5in 11.0in; + margin:1.0in 1.25in 1.0in 1.25in; + mso-header-margin:.5in; + mso-footer-margin:.5in; + mso-paper-source:0;} +div.Section1 + {page:Section1;} +--> +</style></head> + +<body style="" lang="EN-US"> + +<div class="Section1"> + +<p style="text-align: center;" align="center"><b>Eclipse Public License - v 1.0</b> +</p> + +<p><span style="font-size: 10pt;">THE ACCOMPANYING PROGRAM IS PROVIDED UNDER +THE TERMS OF THIS ECLIPSE PUBLIC LICENSE ("AGREEMENT"). ANY USE, +REPRODUCTION OR DISTRIBUTION OF THE PROGRAM CONSTITUTES RECIPIENT'S ACCEPTANCE +OF THIS AGREEMENT.</span> </p> + +<p><b><span style="font-size: 10pt;">1. DEFINITIONS</span></b> </p> + +<p><span style="font-size: 10pt;">"Contribution" means:</span> </p> + +<p class="MsoNormal" style="margin-left: 0.5in;"><span style="font-size: 10pt;">a) +in the case of the initial Contributor, the initial code and documentation +distributed under this Agreement, and<br clear="left"> +b) in the case of each subsequent Contributor:</span></p> + +<p class="MsoNormal" style="margin-left: 0.5in;"><span style="font-size: 10pt;">i) +changes to the Program, and</span></p> + +<p class="MsoNormal" style="margin-left: 0.5in;"><span style="font-size: 10pt;">ii) +additions to the Program;</span></p> + +<p class="MsoNormal" style="margin-left: 0.5in;"><span style="font-size: 10pt;">where +such changes and/or additions to the Program originate from and are distributed +by that particular Contributor. A Contribution 'originates' from a Contributor +if it was added to the Program by such Contributor itself or anyone acting on +such Contributor's behalf. Contributions do not include additions to the +Program which: (i) are separate modules of software distributed in conjunction +with the Program under their own license agreement, and (ii) are not derivative +works of the Program. </span></p> + +<p><span style="font-size: 10pt;">"Contributor" means any person or +entity that distributes the Program.</span> </p> + +<p><span style="font-size: 10pt;">"Licensed Patents " mean patent +claims licensable by a Contributor which are necessarily infringed by the use +or sale of its Contribution alone or when combined with the Program. </span></p> + +<p><span style="font-size: 10pt;">"Program" means the Contributions +distributed in accordance with this Agreement.</span> </p> + +<p><span style="font-size: 10pt;">"Recipient" means anyone who +receives the Program under this Agreement, including all Contributors.</span> </p> + +<p><b><span style="font-size: 10pt;">2. GRANT OF RIGHTS</span></b> </p> + +<p class="MsoNormal" style="margin-left: 0.5in;"><span style="font-size: 10pt;">a) +Subject to the terms of this Agreement, each Contributor hereby grants Recipient +a non-exclusive, worldwide, royalty-free copyright license to<span style="color: red;"> </span>reproduce, prepare derivative works of, publicly +display, publicly perform, distribute and sublicense the Contribution of such +Contributor, if any, and such derivative works, in source code and object code +form.</span></p> + +<p class="MsoNormal" style="margin-left: 0.5in;"><span style="font-size: 10pt;">b) +Subject to the terms of this Agreement, each Contributor hereby grants +Recipient a non-exclusive, worldwide,<span style="color: green;"> </span>royalty-free +patent license under Licensed Patents to make, use, sell, offer to sell, import +and otherwise transfer the Contribution of such Contributor, if any, in source +code and object code form. This patent license shall apply to the combination +of the Contribution and the Program if, at the time the Contribution is added +by the Contributor, such addition of the Contribution causes such combination +to be covered by the Licensed Patents. The patent license shall not apply to +any other combinations which include the Contribution. No hardware per se is +licensed hereunder. </span></p> + +<p class="MsoNormal" style="margin-left: 0.5in;"><span style="font-size: 10pt;">c) +Recipient understands that although each Contributor grants the licenses to its +Contributions set forth herein, no assurances are provided by any Contributor +that the Program does not infringe the patent or other intellectual property +rights of any other entity. Each Contributor disclaims any liability to Recipient +for claims brought by any other entity based on infringement of intellectual +property rights or otherwise. As a condition to exercising the rights and +licenses granted hereunder, each Recipient hereby assumes sole responsibility +to secure any other intellectual property rights needed, if any. For example, +if a third party patent license is required to allow Recipient to distribute +the Program, it is Recipient's responsibility to acquire that license before +distributing the Program.</span></p> + +<p class="MsoNormal" style="margin-left: 0.5in;"><span style="font-size: 10pt;">d) +Each Contributor represents that to its knowledge it has sufficient copyright +rights in its Contribution, if any, to grant the copyright license set forth in +this Agreement. </span></p> + +<p><b><span style="font-size: 10pt;">3. REQUIREMENTS</span></b> </p> + +<p><span style="font-size: 10pt;">A Contributor may choose to distribute the +Program in object code form under its own license agreement, provided that:</span> +</p> + +<p class="MsoNormal" style="margin-left: 0.5in;"><span style="font-size: 10pt;">a) +it complies with the terms and conditions of this Agreement; and</span></p> + +<p class="MsoNormal" style="margin-left: 0.5in;"><span style="font-size: 10pt;">b) +its license agreement:</span></p> + +<p class="MsoNormal" style="margin-left: 0.5in;"><span style="font-size: 10pt;">i) +effectively disclaims on behalf of all Contributors all warranties and +conditions, express and implied, including warranties or conditions of title +and non-infringement, and implied warranties or conditions of merchantability +and fitness for a particular purpose; </span></p> + +<p class="MsoNormal" style="margin-left: 0.5in;"><span style="font-size: 10pt;">ii) +effectively excludes on behalf of all Contributors all liability for damages, +including direct, indirect, special, incidental and consequential damages, such +as lost profits; </span></p> + +<p class="MsoNormal" style="margin-left: 0.5in;"><span style="font-size: 10pt;">iii) +states that any provisions which differ from this Agreement are offered by that +Contributor alone and not by any other party; and</span></p> + +<p class="MsoNormal" style="margin-left: 0.5in;"><span style="font-size: 10pt;">iv) +states that source code for the Program is available from such Contributor, and +informs licensees how to obtain it in a reasonable manner on or through a +medium customarily used for software exchange.<span style="color: blue;"> </span></span></p> + +<p><span style="font-size: 10pt;">When the Program is made available in source +code form:</span> </p> + +<p class="MsoNormal" style="margin-left: 0.5in;"><span style="font-size: 10pt;">a) +it must be made available under this Agreement; and </span></p> + +<p class="MsoNormal" style="margin-left: 0.5in;"><span style="font-size: 10pt;">b) a +copy of this Agreement must be included with each copy of the Program. </span></p> + +<p><span style="font-size: 10pt;">Contributors may not remove or alter any +copyright notices contained within the Program. </span></p> + +<p><span style="font-size: 10pt;">Each Contributor must identify itself as the +originator of its Contribution, if any, in a manner that reasonably allows +subsequent Recipients to identify the originator of the Contribution. </span></p> + +<p><b><span style="font-size: 10pt;">4. COMMERCIAL DISTRIBUTION</span></b> </p> + +<p><span style="font-size: 10pt;">Commercial distributors of software may +accept certain responsibilities with respect to end users, business partners +and the like. While this license is intended to facilitate the commercial use +of the Program, the Contributor who includes the Program in a commercial +product offering should do so in a manner which does not create potential +liability for other Contributors. Therefore, if a Contributor includes the +Program in a commercial product offering, such Contributor ("Commercial +Contributor") hereby agrees to defend and indemnify every other +Contributor ("Indemnified Contributor") against any losses, damages and +costs (collectively "Losses") arising from claims, lawsuits and other +legal actions brought by a third party against the Indemnified Contributor to +the extent caused by the acts or omissions of such Commercial Contributor in +connection with its distribution of the Program in a commercial product +offering. The obligations in this section do not apply to any claims or Losses +relating to any actual or alleged intellectual property infringement. In order +to qualify, an Indemnified Contributor must: a) promptly notify the Commercial +Contributor in writing of such claim, and b) allow the Commercial Contributor +to control, and cooperate with the Commercial Contributor in, the defense and +any related settlement negotiations. The Indemnified Contributor may participate +in any such claim at its own expense.</span> </p> + +<p><span style="font-size: 10pt;">For example, a Contributor might include the +Program in a commercial product offering, Product X. That Contributor is then a +Commercial Contributor. If that Commercial Contributor then makes performance +claims, or offers warranties related to Product X, those performance claims and +warranties are such Commercial Contributor's responsibility alone. Under this +section, the Commercial Contributor would have to defend claims against the +other Contributors related to those performance claims and warranties, and if a +court requires any other Contributor to pay any damages as a result, the +Commercial Contributor must pay those damages.</span> </p> + +<p><b><span style="font-size: 10pt;">5. NO WARRANTY</span></b> </p> + +<p><span style="font-size: 10pt;">EXCEPT AS EXPRESSLY SET FORTH IN THIS +AGREEMENT, THE PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT +WARRANTIES OR CONDITIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED INCLUDING, +WITHOUT LIMITATION, ANY WARRANTIES OR CONDITIONS OF TITLE, NON-INFRINGEMENT, +MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. Each Recipient is solely +responsible for determining the appropriateness of using and distributing the +Program and assumes all risks associated with its exercise of rights under this +Agreement , including but not limited to the risks and costs of program errors, +compliance with applicable laws, damage to or loss of data, programs or +equipment, and unavailability or interruption of operations. </span></p> + +<p><b><span style="font-size: 10pt;">6. DISCLAIMER OF LIABILITY</span></b> </p> + +<p><span style="font-size: 10pt;">EXCEPT AS EXPRESSLY SET FORTH IN THIS +AGREEMENT, NEITHER RECIPIENT NOR ANY CONTRIBUTORS SHALL HAVE ANY LIABILITY FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING WITHOUT LIMITATION LOST PROFITS), HOWEVER CAUSED AND ON ANY THEORY +OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING +NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OR DISTRIBUTION OF +THE PROGRAM OR THE EXERCISE OF ANY RIGHTS GRANTED HEREUNDER, EVEN IF ADVISED OF +THE POSSIBILITY OF SUCH DAMAGES.</span> </p> + +<p><b><span style="font-size: 10pt;">7. GENERAL</span></b> </p> + +<p><span style="font-size: 10pt;">If any provision of this Agreement is invalid +or unenforceable under applicable law, it shall not affect the validity or +enforceability of the remainder of the terms of this Agreement, and without +further action by the parties hereto, such provision shall be reformed to the +minimum extent necessary to make such provision valid and enforceable.</span> </p> + +<p><span style="font-size: 10pt;">If Recipient institutes patent litigation +against any entity (including a cross-claim or counterclaim in a lawsuit) +alleging that the Program itself (excluding combinations of the Program with +other software or hardware) infringes such Recipient's patent(s), then such +Recipient's rights granted under Section 2(b) shall terminate as of the date +such litigation is filed. </span></p> + +<p><span style="font-size: 10pt;">All Recipient's rights under this Agreement +shall terminate if it fails to comply with any of the material terms or +conditions of this Agreement and does not cure such failure in a reasonable +period of time after becoming aware of such noncompliance. If all Recipient's +rights under this Agreement terminate, Recipient agrees to cease use and +distribution of the Program as soon as reasonably practicable. However, +Recipient's obligations under this Agreement and any licenses granted by +Recipient relating to the Program shall continue and survive. </span></p> + +<p><span style="font-size: 10pt;">Everyone is permitted to copy and distribute +copies of this Agreement, but in order to avoid inconsistency the Agreement is +copyrighted and may only be modified in the following manner. The Agreement +Steward reserves the right to publish new versions (including revisions) of +this Agreement from time to time. No one other than the Agreement Steward has +the right to modify this Agreement. The Eclipse Foundation is the initial +Agreement Steward. The Eclipse Foundation may assign the responsibility to +serve as the Agreement Steward to a suitable separate entity. Each new version +of the Agreement will be given a distinguishing version number. The Program +(including Contributions) may always be distributed subject to the version of +the Agreement under which it was received. In addition, after a new version of +the Agreement is published, Contributor may elect to distribute the Program +(including its Contributions) under the new version. Except as expressly stated +in Sections 2(a) and 2(b) above, Recipient receives no rights or licenses to +the intellectual property of any Contributor under this Agreement, whether +expressly, by implication, estoppel or otherwise. All rights in the Program not +expressly granted under this Agreement are reserved.</span> </p> + +<p><span style="font-size: 10pt;">This Agreement is governed by the laws of the +State of New York and the intellectual property laws of the United States of +America. No party to this Agreement will bring a legal action under this +Agreement more than one year after the cause of action arose. Each party waives +its rights to a jury trial in any resulting litigation.</span> </p> + +<p class="MsoNormal"><!--[if !supportEmptyParas]--> <!--[endif]--><o:p></o:p></p> + +</div> + +</body></html>
\ No newline at end of file diff --git a/plugins/org.eclipse.emf.cdo.server.hibernate.teneo/plugin.properties b/plugins/org.eclipse.emf.cdo.server.hibernate.teneo/plugin.properties new file mode 100644 index 0000000000..2758122111 --- /dev/null +++ b/plugins/org.eclipse.emf.cdo.server.hibernate.teneo/plugin.properties @@ -0,0 +1,25 @@ +# Copyright (c) 2004 - 2008 Eike Stepper, Germany. +# 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 + +# NLS_MESSAGEFORMAT_VAR + +# ============================================================================== +# Do not change the properties between this line and the last line containing: +# %%% END OF TRANSLATED PROPERTIES %%% +# Instead, either redefine an existing property, or create a new property, +# append it to the end of the file, and change the code to use the new name. +# ============================================================================== + +pluginName = CDO Server Teneo Integration (Incubation) +providerName = Eclipse.org + +# ============================================================================== +# %%% END OF TRANSLATED PROPERTIES %%% +# The above properties have been shipped for translation. +# ============================================================================== diff --git a/plugins/org.eclipse.emf.cdo.server.hibernate.teneo/src/org/eclipse/emf/cdo/server/hibernate/teneo/CDOMappingContext.java b/plugins/org.eclipse.emf.cdo.server.hibernate.teneo/src/org/eclipse/emf/cdo/server/hibernate/teneo/CDOMappingContext.java new file mode 100644 index 0000000000..e4155c9047 --- /dev/null +++ b/plugins/org.eclipse.emf.cdo.server.hibernate.teneo/src/org/eclipse/emf/cdo/server/hibernate/teneo/CDOMappingContext.java @@ -0,0 +1,104 @@ +package org.eclipse.emf.cdo.server.hibernate.teneo; + +import org.eclipse.emf.teneo.annotations.pamodel.PAnnotatedEClass; +import org.eclipse.emf.teneo.hibernate.mapper.MappingContext; +import org.eclipse.emf.teneo.simpledom.Element; + +/** + * Mapping context for CDO. It provides cdo classes as propertyhandler etc. + * + * @author <a href="mtaal@elver.org">Martin Taal</a> + */ +public class CDOMappingContext extends MappingContext +{ + + /** Add a tuplizer element or not */ + @Override + public void addTuplizerElement(Element entityElement, PAnnotatedEClass aclass) + { + Element tuplizerElement = new Element("tuplizer").addAttribute("entity-mode", "dynamic-map").addAttribute("class", + "org.eclipse.emf.cdo.server.internal.hibernate.tuplizer.CDORevisionTuplizer"); + entityElement.add(0, tuplizerElement); + tuplizerElement = new Element("tuplizer").addAttribute("entity-mode", "pojo").addAttribute("class", + "org.eclipse.emf.cdo.server.internal.hibernate.tuplizer.CDORevisionTuplizer"); + entityElement.add(0, tuplizerElement); + } + + @Override + public String getComponentPropertyHandlerName() + { + return super.getComponentPropertyHandlerName(); + } + + @Override + public String getIdPropertyHandlerName() + { + return null; + } + + @Override + public String getPropertyHandlerName() + { + return super.getPropertyHandlerName(); + } + + @Override + public String getVersionPropertyHandlerName() + { + return null; + } + + @Override + public String getEnumUserType() + { + return super.getEnumUserType(); + } + + @Override + public String getEnumIntegerUserType() + { + return super.getEnumIntegerUserType(); + } + + @Override + public String getSyntheticIdPropertyHandlerName() + { + return super.getSyntheticIdPropertyHandlerName(); + } + + @Override + public String getSyntheticVersionPropertyHandlerName() + { + return super.getSyntheticVersionPropertyHandlerName(); + } + + @Override + public String getDynamicEnumUserType() + { + return super.getDynamicEnumIntegerUserType(); + } + + @Override + public String getDynamicEnumIntegerUserType() + { + return super.getDynamicEnumIntegerUserType(); + } + + @Override + public String getDefaultUserType() + { + return super.getDefaultUserType(); + } + + @Override + public String getXSDDateUserType() + { + return super.getXSDDateUserType(); + } + + @Override + public String getXSDDateTimeUserType() + { + return super.getXSDDateTimeUserType(); + } +} diff --git a/plugins/org.eclipse.emf.cdo.server.hibernate.teneo/src/org/eclipse/emf/cdo/server/hibernate/teneo/CDOTeneoException.java b/plugins/org.eclipse.emf.cdo.server.hibernate.teneo/src/org/eclipse/emf/cdo/server/hibernate/teneo/CDOTeneoException.java new file mode 100644 index 0000000000..0374c1b6cb --- /dev/null +++ b/plugins/org.eclipse.emf.cdo.server.hibernate.teneo/src/org/eclipse/emf/cdo/server/hibernate/teneo/CDOTeneoException.java @@ -0,0 +1,25 @@ +/*************************************************************************** + * Copyright (c) 2004 - 2008 Eike Stepper, Germany. + * 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 - initial API and implementation + **************************************************************************/ +package org.eclipse.emf.cdo.server.hibernate.teneo; + +/** + * Simple runtimeexception. + * + * @author Martin Taal + */ +public class CDOTeneoException extends RuntimeException { + + private static final long serialVersionUID = 1L; + + public CDOTeneoException(String msg, Throwable cause) { + super(msg, cause); + } +} diff --git a/plugins/org.eclipse.emf.cdo.server.hibernate.teneo/src/org/eclipse/emf/cdo/server/hibernate/teneo/TeneoHibernateMappingProvider.java b/plugins/org.eclipse.emf.cdo.server.hibernate.teneo/src/org/eclipse/emf/cdo/server/hibernate/teneo/TeneoHibernateMappingProvider.java new file mode 100644 index 0000000000..758372cd5a --- /dev/null +++ b/plugins/org.eclipse.emf.cdo.server.hibernate.teneo/src/org/eclipse/emf/cdo/server/hibernate/teneo/TeneoHibernateMappingProvider.java @@ -0,0 +1,111 @@ +/*************************************************************************** + * Copyright (c) 2004 - 2008 Eike Stepper, Germany. + * 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 - initial API and implementation + **************************************************************************/ +package org.eclipse.emf.cdo.server.hibernate.teneo; + +import java.io.ByteArrayInputStream; +import java.util.ArrayList; +import java.util.Collection; +import java.util.Collections; +import java.util.List; +import java.util.Properties; + +import org.eclipse.emf.cdo.server.hibernate.IHibernateMappingProvider; +import org.eclipse.emf.common.util.URI; +import org.eclipse.emf.ecore.EPackage; +import org.eclipse.emf.ecore.resource.Resource; +import org.eclipse.emf.ecore.resource.ResourceSet; +import org.eclipse.emf.ecore.resource.impl.ResourceSetImpl; +import org.eclipse.emf.ecore.xmi.impl.EcoreResourceFactoryImpl; +import org.eclipse.emf.teneo.extension.ExtensionManager; +import org.eclipse.emf.teneo.extension.ExtensionManagerFactory; +import org.eclipse.emf.teneo.extension.ExtensionUtil; +import org.eclipse.emf.teneo.hibernate.mapper.MappingContext; +import org.eclipse.emf.teneo.hibernate.mapper.MappingUtil; + +/** + * Handles different cases of input modes: the modelObjects can be a collection of String (containing an ecore model) or + * EPackage objects. + * + * @author Martin Taal + */ +public class TeneoHibernateMappingProvider implements IHibernateMappingProvider +{ + + // the passed modelObjects collection is defined as a collection of Objects + // to prevent binary dependency on emf. + public String provideMapping(Collection<Object> modelObjects, Properties properties) + { + // TODO: handle nested package structures + final List<EPackage> epacks = new ArrayList<EPackage>(); + final ResourceSet rs = new ResourceSetImpl(); + rs.getResourceFactoryRegistry().getExtensionToFactoryMap().put("ecore", new EcoreResourceFactoryImpl()); + for (Object o : modelObjects) + { + if (o instanceof EPackage) + { + epacks.addAll(resolveSubPackages((EPackage)o)); + } + else + { // assume a String read from it + final String ecoreStr = (String)o; + // this assumes that the (default) encoding is the same on both the client and + // server + final ByteArrayInputStream bis = new ByteArrayInputStream(ecoreStr.getBytes()); + // fool the resourceset by passing a fake uri + final URI epackageURI = URI.createURI("epackage.ecore"); + final Resource resource = rs.createResource(epackageURI); + try + { + resource.load(bis, Collections.EMPTY_MAP); + + // now the toplevel content should be EPackage + for (Object contentObject : resource.getContents()) + { + epacks.addAll(resolveSubPackages((EPackage)contentObject)); + } + } + catch (Exception e) + { + throw new CDOTeneoException("Exception when loading: " + ecoreStr, e); + } + } + } + + // translate the list of EPackages to an array + final EPackage[] ePackageArray = epacks.toArray(new EPackage[epacks.size()]); + + // register the custom cdo extensions + final ExtensionManager extensionManager = ExtensionManagerFactory.getInstance().create(); + registerCDOExtensions(extensionManager); + + // and go for it! + return MappingUtil.generateMapping(ePackageArray, properties, extensionManager); + } + + public void registerCDOExtensions(ExtensionManager extensionManager) + { + MappingUtil.registerHbExtensions(extensionManager); + extensionManager.registerExtension(ExtensionUtil.createExtension(MappingContext.class, CDOMappingContext.class, + false)); + } + + protected List<EPackage> resolveSubPackages(EPackage epack) + { + final List<EPackage> epacks = new ArrayList<EPackage>(); + epacks.add(epack); + for (EPackage subEPackage : epack.getESubpackages()) + { + epacks.addAll(resolveSubPackages(subEPackage)); + } + return epacks; + } + +} diff --git a/plugins/org.eclipse.emf.cdo.server.hibernate/.classpath b/plugins/org.eclipse.emf.cdo.server.hibernate/.classpath new file mode 100644 index 0000000000..3b5a3f3681 --- /dev/null +++ b/plugins/org.eclipse.emf.cdo.server.hibernate/.classpath @@ -0,0 +1,11 @@ +<?xml version="1.0" encoding="UTF-8"?> +<classpath> + <classpathentry kind="src" path="src"/> + <classpathentry exported="true" kind="lib" path="lib/asm.jar" sourcepath="org.eclipse.emf.cdo.server.hibernatesrc.zip"/> + <classpathentry exported="true" kind="lib" path="lib/cglib-2.1.3.jar" sourcepath="org.eclipse.emf.cdo.server.hibernatesrc.zip"/> + <classpathentry exported="true" kind="lib" path="lib/commons-collections-2.1.1.jar" sourcepath="org.eclipse.emf.cdo.server.hibernatesrc.zip"/> + <classpathentry exported="true" kind="lib" path="lib/jta.jar" sourcepath="org.eclipse.emf.cdo.server.hibernatesrc.zip"/> + <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.5"/> + <classpathentry exported="true" kind="con" path="org.eclipse.pde.core.requiredPlugins"/> + <classpathentry kind="output" path="bin"/> +</classpath> diff --git a/plugins/org.eclipse.emf.cdo.server.hibernate/.cvsignore b/plugins/org.eclipse.emf.cdo.server.hibernate/.cvsignore new file mode 100644 index 0000000000..e59ed82764 --- /dev/null +++ b/plugins/org.eclipse.emf.cdo.server.hibernate/.cvsignore @@ -0,0 +1,3 @@ +bin +doc +*.jar diff --git a/plugins/org.eclipse.emf.cdo.server.hibernate/.options b/plugins/org.eclipse.emf.cdo.server.hibernate/.options new file mode 100644 index 0000000000..b688dd9aed --- /dev/null +++ b/plugins/org.eclipse.emf.cdo.server.hibernate/.options @@ -0,0 +1,3 @@ +# Debugging and tracing options + +org.eclipse.emf.cdo.server.hibernate/debug = true diff --git a/plugins/org.eclipse.emf.cdo.server.hibernate/.project b/plugins/org.eclipse.emf.cdo.server.hibernate/.project new file mode 100644 index 0000000000..79f5f420b3 --- /dev/null +++ b/plugins/org.eclipse.emf.cdo.server.hibernate/.project @@ -0,0 +1,28 @@ +<?xml version="1.0" encoding="UTF-8"?> +<projectDescription> + <name>org.eclipse.emf.cdo.server.hibernate</name> + <comment></comment> + <projects> + </projects> + <buildSpec> + <buildCommand> + <name>org.eclipse.jdt.core.javabuilder</name> + <arguments> + </arguments> + </buildCommand> + <buildCommand> + <name>org.eclipse.pde.ManifestBuilder</name> + <arguments> + </arguments> + </buildCommand> + <buildCommand> + <name>org.eclipse.pde.SchemaBuilder</name> + <arguments> + </arguments> + </buildCommand> + </buildSpec> + <natures> + <nature>org.eclipse.pde.PluginNature</nature> + <nature>org.eclipse.jdt.core.javanature</nature> + </natures> +</projectDescription> 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 new file mode 100644 index 0000000000..188aa3a35d --- /dev/null +++ b/plugins/org.eclipse.emf.cdo.server.hibernate/.settings/org.eclipse.jdt.core.prefs @@ -0,0 +1,260 @@ +#Sat Feb 23 08:45:21 CET 2008 +eclipse.preferences.version=1 +org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5 +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_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_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_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.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=true +org.eclipse.jdt.core.formatter.comment.format_line_comments=true +org.eclipse.jdt.core.formatter.comment.format_source_code=true +org.eclipse.jdt.core.formatter.comment.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.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.format_guardian_clause_on_one_line=false +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_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_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_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_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_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_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.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=true +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_tabs_only_for_leading_indentations=false +org.eclipse.jdt.core.formatter.wrap_before_binary_operator=true diff --git a/plugins/org.eclipse.emf.cdo.server.hibernate/.settings/org.eclipse.jdt.ui.prefs b/plugins/org.eclipse.emf.cdo.server.hibernate/.settings/org.eclipse.jdt.ui.prefs new file mode 100644 index 0000000000..79a328703a --- /dev/null +++ b/plugins/org.eclipse.emf.cdo.server.hibernate/.settings/org.eclipse.jdt.ui.prefs @@ -0,0 +1,57 @@ +#Mon Feb 11 14:49:14 CET 2008 +cleanup.add_default_serial_version_id=true +cleanup.add_generated_serial_version_id=false +cleanup.add_missing_annotations=true +cleanup.add_missing_deprecated_annotations=true +cleanup.add_missing_nls_tags=false +cleanup.add_missing_override_annotations=true +cleanup.add_serial_version_id=true +cleanup.always_use_blocks=true +cleanup.always_use_parentheses_in_expressions=false +cleanup.always_use_this_for_non_static_field_access=false +cleanup.always_use_this_for_non_static_method_access=false +cleanup.convert_to_enhanced_for_loop=false +cleanup.format_source_code=true +cleanup.make_local_variable_final=true +cleanup.make_parameters_final=false +cleanup.make_private_fields_final=true +cleanup.make_variable_declarations_final=false +cleanup.never_use_blocks=false +cleanup.never_use_parentheses_in_expressions=true +cleanup.organize_imports=true +cleanup.qualify_static_field_accesses_with_declaring_class=false +cleanup.qualify_static_member_accesses_through_instances_with_declaring_class=true +cleanup.qualify_static_member_accesses_through_subtypes_with_declaring_class=true +cleanup.qualify_static_member_accesses_with_declaring_class=false +cleanup.qualify_static_method_accesses_with_declaring_class=false +cleanup.remove_private_constructors=true +cleanup.remove_trailing_whitespaces=true +cleanup.remove_trailing_whitespaces_all=true +cleanup.remove_trailing_whitespaces_ignore_empty=false +cleanup.remove_unnecessary_casts=true +cleanup.remove_unnecessary_nls_tags=true +cleanup.remove_unused_imports=true +cleanup.remove_unused_local_variables=false +cleanup.remove_unused_private_fields=true +cleanup.remove_unused_private_members=false +cleanup.remove_unused_private_methods=true +cleanup.remove_unused_private_types=true +cleanup.sort_members=false +cleanup.sort_members_all=false +cleanup.use_blocks=true +cleanup.use_blocks_only_for_return_and_throw=false +cleanup.use_parentheses_in_expressions=true +cleanup.use_this_for_non_static_field_access=true +cleanup.use_this_for_non_static_field_access_only_if_necessary=true +cleanup.use_this_for_non_static_method_access=true +cleanup.use_this_for_non_static_method_access_only_if_necessary=true +cleanup_profile=_EMFT +cleanup_settings_version=2 +eclipse.preferences.version=1 +formatter_profile=_EMFT +formatter_settings_version=11 +org.eclipse.jdt.ui.ignorelowercasenames=true +org.eclipse.jdt.ui.importorder=org.eclipse.emf.cdo;org.eclipse.emf.internal.cdo;org.eclipse.net4j;org.eclipse.internal.net4j;org.eclipse.emf;org.eclipse;com;org;javax;java; +org.eclipse.jdt.ui.ondemandthreshold=99 +org.eclipse.jdt.ui.staticondemandthreshold=99 +org.eclipse.jdt.ui.text.custom_code_templates=<?xml version\="1.0" encoding\="UTF-8"?><templates/> 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 new file mode 100644 index 0000000000..ccec2f617f --- /dev/null +++ b/plugins/org.eclipse.emf.cdo.server.hibernate/META-INF/MANIFEST.MF @@ -0,0 +1,100 @@ +Manifest-Version: 1.0 +Bundle-ManifestVersion: 2 +Bundle-Name: %pluginName +Bundle-SymbolicName: org.eclipse.emf.cdo.server.hibernate;singleton:=true +Bundle-Version: 0.8.0.qualifier +Bundle-Vendor: %providerName +Bundle-Activator: org.eclipse.emf.cdo.server.internal.hibernate.bundle.OM$Activator +Bundle-ClassPath: ., + lib/asm.jar, + lib/cglib-2.1.3.jar, + lib/commons-collections-2.1.1.jar, + lib/jta.jar +Bundle-Localization: plugin +Bundle-RequiredExecutionEnvironment: J2SE-1.5 +Require-Bundle: org.eclipse.core.runtime;bundle-version="[3.3.0,4.0.0)", + org.eclipse.emf.cdo.server;bundle-version="[0.8.0,0.9.0)";visibility:=reexport +Export-Package: org.eclipse.emf.cdo.server.hibernate, + org.eclipse.emf.cdo.server.internal.hibernate, + org.eclipse.emf.cdo.server.internal.hibernate.bundle, + org.eclipse.emf.cdo.server.internal.hibernate.info, + org.eclipse.emf.cdo.server.internal.hibernate.tuplizer, + org.hibernate, + org.hibernate.action, + org.hibernate.bytecode, + org.hibernate.bytecode.cglib, + org.hibernate.bytecode.javassist, + org.hibernate.bytecode.util, + org.hibernate.cache, + org.hibernate.cache.entry, + org.hibernate.cfg, + org.hibernate.classic, + org.hibernate.collection, + org.hibernate.connection, + org.hibernate.context, + org.hibernate.criterion, + org.hibernate.dialect, + org.hibernate.dialect.function, + org.hibernate.dialect.lock, + org.hibernate.engine, + org.hibernate.engine.loading, + org.hibernate.engine.query, + org.hibernate.engine.query.sql, + org.hibernate.engine.transaction, + org.hibernate.event, + org.hibernate.event.def, + org.hibernate.exception, + org.hibernate.hql, + org.hibernate.hql.antlr, + org.hibernate.hql.ast, + org.hibernate.hql.ast.exec, + org.hibernate.hql.ast.tree, + org.hibernate.hql.ast.util, + org.hibernate.hql.classic, + org.hibernate.id, + org.hibernate.id.enhanced, + org.hibernate.id.insert, + org.hibernate.impl, + org.hibernate.intercept, + org.hibernate.intercept.cglib, + org.hibernate.intercept.javassist, + org.hibernate.jdbc, + org.hibernate.jmx, + org.hibernate.loader, + org.hibernate.loader.collection, + org.hibernate.loader.criteria, + org.hibernate.loader.custom, + org.hibernate.loader.custom.sql, + org.hibernate.loader.entity, + org.hibernate.loader.hql, + org.hibernate.lob, + org.hibernate.mapping, + org.hibernate.metadata, + org.hibernate.param, + org.hibernate.persister, + org.hibernate.persister.collection, + org.hibernate.persister.entity, + org.hibernate.pretty, + org.hibernate.property, + org.hibernate.proxy, + org.hibernate.proxy.dom4j, + org.hibernate.proxy.map, + org.hibernate.proxy.pojo, + org.hibernate.proxy.pojo.cglib, + org.hibernate.proxy.pojo.javassist, + org.hibernate.secure, + org.hibernate.sql, + org.hibernate.stat, + org.hibernate.tool.hbm2ddl, + org.hibernate.tool.instrument, + org.hibernate.tool.instrument.cglib, + org.hibernate.tool.instrument.javassist, + org.hibernate.transaction, + org.hibernate.transform, + org.hibernate.tuple, + org.hibernate.tuple.component, + org.hibernate.tuple.entity, + org.hibernate.type, + org.hibernate.usertype, + org.hibernate.util +Eclipse-LazyStart: true diff --git a/plugins/org.eclipse.emf.cdo.server.hibernate/about.html b/plugins/org.eclipse.emf.cdo.server.hibernate/about.html new file mode 100644 index 0000000000..d35d5aed64 --- /dev/null +++ b/plugins/org.eclipse.emf.cdo.server.hibernate/about.html @@ -0,0 +1,28 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" + "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml"> +<head> +<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"/> +<title>About</title> +</head> +<body lang="EN-US"> +<h2>About This Content</h2> + +<p>June 5, 2007</p> +<h3>License</h3> + +<p>The Eclipse Foundation makes available all content in this plug-in ("Content"). Unless otherwise +indicated below, the Content is provided to you under the terms and conditions of the +Eclipse Public License Version 1.0 ("EPL"). A copy of the EPL is available +at <a href="http://www.eclipse.org/legal/epl-v10.html">http://www.eclipse.org/legal/epl-v10.html</a>. +For purposes of the EPL, "Program" will mean the Content.</p> + +<p>If you did not receive this Content directly from the Eclipse Foundation, the Content is +being redistributed by another party ("Redistributor") and different terms and conditions may +apply to your use of any object code in the Content. Check the Redistributor's license that was +provided with the Content. If no such license exists, contact the Redistributor. Unless otherwise +indicated below, the terms and conditions of the EPL still apply to any source code in the Content +and such source code may be obtained at <a href="http://www.eclipse.org/">http://www.eclipse.org</a>.</p> + +</body> +</html> diff --git a/plugins/org.eclipse.emf.cdo.server.hibernate/build.properties b/plugins/org.eclipse.emf.cdo.server.hibernate/build.properties new file mode 100644 index 0000000000..e3ed708891 --- /dev/null +++ b/plugins/org.eclipse.emf.cdo.server.hibernate/build.properties @@ -0,0 +1,28 @@ +# Copyright (c) 2004 - 2008 Eike Stepper, Germany. +# 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 + +# NLS_MESSAGEFORMAT_VAR + +source.. = src/ +output.. = bin/ +bin.includes = META-INF/,\ + .,\ + .options,\ + about.html,\ + copyright.txt,\ + epl-v10.html,\ + license.html,\ + plugin.xml,\ + plugin.properties,\ + mappings/,\ + src/log4j.properties,\ + lib/ +jars.extra.classpath = platform:/plugin/org.eclipse.emf.teneo.hibernate.mapper/dom4j-1.6.1.jar,\ + platform:/plugin/org.eclipse.emf.teneo.hibernate.mapper/hibernate3.jar,\ + platform:/plugin/org.eclipse.emf.teneo.libraries/commons-logging.jar diff --git a/plugins/org.eclipse.emf.cdo.server.hibernate/copyright.txt b/plugins/org.eclipse.emf.cdo.server.hibernate/copyright.txt new file mode 100644 index 0000000000..529118d99e --- /dev/null +++ b/plugins/org.eclipse.emf.cdo.server.hibernate/copyright.txt @@ -0,0 +1,8 @@ +Copyright (c) 2004 - 2008 Eike Stepper, Germany. +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
\ No newline at end of file diff --git a/plugins/org.eclipse.emf.cdo.server.hibernate/epl-v10.html b/plugins/org.eclipse.emf.cdo.server.hibernate/epl-v10.html new file mode 100644 index 0000000000..d7b88e9416 --- /dev/null +++ b/plugins/org.eclipse.emf.cdo.server.hibernate/epl-v10.html @@ -0,0 +1,319 @@ +<html xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns="http://www.w3.org/TR/REC-html40"><head> +<meta http-equiv="Content-Type" content="text/html; charset=windows-1252"> +<meta name="ProgId" content="Word.Document"> +<meta name="Generator" content="Microsoft Word 9"> +<meta name="Originator" content="Microsoft Word 9"> +<link rel="File-List" href="http://www.eclipse.org/org/documents/Eclipse%20EPL%202003_11_10%20Final_files/filelist.xml"><title>Eclipse Public License - Version 1.0</title><!--[if gte mso 9]><xml> + <o:DocumentProperties> + <o:Revision>2</o:Revision> + <o:TotalTime>3</o:TotalTime> + <o:Created>2004-03-05T23:03:00Z</o:Created> + <o:LastSaved>2004-03-05T23:03:00Z</o:LastSaved> + <o:Pages>4</o:Pages> + <o:Words>1626</o:Words> + <o:Characters>9270</o:Characters> + <o:Lines>77</o:Lines> + <o:Paragraphs>18</o:Paragraphs> + <o:CharactersWithSpaces>11384</o:CharactersWithSpaces> + <o:Version>9.4402</o:Version> + </o:DocumentProperties> +</xml><![endif]--><!--[if gte mso 9]><xml> + <w:WordDocument> + <w:TrackRevisions/> + </w:WordDocument> +</xml><![endif]--> + + +<style> +<!-- + /* Font Definitions */ +@font-face + {font-family:Tahoma; + panose-1:2 11 6 4 3 5 4 4 2 4; + mso-font-charset:0; + mso-generic-font-family:swiss; + mso-font-pitch:variable; + mso-font-signature:553679495 -2147483648 8 0 66047 0;} + /* Style Definitions */ +p.MsoNormal, li.MsoNormal, div.MsoNormal + {mso-style-parent:""; + margin:0in; + margin-bottom:.0001pt; + mso-pagination:widow-orphan; + font-size:12.0pt; + font-family:"Times New Roman"; + mso-fareast-font-family:"Times New Roman";} +p + {margin-right:0in; + mso-margin-top-alt:auto; + mso-margin-bottom-alt:auto; + margin-left:0in; + mso-pagination:widow-orphan; + font-size:12.0pt; + font-family:"Times New Roman"; + mso-fareast-font-family:"Times New Roman";} +p.BalloonText, li.BalloonText, div.BalloonText + {mso-style-name:"Balloon Text"; + margin:0in; + margin-bottom:.0001pt; + mso-pagination:widow-orphan; + font-size:8.0pt; + font-family:Tahoma; + mso-fareast-font-family:"Times New Roman";} +@page Section1 + {size:8.5in 11.0in; + margin:1.0in 1.25in 1.0in 1.25in; + mso-header-margin:.5in; + mso-footer-margin:.5in; + mso-paper-source:0;} +div.Section1 + {page:Section1;} +--> +</style></head> + +<body style="" lang="EN-US"> + +<div class="Section1"> + +<p style="text-align: center;" align="center"><b>Eclipse Public License - v 1.0</b> +</p> + +<p><span style="font-size: 10pt;">THE ACCOMPANYING PROGRAM IS PROVIDED UNDER +THE TERMS OF THIS ECLIPSE PUBLIC LICENSE ("AGREEMENT"). ANY USE, +REPRODUCTION OR DISTRIBUTION OF THE PROGRAM CONSTITUTES RECIPIENT'S ACCEPTANCE +OF THIS AGREEMENT.</span> </p> + +<p><b><span style="font-size: 10pt;">1. DEFINITIONS</span></b> </p> + +<p><span style="font-size: 10pt;">"Contribution" means:</span> </p> + +<p class="MsoNormal" style="margin-left: 0.5in;"><span style="font-size: 10pt;">a) +in the case of the initial Contributor, the initial code and documentation +distributed under this Agreement, and<br clear="left"> +b) in the case of each subsequent Contributor:</span></p> + +<p class="MsoNormal" style="margin-left: 0.5in;"><span style="font-size: 10pt;">i) +changes to the Program, and</span></p> + +<p class="MsoNormal" style="margin-left: 0.5in;"><span style="font-size: 10pt;">ii) +additions to the Program;</span></p> + +<p class="MsoNormal" style="margin-left: 0.5in;"><span style="font-size: 10pt;">where +such changes and/or additions to the Program originate from and are distributed +by that particular Contributor. A Contribution 'originates' from a Contributor +if it was added to the Program by such Contributor itself or anyone acting on +such Contributor's behalf. Contributions do not include additions to the +Program which: (i) are separate modules of software distributed in conjunction +with the Program under their own license agreement, and (ii) are not derivative +works of the Program. </span></p> + +<p><span style="font-size: 10pt;">"Contributor" means any person or +entity that distributes the Program.</span> </p> + +<p><span style="font-size: 10pt;">"Licensed Patents " mean patent +claims licensable by a Contributor which are necessarily infringed by the use +or sale of its Contribution alone or when combined with the Program. </span></p> + +<p><span style="font-size: 10pt;">"Program" means the Contributions +distributed in accordance with this Agreement.</span> </p> + +<p><span style="font-size: 10pt;">"Recipient" means anyone who +receives the Program under this Agreement, including all Contributors.</span> </p> + +<p><b><span style="font-size: 10pt;">2. GRANT OF RIGHTS</span></b> </p> + +<p class="MsoNormal" style="margin-left: 0.5in;"><span style="font-size: 10pt;">a) +Subject to the terms of this Agreement, each Contributor hereby grants Recipient +a non-exclusive, worldwide, royalty-free copyright license to<span style="color: red;"> </span>reproduce, prepare derivative works of, publicly +display, publicly perform, distribute and sublicense the Contribution of such +Contributor, if any, and such derivative works, in source code and object code +form.</span></p> + +<p class="MsoNormal" style="margin-left: 0.5in;"><span style="font-size: 10pt;">b) +Subject to the terms of this Agreement, each Contributor hereby grants +Recipient a non-exclusive, worldwide,<span style="color: green;"> </span>royalty-free +patent license under Licensed Patents to make, use, sell, offer to sell, import +and otherwise transfer the Contribution of such Contributor, if any, in source +code and object code form. This patent license shall apply to the combination +of the Contribution and the Program if, at the time the Contribution is added +by the Contributor, such addition of the Contribution causes such combination +to be covered by the Licensed Patents. The patent license shall not apply to +any other combinations which include the Contribution. No hardware per se is +licensed hereunder. </span></p> + +<p class="MsoNormal" style="margin-left: 0.5in;"><span style="font-size: 10pt;">c) +Recipient understands that although each Contributor grants the licenses to its +Contributions set forth herein, no assurances are provided by any Contributor +that the Program does not infringe the patent or other intellectual property +rights of any other entity. Each Contributor disclaims any liability to Recipient +for claims brought by any other entity based on infringement of intellectual +property rights or otherwise. As a condition to exercising the rights and +licenses granted hereunder, each Recipient hereby assumes sole responsibility +to secure any other intellectual property rights needed, if any. For example, +if a third party patent license is required to allow Recipient to distribute +the Program, it is Recipient's responsibility to acquire that license before +distributing the Program.</span></p> + +<p class="MsoNormal" style="margin-left: 0.5in;"><span style="font-size: 10pt;">d) +Each Contributor represents that to its knowledge it has sufficient copyright +rights in its Contribution, if any, to grant the copyright license set forth in +this Agreement. </span></p> + +<p><b><span style="font-size: 10pt;">3. REQUIREMENTS</span></b> </p> + +<p><span style="font-size: 10pt;">A Contributor may choose to distribute the +Program in object code form under its own license agreement, provided that:</span> +</p> + +<p class="MsoNormal" style="margin-left: 0.5in;"><span style="font-size: 10pt;">a) +it complies with the terms and conditions of this Agreement; and</span></p> + +<p class="MsoNormal" style="margin-left: 0.5in;"><span style="font-size: 10pt;">b) +its license agreement:</span></p> + +<p class="MsoNormal" style="margin-left: 0.5in;"><span style="font-size: 10pt;">i) +effectively disclaims on behalf of all Contributors all warranties and +conditions, express and implied, including warranties or conditions of title +and non-infringement, and implied warranties or conditions of merchantability +and fitness for a particular purpose; </span></p> + +<p class="MsoNormal" style="margin-left: 0.5in;"><span style="font-size: 10pt;">ii) +effectively excludes on behalf of all Contributors all liability for damages, +including direct, indirect, special, incidental and consequential damages, such +as lost profits; </span></p> + +<p class="MsoNormal" style="margin-left: 0.5in;"><span style="font-size: 10pt;">iii) +states that any provisions which differ from this Agreement are offered by that +Contributor alone and not by any other party; and</span></p> + +<p class="MsoNormal" style="margin-left: 0.5in;"><span style="font-size: 10pt;">iv) +states that source code for the Program is available from such Contributor, and +informs licensees how to obtain it in a reasonable manner on or through a +medium customarily used for software exchange.<span style="color: blue;"> </span></span></p> + +<p><span style="font-size: 10pt;">When the Program is made available in source +code form:</span> </p> + +<p class="MsoNormal" style="margin-left: 0.5in;"><span style="font-size: 10pt;">a) +it must be made available under this Agreement; and </span></p> + +<p class="MsoNormal" style="margin-left: 0.5in;"><span style="font-size: 10pt;">b) a +copy of this Agreement must be included with each copy of the Program. </span></p> + +<p><span style="font-size: 10pt;">Contributors may not remove or alter any +copyright notices contained within the Program. </span></p> + +<p><span style="font-size: 10pt;">Each Contributor must identify itself as the +originator of its Contribution, if any, in a manner that reasonably allows +subsequent Recipients to identify the originator of the Contribution. </span></p> + +<p><b><span style="font-size: 10pt;">4. COMMERCIAL DISTRIBUTION</span></b> </p> + +<p><span style="font-size: 10pt;">Commercial distributors of software may +accept certain responsibilities with respect to end users, business partners +and the like. While this license is intended to facilitate the commercial use +of the Program, the Contributor who includes the Program in a commercial +product offering should do so in a manner which does not create potential +liability for other Contributors. Therefore, if a Contributor includes the +Program in a commercial product offering, such Contributor ("Commercial +Contributor") hereby agrees to defend and indemnify every other +Contributor ("Indemnified Contributor") against any losses, damages and +costs (collectively "Losses") arising from claims, lawsuits and other +legal actions brought by a third party against the Indemnified Contributor to +the extent caused by the acts or omissions of such Commercial Contributor in +connection with its distribution of the Program in a commercial product +offering. The obligations in this section do not apply to any claims or Losses +relating to any actual or alleged intellectual property infringement. In order +to qualify, an Indemnified Contributor must: a) promptly notify the Commercial +Contributor in writing of such claim, and b) allow the Commercial Contributor +to control, and cooperate with the Commercial Contributor in, the defense and +any related settlement negotiations. The Indemnified Contributor may participate +in any such claim at its own expense.</span> </p> + +<p><span style="font-size: 10pt;">For example, a Contributor might include the +Program in a commercial product offering, Product X. That Contributor is then a +Commercial Contributor. If that Commercial Contributor then makes performance +claims, or offers warranties related to Product X, those performance claims and +warranties are such Commercial Contributor's responsibility alone. Under this +section, the Commercial Contributor would have to defend claims against the +other Contributors related to those performance claims and warranties, and if a +court requires any other Contributor to pay any damages as a result, the +Commercial Contributor must pay those damages.</span> </p> + +<p><b><span style="font-size: 10pt;">5. NO WARRANTY</span></b> </p> + +<p><span style="font-size: 10pt;">EXCEPT AS EXPRESSLY SET FORTH IN THIS +AGREEMENT, THE PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT +WARRANTIES OR CONDITIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED INCLUDING, +WITHOUT LIMITATION, ANY WARRANTIES OR CONDITIONS OF TITLE, NON-INFRINGEMENT, +MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. Each Recipient is solely +responsible for determining the appropriateness of using and distributing the +Program and assumes all risks associated with its exercise of rights under this +Agreement , including but not limited to the risks and costs of program errors, +compliance with applicable laws, damage to or loss of data, programs or +equipment, and unavailability or interruption of operations. </span></p> + +<p><b><span style="font-size: 10pt;">6. DISCLAIMER OF LIABILITY</span></b> </p> + +<p><span style="font-size: 10pt;">EXCEPT AS EXPRESSLY SET FORTH IN THIS +AGREEMENT, NEITHER RECIPIENT NOR ANY CONTRIBUTORS SHALL HAVE ANY LIABILITY FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING WITHOUT LIMITATION LOST PROFITS), HOWEVER CAUSED AND ON ANY THEORY +OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING +NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OR DISTRIBUTION OF +THE PROGRAM OR THE EXERCISE OF ANY RIGHTS GRANTED HEREUNDER, EVEN IF ADVISED OF +THE POSSIBILITY OF SUCH DAMAGES.</span> </p> + +<p><b><span style="font-size: 10pt;">7. GENERAL</span></b> </p> + +<p><span style="font-size: 10pt;">If any provision of this Agreement is invalid +or unenforceable under applicable law, it shall not affect the validity or +enforceability of the remainder of the terms of this Agreement, and without +further action by the parties hereto, such provision shall be reformed to the +minimum extent necessary to make such provision valid and enforceable.</span> </p> + +<p><span style="font-size: 10pt;">If Recipient institutes patent litigation +against any entity (including a cross-claim or counterclaim in a lawsuit) +alleging that the Program itself (excluding combinations of the Program with +other software or hardware) infringes such Recipient's patent(s), then such +Recipient's rights granted under Section 2(b) shall terminate as of the date +such litigation is filed. </span></p> + +<p><span style="font-size: 10pt;">All Recipient's rights under this Agreement +shall terminate if it fails to comply with any of the material terms or +conditions of this Agreement and does not cure such failure in a reasonable +period of time after becoming aware of such noncompliance. If all Recipient's +rights under this Agreement terminate, Recipient agrees to cease use and +distribution of the Program as soon as reasonably practicable. However, +Recipient's obligations under this Agreement and any licenses granted by +Recipient relating to the Program shall continue and survive. </span></p> + +<p><span style="font-size: 10pt;">Everyone is permitted to copy and distribute +copies of this Agreement, but in order to avoid inconsistency the Agreement is +copyrighted and may only be modified in the following manner. The Agreement +Steward reserves the right to publish new versions (including revisions) of +this Agreement from time to time. No one other than the Agreement Steward has +the right to modify this Agreement. The Eclipse Foundation is the initial +Agreement Steward. The Eclipse Foundation may assign the responsibility to +serve as the Agreement Steward to a suitable separate entity. Each new version +of the Agreement will be given a distinguishing version number. The Program +(including Contributions) may always be distributed subject to the version of +the Agreement under which it was received. In addition, after a new version of +the Agreement is published, Contributor may elect to distribute the Program +(including its Contributions) under the new version. Except as expressly stated +in Sections 2(a) and 2(b) above, Recipient receives no rights or licenses to +the intellectual property of any Contributor under this Agreement, whether +expressly, by implication, estoppel or otherwise. All rights in the Program not +expressly granted under this Agreement are reserved.</span> </p> + +<p><span style="font-size: 10pt;">This Agreement is governed by the laws of the +State of New York and the intellectual property laws of the United States of +America. No party to this Agreement will bring a legal action under this +Agreement more than one year after the cause of action arose. Each party waives +its rights to a jury trial in any resulting litigation.</span> </p> + +<p class="MsoNormal"><!--[if !supportEmptyParas]--> <!--[endif]--><o:p></o:p></p> + +</div> + +</body></html>
\ No newline at end of file diff --git a/plugins/org.eclipse.emf.cdo.server.hibernate/lib/.cvsignore b/plugins/org.eclipse.emf.cdo.server.hibernate/lib/.cvsignore new file mode 100644 index 0000000000..d392f0e82c --- /dev/null +++ b/plugins/org.eclipse.emf.cdo.server.hibernate/lib/.cvsignore @@ -0,0 +1 @@ +*.jar diff --git a/plugins/org.eclipse.emf.cdo.server.hibernate/lib/changelog.txt b/plugins/org.eclipse.emf.cdo.server.hibernate/lib/changelog.txt new file mode 100644 index 0000000000..f5240a64db --- /dev/null +++ b/plugins/org.eclipse.emf.cdo.server.hibernate/lib/changelog.txt @@ -0,0 +1,2438 @@ +Hibernate Changelog +=================== +Note: Newer entries are automatically generated and the description might not +match the actual issue resolution (i.e. a bug might not be a bug). Please +refer to the particular case on JIRA using the issue tracking number to learn +more about each case. + + +Changes in version 3.2.5 (2007.07.31) +------------------------------------------- + +** Bug + * [HHH-1116] - batch-size typo + * [HHH-1561] - Missing " in Documentation for H3, Chapter 15.8 + * [HHH-1569] - Immutable Natural Id check fails with ArrayIndexOutOfBounds in some cases + * [HHH-1694] - Documentation Outdated: "10.4.4. Queries in native SQL" + * [HHH-2180] - minordocumentation error in hbm xml + * [HHH-2201] - session.iterate() does not exist + * [HHH-2267] - A copy/paste mistake in the documentation for <schemavalidator> ant task + * [HHH-2334] - Documentation error in section 5.1.3 + * [HHH-2420] - Error in 2.5. Contextual Sessions + * [HHH-2502] - The second level caching documentation states that ehcache is not distributed. + * [HHH-2631] - Leaking PreparedStatement and ResultSet via CollectionLoadContext instances maintained in Map collectionLoadContexts in LoadContexts + * [HHH-2649] - Batcher configuration parameter incorrectly documented + * [HHH-2711] - PropertyAccessException with backref and <composite-map-key/> + * [HHH-2713] - duplicated phrase in docs "of the of the" + * [HHH-2714] - Three typos in code examples + * [HHH-2719] - adddress --> address + * [HHH-2720] - Monetory --> Monetary + +** Improvement + * [HHH-1022] - incomplete documentation in _README.txt in the lib directory + * [HHH-1682] - Improve the description of differences between save() and persist() + * [HHH-2048] - Incomplete MappingException at org.hibernate.mapping.SimpleValue + * [HHH-2417] - Update book on Hibernate reference + * [HHH-2418] - Refer HSQL DB website in chapter 1.2.3 + * [HHH-2487] - Typo in "5.1.7. version (optional)" + * [HHH-2550] - Update API Class in 10.4.3. Criteria queries + * [HHH-2662] - Workaround PostgreSQL issues in testsuite + * [HHH-2663] - Map java.sql.Types.REAL to Hibernate FloatType for auto-discovery stuff + * [HHH-2665] - Split Oracle9Dialect into Oracle9iDialect and Oracle10gDialect + +** Patch + * [HHH-2520] - Miscellaneous config doc spelling fixes + * [HHH-2630] - Hibernate Dialect is not auto-detected for Sybase ASE and DB2 (Shelley McGowan) + * [HHH-2758] - Patch IngresDialect based on certification + +** Task + * [HHH-2551] - Deprecate org.hibernate.criterion.Expression + * [HHH-2566] - Replace usages of FlushMode.NEVER with FlushMode.MANUAL + * [HHH-2567] - Update reference to use FlushMode.MANUAL + * [HHH-2568] - Hibernate javadoc overview refering wrong classes and packages + + +Changes in version 3.2.4.sp1 (2007.05.18) +------------------------------------------- + +** Bug + * [HHH-2605] - Since 3.2.4 no value specified for row id + * [HHH-2613] - LockMode.FORCE on non versioned entity leads to NPE + + +Changes in version 3.2.4 (2007.05.09) +------------------------------------------- + +** Bug + * [HHH-511] - reattach object from same session + * [HHH-2316] - org.hibernate.cache.CacheKey.equals() can cause PropertyAccessException to be thrown + * [HHH-2553] - New LoadContexts Implementation causing possible performance degradation + * [HHH-2602] - instrumented many-to-one problem with aggressive release + +** Deprecation + * [HHH-2603] - Deprecate the Session.connection() method + +** Improvement + * [HHH-2549] - Warn users explicitly about schemaexport and schemaupdate does not support annotations + +** New Feature + * [HHH-1] - Optimize Hibernate for the bulk insertion of related entities + +** Patch + * [HHH-2301] - Identity generator with custom insert SQL broken in 3.2 (Scott Rankin and Gail Badner) + * [HHH-2336] - paremeterizable and typedef-able UserCollectionType (Holger Brands) + * [HHH-2580] - Performace: Too many lookups of WAS extended transaction support (Jesper Udby) + + +Changes in version 3.2.3 (2007.04.02) +------------------------------------------- + +** Bug + * [HHH-2376] - Query with fully qualified entity class fails + * [HHH-2392] - LockModes referencing non-root joined-subclass class in HQL/Criteria + * [HHH-2393] - Generated properties leave open ResultSet on Batcher to be closed on transaction completion + * [HHH-2397] - hilo generator can generate negative numbers because of arithmetic overflow + * [HHH-2469] - ArrayIndexOutOfBoundsException during update by rowid + * [HHH-2476] - PersistentMap.put() incorrect on uninitialized, non-extra-lazy map + * [HHH-2481] - Big memory leak in the use of CGLIB + * [HHH-2499] - incorrect assertion failure relating to generated property values + * [HHH-2513] - Abusive WARN logged during deserialization of replicated SessionFactory + * [HHH-2521] - Fix cascading of merge across component properties + * [HHH-2532] - update/delete executeUpdate() causes problems with JBossCache (at least in opt-locking setups) + +** Improvement + * [HHH-2495] - encapsulate the notion of state pertaining to processing a result set + * [HHH-2534] - better error message for illegal 'collection dereference' in HQL query + * [HHH-2535] - Change Cache' Cache71Dialect so that sequence support returns false + +** New Feature + * [HHH-2471] - create a set of "enhanced" generators + * [HHH-2500] - apply Terradata certification results + +** Patch + * [HHH-2367] - InformixDialect uses wrong data type + * [HHH-2489] - SQL comments for HQL bulk operations + + +Changes in version 3.2.2 (2007.01.24) +------------------------------------------- + +** Bug + * [HHH-1471] - If the 'generated' attribute is set to 'insert' or 'always' on the property of a component it is ignored and the value is not read from the database. + * [HHH-1646] - Bad code in FastClass.equals + * [HHH-1889] - LockMode.UPGRADE not applied in all cases for SQL Server / Sybase + * [HHH-2112] - ClassCastException in StatefulPersistenceContext.getCachedDatabaseSnapshot(...) + * [HHH-2221] - MySQL temp table DDL and isolation + * [HHH-2238] - SQLQuery executeUpdate doesn't respect Query.setFlushMode() + * [HHH-2251] - Settings build unnecessary in schemaupdate/schemavalidate + * [HHH-2257] - Query.iterate() results differ from Query.list() 2 + * [HHH-2259] - autoflush and autoclose not longer occur in JTA environment with hibernate 3.2 + * [HHH-2264] - NPE when NamedQuery contains space before variable name + * [HHH-2274] - Collection ordering when many to many order by is used is not respected + * [HHH-2275] - Mapping a composite element as a map key using formulas can lead to AOOBE + * [HHH-2284] - HQL: selecting components inside components doesn't work + * [HHH-2291] - collection based on property-ref not handled correctly during reattch + * [HHH-2292] - merge detached instance fails to persist collection changes in case of bare collection reference + * [HHH-2356] - NullableType.toString(Object) should account for nulls + * [HHH-2366] - Changing a component's value does not trigger an update during flush + * [HHH-2378] - replicate() of non-versioned entiy can result in wrong value for version in entity cache + +** Improvement + * [HHH-1851] - relax special handling of 'id' property + * [HHH-2130] - SQLQuery does not autoflush all entities used in the query + * [HHH-2193] - Introduce a flag to avoid checking NamedQuery at startup + * [HHH-2242] - Consider Allowing Optimistic Lock Strategies other than 'Version' with joined-subclass + * [HHH-2250] - Create an appropriate error message if Query.setEntity is passed a NULL value + * [HHH-2282] - PersistentClass property lookups do not properly account for embedded composite identifiers + * [HHH-2286] - dialect informational metadata + * [HHH-2372] - Allow tooling to create Settings via SettingsFactory without contacting the db + +** New Feature + * [HHH-2246] - No way to specify CACHE_PROVIDER_CONFIG in HibernateServiceMBean + +** Patch + * [HHH-2300] - Updated dialect for H2 database engine + * [HHH-2371] - enhancements to C3P0ConnectionProvider + +** Task + * [HHH-2032] - update c3p0 to 0.9.1 + + + +Changes in version 3.2.1 (2006.11.16) +------------------------------------------- + +** Bug + * [HHH-939] - 'class' property in HQL results in incorrect SQL for joined-subclass + * [HHH-1401] - session.merge() executes unnecessary updates when one-to-many relationship is defined. + * [HHH-1460] - Inconsistent behavior when using Session.get() with multiple subclasses + * [HHH-1564] - deleting versioned object with collection leads to unecessary update + * [HHH-1629] - SchemaUpdate/validator doesn't listen to quoting + * [HHH-1631] - Missing table in SQL from clause that is referenced in where clause when using joined subclass + * [HHH-1651] - hibernate does not find an existing sequence from an Oracle database + * [HHH-1663] - <any/> with collection will produce "AssertionFailure: collection was not processed by flush()" + * [HHH-1737] - Add a ConnectionWrapper interface to allow access to the underlying connection from a BorrowedConnectionProxy + * [HHH-1756] - Proxy objects are not removed from the BatchFetchQueue during a session evict + * [HHH-1774] - Component parameters bound incorrectly + * [HHH-1921] - "dirty, but no dirty properties" thrown when Interceptor resets properties. + * [HHH-1986] - javassist throws InvocationTargetException instead of original checked Exception + * [HHH-2027] - merge listener over-writes Interceptor changes to component state for a transient entity + * [HHH-2044] - DefaultMergeEventListener.entityIsDetached call StaleObjectStateException with wrong identifier + * [HHH-2082] - UpdateTimestampsCache.isUpToDate returns before checking all spaces + * [HHH-2108] - cacheable files broken + * [HHH-2138] - merge with bidirectional one-to-one may fail + * [HHH-2145] - set.retainAll calling set.addAll + * [HHH-2174] - Wrong log message in SessionImpl.afterTransactionCompletion(...) + * [HHH-2199] - Unique constraints on nullable columns should not be generated with unique-key is used and supportsNotNullUnique=false + * [HHH-2202] - Clearing the connection warnings even when log is > WARN to workaround a Sybase issue + * [HHH-2206] - SessionImpl tries to deserialize itself in an incorrect order + * [HHH-2207] - Suggested fix for HQL - MySQL setMaxResults issue + * [HHH-2226] - org.hibernate.hql.ast.tree.FromElementType contains warning log message that should be debug instead + * [HHH-2229] - Performance issue with fix for HHH-1293, CGLIBLazyInitializer may be slower for certain Java classes + * [HHH-2236] - Lazy property + setReadOnly + Instrumented classes results in NullPointerException when accessing lazy property + +** Improvement + * [HHH-2037] - provide Query.setProperties(Map) + * [HHH-2042] - Typo in FlushMode.MANUAL Javadoc + * [HHH-2057] - Add "remove" cascading style to CascadeStyle for XML mappings + * [HHH-2127] - Document <filter-def condition="defaultCondition"> and <filter-def>defaultCondition + * [HHH-2135] - Hibernate Deserialization: In org.hibernate.type.SerializableType the code makes a test for the return of a null object by simply testing the object as to whether or not it is null. + * [HHH-2185] - introduce setting to control cglib caching of classes + * [HHH-2203] - Make Post*Events extend AbstractEvent + * [HHH-2208] - Table schema use in DatabaseMetadata + * [HHH-2209] - ehcache.jar is old and does not contain the SingletonCacheProvider which are advised in exception messages + * [HHH-2217] - Collection write methods and dirtying the collection + +** New Feature + * [HHH-2205] - Dialect for Intersystems' Cache SQL 2007.1 + +** Patch + * [HHH-1767] - read-only cache for immutable collection causes unnecessary warning + +** Task + * [HHH-2219] - Upgrade to Javassist 3.4 + + +Changes in version 3.2.0.ga (16.10.2006) +----------------------------------------- +(retag of 3.2.0.ga (2006.10.16)) + +Changes in version 3.2.0.cr5 (04.10.2006) +------------------------------------------- + +** Bug + * [HHH-1668] - PersistentSet write methods mark collection as dirty even if entry is not written + * [HHH-1714] - Session.get() behavior + * [HHH-1891] - Since rc3 deprecation Warning: The syntax 'TYPE=storage_engine' is deprecated and will be removed in MySQL 5.2. + +** Improvement + * [HHH-2093] - PERSIST_ON_FLUSH ineffective for recursive object graphs + * [HHH-2103] - Rolling back 'SELECT is mandatory' on JPA strict compliance + +** Task + * [HHH-1931] - verify that the instrument tasks actually work + + +Changes in version 3.2.0.cr4 (24.08.2006) +------------------------------------------- + +** Bug + * [HHH-1293] - java.lang.NoSuchMethodError: <persistent class>.getHibernateLazyInitializer() + * [HHH-1677] - optimistic-lock="dirty|all" is ignored at delete time + * [HHH-1710] - persistent collections with property-ref to secondary tables cannot be joined in HQL + * [HHH-1713] - AbstractEntityPersister causes an exception when a row in a joined table is missing with fetch="select" + * [HHH-1740] - Build-time instrumentation breaks lazy="proxy" + * [HHH-1750] - Exception ORA-01000 too many open cursors by generated="insert" + * [HHH-1806] - No Dialect mapping for JDBC type: 3 + * [HHH-1848] - A session.lock generates a query with a version column in a joined subclass which does not exist + * [HHH-1892] - finish HHH-1789 for ordered and sorted collections + * [HHH-1898] - With hibernate 3.2.0-cr3 there is an hql parsing error on a one-to-one relation + * [HHH-1924] - ForeignKeys: TransientObjectException is thrown without a message because of a wrong bracket in the code + * [HHH-1927] - persist() and then merge() not handled correctly for multiple entity instances representing the same logical state + * [HHH-1937] - Proxy creation failure leads to NPEs + * [HHH-1943] - PersistenceContext not checked to see whether the associated entity is transient or not + * [HHH-1944] - generated subqueries and jpaql compliance (derived select clause) check + * [HHH-1947] - OF part of MEMBER OF is optional + * [HHH-1948] - Query Idetification variables are case insensitive in JPA + * [HHH-1949] - having trim(BOTH from c.name) translated into having ltrim(rtrim(BOTH)) on DB2 + * [HHH-1954] - Proxies are never unassociated (evicted) from a session + * [HHH-1958] - session.lock(LockMode.FORCE) can lead to NPE + * [HHH-1963] - meta inheritance broken + * [HHH-1992] - Some cascade actions should not trigger a property access on lazy properties + * [HHH-2001] - javaassist does not setup the proper protection domain thus does not work with signed/secured deployments such as webstart + * [HHH-2015] - where= does not set parenthesis leading to unexpected query when multiclause are used + * [HHH-2017] - locate function defined on Oracle9Dialect is incorrect + * [HHH-2022] - property names beginning with underscores cause Hibernate to generate invalid aliases + +** Improvement + * [HHH-1470] - Enhance Hibernate-Mapping DTD Definition of type element + * [HHH-1934] - logging NonUniqueObjectException and WrongClassException + * [HHH-1941] - Be more specific about x not found and invalid mapping exceptions to allow tools to tell about it + * [HHH-1968] - unify bytecode instrumentation + * [HHH-1980] - disallow the mapping combination of <version/> and optimistic-lock + * [HHH-2005] - more standard build script + * [HHH-2023] - performance optimization of JTATransactionFactory.isTransactionInProgress() + +** Patch + * [HHH-1271] - When using Stored Procedure for update or delete, the check is not done correctly. + +** Task + * [HHH-1931] - verify that the instrument tasks actually work + + +Changes in version 3.2 cr3 (06.07.2006) +------------------------------------------- + +** Bug + * [HHH-1452] - Native SQL query is missing join if entity includes many-to-one on secondary table + * [HHH-1507] - one-to-one can have formula or meta but not both of them. + * [HHH-1552] - Error when using ?1 and parameterList + * [HHH-1586] - ClassCastException in CollectionType.toLoggableString if using CustomCollectionType + * [HHH-1732] - EhCache.toMap still assumes Serializable objects + * [HHH-1734] - Connection leak when using hilo strategy in SE environment + * [HHH-1741] - Bug in reference documentation + * [HHH-1746] - NullPointerException at IdentNode.resolveAsNakedComponentPropertyRefLHS(IdentNode.java:195 + * [HHH-1748] - Setting a comment that contains a single quote on a query results in an unintuitive exception + * [HHH-1763] - Bug in InputStream org.hibernate.util.ConfigHelper.getResourceAsStream(String resource) + * [HHH-1791] - property update="false" ignored since 3.2.0.cr2 + * [HHH-1816] - serializing session from a named session factory to a different vm broken + * [HHH-1822] - flushing entity linked to transient instance (non cascaded) should always fail + * [HHH-1828] - registering a transaction marked for Rollback is illegal + * [HHH-1833] - Not Generating HibernateException + * [HHH-1838] - Wrong SQL generated for hql query on "any" relation + * [HHH-1855] - booleans not properly handled in assignment clause of UPDATE statements + * [HHH-1858] - wrong sql generated against many-to-any association table + * [HHH-1871] - query type autodiscovery assume wrong column when mixing entities and scalars + +** Deprecation + * [HHH-1792] - Callable update/insert/delete statements should not force rowcount out parameter + +** Improvement + * [HHH-1617] - Check the second-level cache before adding a PK to a batch fetch + * [HHH-1773] - Typo in ImprovedNamingStrategy + * [HHH-1779] - Allow Session.remove() on transient object + * [HHH-1789] - improve efficiency of collection initialization from L2 cache hits + * [HHH-1795] - default cache provider to NoCacheProvider + * [HHH-1796] - TreeCache based providers and Fqn + * [HHH-1800] - session.get() / load() should raise exception when the id is of the wrong type + * [HHH-1818] - remove() should force subsequent contains() calls to return false + * [HHH-1831] - Batch loading the same EntityKey (one side of manytoone ) more than once + * [HHH-1861] - More complete component handling in HQL + * [HHH-1881] - introduce LoggableUserType interface + +** New Feature + * [HHH-1709] - Be able to raise ENFE rather than LIE in proxies + * [HHH-1727] - Add a SQLFunctionRegistry + * [HHH-1817] - Introduce setting for JPA-QL strict compliance + * [HHH-1826] - Built-in type for char[] -> VARCHAR Byte[] and Character[] + +** Patch + * [HHH-1558] - Dialect for new database engine H2 + * [HHH-1847] - QBE 'like' clause with backslashes don't work with MySQL + +** Task + * [HHH-1839] - rename FlushMode.NEVER -> FlushMode.MANUAL + + +Changes in version 3.2 cr2 (05.05.2006) +------------------------------------------- + +** Bug + * [HHH-1114] - The first (HSQL) Hibernate Application doesn't work as expected due to lack of database shutdown + * [HHH-1175] - Exception when loading inheritance mapping in single file + * [HHH-1560] - PropertiesHelper.resolvePlaceHolders() fails with non-String values in System properties + * [HHH-1620] - Errors on max_lo <=1 boundaries + * [HHH-1625] - Hibernate.isPropertyInitialized() returns false on instrumented transient object + * [HHH-1648] - Exception while resuming a transaction is silently eaten + * [HHH-1674] - Configuration serialization error: filterDefinitions map not serializable + * [HHH-1695] - subsequent calls to non-existent proxy causes NPE + +** Improvement + * [HHH-1266] - StatelessSession can implement refresh + * [HHH-1414] - many-to-many and metadata order-by based on column from the target table + * [HHH-1477] - Improve naming strategy for ANN-195 + * [HHH-1538] - aggregations functions in EJBQL queries does not return the appropriate types + * [HHH-1670] - Update EhCache and EhCache provider to support EhCache 1.2 + * [HHH-1704] - Deduplicate unique constraints generation sharing the same column(s) + +** New Feature + * [HHH-870] - support SQL updates in named queries + * [HHH-1591] - Replace LazyInitializationException by EntityNotFoundException + * [HHH-1719] - Provide a ClassTransformer interface to the BytecodeProvider + + +Changes in version 3.2 cr1 (27.03.2006) +------------------------------------------- + +** Bug + * [HHH-1453] - Broken exception handling in NullableType + +** Improvement + * [HHH-227] - remove reflection optimizer + * [HHH-587] - Make ResultTransformer available for all query methods + * [HHH-1588] - delay inserts for insert-generated-identifiers outside transaction + * [HHH-1590] - redesign how PostInsertIdentifierGenerators are handled at insertion + * [HHH-1592] - allow SelectGenerator to use a defined natural-id (if one) + +** New Feature + * [HHH-332] - create ability to add resulttransformer to HQL query + * [HHH-1179] - support inline sequence id generation on Oracle using RETURNING clause + + +Changes in version 3.2 alpha2 (15.03.2006) +------------------------------------------- + +** Bug + * [HHH-535] - properties element causes exception in interface/abstract class + * [HHH-1325] - ArrayOutOfBounds expected in DatabaseMetadata.isTable when specifing schema + * [HHH-1435] - many-to-one lazy seems to be broken in 3.1.x + * [HHH-1531] - NPE with many-to-many and property-ref + * [HHH-1546] - generated version properties fail with multiple actions per flush + +** Improvement + * [HHH-1540] - Better Error Feedback In CollectionEntry.postFlush(PersistentCollection) + * [HHH-1555] - ConnectionReleaseMode.AFTER_STATEMENT and flushes + * [HHH-1559] - introduce TransactionFactory.isTransactionInProgress to facilitate EJB3 joinTransaction handling + + +Changes in version 3.2 alpha1 (28.02.2006) +------------------------------------------- + +** Bug + * [HHH-687] - Exception QuerySyntaxError not really serializable + * [HHH-1236] - Remove static reference to classloader, to avoid memory leak at webapp reload + * [HHH-1287] - Problem with WAS ExtendedJTATransaction not available when using MDB + * [HHH-1419] - Update + Exists doesn't seem to work + * [HHH-1445] - SchemaUpdate closes shared ConnectionProvider + * [HHH-1464] - QueryException from Query.getReturnAliases when query uses "fetch" + * [HHH-1486] - Concurrent access issues with both SoftLimitMRUCache and SimpleMRUCache + * [HHH-1508] - Session.createQuery() should not flush the session + +** Improvement + * [HHH-1411] - Collection fetches and DISTINCT + * [HHH-1412] - Collection fetches and firstResult/maxRows + * [HHH-1416] - LockMode.FORCE to implement EJB3 LockModeType.WRITE + * [HHH-1457] - support new optimisitc locking capabilities of JBossCache + * [HHH-1466] - better handling of Antlr exceptions + * [HHH-1516] - support DataDirect standard jdbc stored procedures + * [HHH-1518] - Guarentee LockMode behaviors + * [HHH-1520] - with clause with implied joins within an explicit join + * [HHH-1526] - Improved DTDEntityResolver + +** New Feature + * [HHH-1251] - Avoid replicating the clearing of TreeCache on SessionFactory..close() + * [HHH-1410] - FlushMode.AUTO -> COMMIT when outside a transaction + * [HHH-1447] - pluggable bytecode libraries + + +Changes in version 3.1.2 (27.01.2006) +------------------------------------------- + +** Bug + * [HHH-73] - Statistics for HQL queries use pre-processed query string + * [HHH-1306] - HQL parsing problem with join fetching of arrays/collections of values + * [HHH-1370] - Warning in hibernate-mapping-3.0.dtd + * [HHH-1371] - MappingException is thrown when the same column is referenced with different case + * [HHH-1386] - Numeric (long) literals not properly handled by HQL parser + * [HHH-1390] - Session.isOpen() throws exeception when the session is closed with ThreadLocalSessionContext + * [HHH-1391] - Invalid parameter index SQLException when using named parameters after positional parameters + * [HHH-1392] - Proxies cannot be serialized after session is closed + * [HHH-1398] - extends and entity-names broken with mapping-level package attribute + * [HHH-1407] - return-join broken for entity collections + +** Improvement + * [HHH-1364] - Defensive check of isClosed when obtaining a connection from ConnectionManager + * [HHH-1367] - warn level log "this operation breaks ==" may be disturbing + +** New Feature + * [HHH-1372] - Support for MySQL5 new varchar length + +** Patch + * [HHH-1005] - Criteria LEFT JOIN capability when adding Order to associations + +** Task + * [HHH-1373] - Document update versioned + + +Changes in version 3.1.1 (13.01.2006) +------------------------------------------- + +** Bug + * [HHH-853] - DML-style HQL queries and associations + * [HHH-1281] - FORWARD_ONLY ScrollableResults#next() throw GenericJDBCException + * [HHH-1286] - Set entity in HQL query without prefix -> incorrect SQL + * [HHH-1308] - Session.createFilter(...).iterate() results in bogus column names for result set extraction + * [HHH-1314] - float/double literals not sent to the database correctly + * [HHH-1316] - SchemaUpdate : java.sql.SQLException: You cannot commit during a managed transaction! + * [HHH-1328] - org.hibernate.util.SimpleMRUCache keeps a soft reference to the cache key, so cached values get collected prematurely + * [HHH-1336] - ForeignGenerator does not handle transient entities with an entity-name properly + * [HHH-1337] - Mapped <component> generated column names incorrect with ImprovedNamingStrategy + * [HHH-1349] - HQL delete statement problem due to oracle lacking table aliases in delete clause + * [HHH-1361] - creating temporary table for bulk delete will commit current transaction in managed environment such as J2EE + +** Improvement + * [HHH-1019] - Native SQL return-property mapping doesn't support dot-syntax in return-property for components + * [HHH-1290] - Defensive checking of session status + * [HHH-1302] - query.getReturnTypes inconsistent + * [HHH-1304] - better handling of borrowed connections in non-ON_CLOSE release semantics + * [HHH-1309] - schemaupdate does not handle TableHiLoGenerator + * [HHH-1339] - empty property name in mapping file gives imcomprehensible error message + * [HHH-1344] - ANSI-SQL trim function for SQLServer + * [HHH-1345] - ANSI-SQL mod function for SQLServer + * [HHH-1346] - ANSI-SQL bit_length function for SQLServer + * [HHH-1351] - <return-scalar name="blah"/> should be possible + * [HHH-1360] - set autodiscovery flag for SQLQueries when resultsetmappings are used + + +Changes in version 3.1 (12.12.2005) +------------------------------------------- + +** Bug + * [HHH-849] - Cartesian product + implicit joins + * [HHH-1065] - user provided connection not usable by default due to agressive release changes + * [HHH-1101] - associations join fetched in HQL without owner being selected + * [HHH-1133] - Comparators, defined for collections in mapping files, are not set + * [HHH-1149] - NPE flushing reattached entity w/ non-mutable natural-id + * [HHH-1170] - HQL 'cast' function doesn't work with MySQL 4 when casting to string + * [HHH-1187] - Cannot delete a object having a delete-orphan collection when user_rollback_id is set + * [HHH-1191] - HQL fails backward compatibility using classic translator + * [HHH-1194] - hql delete statements with joined-subclass hierarchies with a mapped where attribute at the root + * [HHH-1206] - Mappings.TableDescription is not serializable + * [HHH-1212] - mismatch in entity-modes defined in DTD and EntityMode class + * [HHH-1227] - ClassCastException on DOM4J replicate of Calendar property + * [HHH-1239] - BinaryArithmeticOperatorNode.getDataType() does not properly handle date/time arithmetic + * [HHH-1240] - Track connection leakage in JDBCContext.afterTransactionCompletion() + * [HHH-1245] - Calling the Session should register it with the current JTA txn. + * [HHH-1254] - Serialization of Sessions using JDBCTransactions with auto-flush/auto-close + +** New Feature + * [HHH-1222] - Autodiscover scalar types in native-sql + * [HHH-1243] - allow placeholders to system properties in config properties + * [HHH-1244] - Support for MySQL5 stored procedures + * [HHH-1260] - Configuration.mergeProperties() + +** Task + * [HHH-1066] - Upgrade CGLIB to fix proxy memory leak + * [HHH-1242] - upgrade ANTLR to 2.7.6rc1 + +** Improvement + * [HHH-860] - insert ... select ... and version numbers + * [HHH-926] - TypeDef should be global + * [HHH-1138] - No ConstraintName when using PostgreSQL + * [HHH-1144] - Implement naming convention for temporary test failures + * [HHH-1153] - PropertiesHelper fails reading primitive values from hibernate-mapping when doc has whitespace + * [HHH-1182] - Access to filter metadata + * [HHH-1183] - Getting sql "plan" for DML operations + * [HHH-1197] - Support for HQL delete on MaxDB + * [HHH-1198] - post-insert event pass the entity wo the id field filled when the generator is identity + * [HHH-1213] - make JACC event listeners auto configurable (through initialize(Configuration)) + * [HHH-1215] - Added support for LVARCHAR in InformixDialect + * [HHH-1218] - Add concat() function support to SAPDBDialect + * [HHH-1255] - ThreadLocalSessionContext and Session serialization + +** Patch + * [HHH-967] - executeUpdate on StatelessSession + * [HHH-1172] - Missing configuration templates for the new MimerSQLDialect + +** Deprecation + * [HHH-1229] - deprecate ability for entities to not define identifier properties + + +Changes in version 3.1 rc3 (17.11.2005) +------------------------------------------- + +** Bug + * [HHH-755] - Setter / Getter for property gDate are wrong + * [HHH-764] - XML mapping + * [HHH-1034] - The connection is closed *outside* the JTA transaction in TransactionHelper + * [HHH-1062] - java:comp/UserTransaction not correct for JBoss + * [HHH-1064] - Exception using JTATransaction in WebSphere 6 + * [HHH-1069] - Unnecessary commas generated in select with left outer joins + * [HHH-1075] - New parser "not exists" command bug + * [HHH-1077] - Typo in docs: "equiped" + * [HHH-1080] - HQL delete fails on entities with where-fragments using operators other than '=' + * [HHH-1081] - missing parens in example code for Criteria Associations + * [HHH-1084] - incorrect method name "sql" in Restrictions example, should be "sqlRestriction" + * [HHH-1091] - Can't write transparent CurrentSessionContext for BMT + * [HHH-1098] - Patch for build.sh to be able to build latest version on linux + * [HHH-1106] - HQL "not in" generatad wrong SQL + * [HHH-1111] - JDBCTransaction.rollback() results in a call to Interceptor.beforeTransactionCompletion() + * [HHH-1128] - Column alias clashes under certain circumstances + * [HHH-1146] - latest cvs(11/10/05) hibernate3 issue with classic query + * [HHH-1156] - StatefulPersistenceContext not serializable when property-ref is used + * [HHH-1160] - Incorrect use of getGeneratedKey() for Oracle + +** New Feature + * [HHH-449] - korean hibernate reference manual + * [HHH-1129] - use expected-type in 'untyped' Query.setParameter() + +** Improvement + * [HHH-221] - Proxy for one-to-one with property-ref + * [HHH-844] - move parameter "bookkeeping" into QueryTranslator + * [HHH-1051] - "Compiled" native SQL queries are not cached + * [HHH-1061] - import.sql should allow more human readable and usable files + * [HHH-1078] - <dynamic-component> requires type on property + * [HHH-1120] - Make NamingStrategy to work nicely with HA and EJB3 naming strategy + * [HHH-1142] - added getSelectSequenceNextValString() and getCurrentTimestampSelectString() to TimesTenDialect + +** Patch + * [HHH-1063] - support for 'locate' function in SQLServer and Sybase dialects + * [HHH-1090] - Allow subqueries on criteria to obtain non-string results + * [HHH-1095] - Hibernate takes incorrect HasCode when a lot of CompositeKeys and Lazy loading is involved + * [HHH-1103] - finalize method filter for proxies + * [HHH-1136] - more meaningful AssertionFailure message in org.hibernate.persister.entity.JoinedSubclassEntityPersister.getTableId(...) + + +Changes in version 3.1 rc2 (17.10.2005) +------------------------------------------- +** Bug + * [HHH-1045] - Example contains inner classes that aren't serializable + * [HHH-1055] - optimistic-lock is not inherited from class to subclass et.al. + +** Improvement + * [HHH-702] - auto detect aliasing for collection properties (coll.key, coll.id etc.) + * [HHH-1038] - make 'auto' the default for hibernate.connection.release_mode + * [HHH-1042] - determine "expected type" of parameters during HQL parsing + + +Changes in version 3.1 rc1 (07.10.2005) +------------------------------------------- +** Bug + * [HHH-528] - component.manyToOne.id in HQL causes join + * [HHH-871] - Configuration.setListener(String type, Object listener) throws ClassCastException + * [HHH-873] - referencing raw HQL FromElement alias outide the from clause of update and delete statements generates incorrect sql + * [HHH-876] - PreparedStatement being closed before being executed by AbstractBatcher + * [HHH-884] - SchemaExport does not propagate parent indexes to <union-subclass> tables + * [HHH-887] - Aggressive release and Session.connection() + * [HHH-893] - custom tuplizer are not instantiated for components + * [HHH-905] - $PlaceHolder$ remains in generated SQL when filter is enabled + * [HHH-907] - optimistic-lock="false" for timestamped object results in SQLException: Invalid column index + * [HHH-908] - CLONE -NullPointerException when using BigInteger in a query + * [HHH-911] - CGLIBLazyInitializer and Exceptions + * [HHH-913] - NPE in CMTTransaction since javax.transaction.Transaction is never set + * [HHH-918] - impossible to move objects to another session + * [HHH-924] - Useless OracleErrorCodeConverter (and possibly others) + * [HHH-932] - HQL UPDATE and <union-subclass> + * [HHH-946] - QuerySyntaxException might not be serializable + * [HHH-964] - ORA-00936 with joined subclass / Oracle + * [HHH-986] - Need to check Thread.currentThread().getContextClassLoader() in ConfigHelper + * [HHH-991] - Cannot use comparator class + * [HHH-1000] - varchar(xxx char) not supported on Oracle8i + +** New Feature + * [HHH-950] - interface for SessionFactory.getCurrentSession() handling + + +** Improvement + * [HHH-608] - update HSQLDialect for HSQL 1.8 sequence support + * [HHH-889] - Add read-only cache-mode comment in <query and <sql-query + * [HHH-898] - OracleDialect UTF8 varchar2 + * [HHH-909] - Onquoted primary key in IncrementGenerator + * [HHH-988] - generated="never|insert|always" + * [HHH-989] - add discussion of implicit and explcit joins + * [HHH-1011] - Make disconnect/reconnect of a Session implicit + +** Patch + * [HHH-994] - Sybase/SQLServer support for temporary tables + + +Changes in version 3.1 beta 3 (13.09.2005) +------------------------------------------- +** Bug + * [HHH-528] - component.manyToOne.id in HQL causes join + * [HHH-871] - Configuration.setListener(String type, Object listener) throws ClassCastException + * [HHH-873] - referencing raw HQL FromElement alias of update and delete statements + * [HHH-876] - PreparedStatement being closed before being executed by AbstractBatcher + * [HHH-884] - SchemaExport does not propagate parent indexes to <union-subclass> tables + * [HHH-887] - Aggressive release and Session.connection() + * [HHH-893] - custom tuplizer are not instantiated for components + * [HHH-905] - $PlaceHolder$ remains in generated SQL when filter is enabled + * [HHH-907] - optimistic-lock="false" for timestamped object results in SQLException: Invalid column index + * [HHH-908] - NullPointerException when using BigInteger in a query + * [HHH-911] - CGLIBLazyInitializer and Exceptions + * [HHH-913] - NPE in CMTTransaction since javax.transaction.Transaction is never set + * [HHH-918] - impossible to move objects to another session + * [HHH-924] - Removed ErrorCodeConverters + * [HHH-946] - QuerySyntaxException might not be serializable + +** Improvement + * [HHH-898] - OracleDialect UTF8 varchar2 + * [HHH-909] - Unquoted primary key in IncrementGenerator + + +Changes in version 3.1 beta 2 (16.08.2005) +------------------------------------------- +** Bug + * [HHH-477] - Boolean discriminators generate invalid SQL for PostgreSQL dialect + * [HHH-480] - SchemaExportTask ignores some properties not defined in hibernate.properties + * [HHH-615] - SchemaExport outputFile ignores ant's basedir + * [HHH-770] - hql query execution generates invalid SQL + * [HHH-779] - Assertion failure occured with Hibernate 3 saving objects + * [HHH-781] - SimpleExpression ignorecase regression + * [HHH-799] - merge() and embedded composite identifiers + * [HHH-801] - subselect fetch and named parameters + * [HHH-802] - querying "mapped" composite identifiers + * [HHH-803] - no version increment from delayed collection adds + * [HHH-805] - Session.getStatistics().getEntityCount() throws UnsupportedOperationException + * [HHH-819] - Firebird CONCAT SQL function + * [HHH-821] - query by natural-id cache is not update when object is inserted or deleted + * [HHH-822] - <key-property> will actually pick up <type> tags if it were allowed by the DTD + * [HHH-825] - ReadWrite-Cache issues NullPointerException after modification of an array + * [HHH-839] - Session.refresh not working for custom 'Load' SQL + * [HHH-849] - Cartesian product + implicit joins + * [HHH-854] - Class with mapped composite id can't have subclasses + * [HHH-858] - Autocommit status inconsistent in connections created by DriverManagerConnectionProvider + * [HHH-863] - Hibernate generates "notExists" instead of "not exists" + * [HHH-868] - Missing parens after / or - + +** New Feature + * [HHH-35] - add attribute haltonerror to schemaexport Ant task + * [HHH-182] - Mimer SQL Dialect for Hibernate 3 + * [HHH-704] - Statistics for optimistic lock failures + * [HHH-725] - Allow hooks into all executed sql by a session + * [HHH-783] - collection lazy="extra" + * [HHH-818] - Optimisitc locking using database current timestamp + * [HHH-828] - session.getTransaction() + * [HHH-829] - <cache include="all|non-lazy" ... /> + * [HHH-831] - allow database generated property values + * [HHH-832] - allow database generated property values for versioning + * [HHH-838] - Transaction.setTimeout() + * [HHH-840] - allow definition of "auxiliary" database objects in mapping + * [HHH-846] - Add Intializable interface for events + * [HHH-848] - Validate mappings against JDBC metadata + * [HHH-859] - post-commit events + +** Improvement + * [HHH-133] - schemaexport task: provide independent drop/create output + * [HHH-135] - parameterized types can't be used on key-property or ir (possible others) + * [HHH-552] - NoopAccessor for HQL-only properties + * [HHH-680] - Easier support for doing UserCollectionType's + * [HHH-686] - Final classes and classes with private null ctors cause unhelpful NullPointerException + * [HHH-754] - Allow HQL DML for implicit polymorphism + * [HHH-782] - Avoid unnecessary updates when component property is update='false' but modified + * [HHH-786] - Improve lazy options for <one-to-one> + * [HHH-791] - Use cascade styles when fetching entities in refresh() and merge() + * [HHH-815] - Confusing use of the term "dereference" + * [HHH-830] - Improvements to caching lazy properties + +** Patch + * [HHH-378] - Better LockMode.UPGRADE for DB2 UDB v8.2 + * [HHH-430] - Improved SizeExpression with greater, lesser, not equals, etc. capabilities + * [HHH-735] - SchemaUpdate reads table metadata from wrong schema + * [HHH-780] - org.hibernate.proxy.BasicLazyInitializer reflection hotspot + * [HHH-864] - Use QUERY_CACHE for sessions with filters to improve performance + + +Changes in version 3.1 beta 1 (21.07.2005) +------------------------------------------- + +** Bug + * [HHH-145] - union-subclass and oracle 8i + * [HHH-374] - EJB3 example delete query doesn't work in Hibernate. + * [HHH-447] - EHCache integration prevents multiple session factories + * [HHH-488] - JACCListeners are not working at all + * [HHH-564] - missing commas for implicit joins + * [HHH-577] - joins within subqueries on dbs supporting ansi-joins result in extraneous commas + * [HHH-592] - cast() function doesn't know its returned Hibernate type + * [HHH-639] - CGLIB instrumentation of subclasses + * [HHH-658] - Bug in Alias Name Generation + * [HHH-671] - Firebird support of sequences/generators + * [HHH-679] - setLockMode(LockMode.UPGRADE_NOWAIT) does not translate to correct SQL on Oracle + * [HHH-688] - Bad implementation in org.hibernate.type.CustomType.stringToObject + * [HHH-691] - generated column alias is incorrect if there is a prior relationship and the table column names are similar to the table name + * [HHH-694] - NPE when accessing the SLCache stats with TreeCache + * [HHH-698] - Exception on EG , trying to change immutable id (natural-id) + * [HHH-699] - Incorrect Tablename genetaion when using MySQL Dialect and no Schema definition + * [HHH-708] - Restrictions.in could not be used properly on composite-ids + * [HHH-709] - ArrayType.replaceElements fails if original.length != target.length + * [HHH-718] - HQL "fetch all properties" not working for column level lazy props + * [HHH-726] - ConstraintViolationException with primitive collection + * [HHH-727] - java.lang.StackOverflowError when cascade="true" on both sides of bidirectional one-to-one association using FK + * [HHH-734] - HQL incorrectly parses certain query strings + * [HHH-736] - Use of sql functions containing space not supported in filter conditions + * [HHH-738] - formula property with select-before-update + * [HHH-747] - Order.toSQLString generates incorrect statement + * [HHH-748] - component dereferencing in subquery from clauses + * [HHH-752] - Typo in 8.5.3 bidirectional one-to-one jjoin table example + * [HHH-757] - NullPointerException when using BigInteger in a query + +** New Feature + * [HHH-595] - HQL insert select + * [HHH-597] - Named XML resultsetmappings + * [HHH-696] - handle discriminators on HQL insert + * [HHH-697] - allow bumping versions in HQL update + * [HHH-716] - handle version columns in bulk inserts + * [HHH-723] - Need to be able to pass in javax.sql.DataSource in SF creation + * [HHH-739] - Order.ignoreCase() + * [HHH-741] - select clause subselects + * [HHH-742] - Stateless session + * [HHH-744] - collection fetching in scroll() via "break processing" + * [HHH-768] - <many-to-many property-ref=".."/> + +** Improvement + * [HHH-14] - Add Session.delete(String entityName, Object entity) + * [HHH-295] - cleanup and expose the Tuplizers + * [HHH-352] - HQL bulk and cache + * [HHH-689] - exclude parens for components outside where-clause + * [HHH-743] - {coll.key}, {coll.index}, {coll.element}, etc + * [HHH-745] - EJB3 composite PK style + * [HHH-749] - Cascade merge() and unidirectional one-to-many + * [HHH-750] - use attribute name other than 'type' in dynamic-maps + * [HHH-753] - Replace antlr System.exit with QueryException + * [HHH-769] - property-ref="foo.bar" to a component property + * [HHH-772] - null in maps are handled inconsistently + * [TODO-18] - optimistic-lock="all|dirty" with components + + +Changes in version 3.1 alpha 1 (24.06.2005) +------------------------------------ +** Bug + * [HHH-204] - Wrong/uncommon log name in class ...hql ast ErrorCounter + * [HHH-241] - HQL lexer doesn't support unicode quoted strings + * [HHH-354] - property named "full" breaks HQL queries + * [HHH-493] - WARNING: Keyword 'member' is being intepreted as an ident + * [HHH-538] - length() function does not work in SQLServerDialect + * [HHH-539] - ClassCastException on mapping a property with a formula in a set of composite elements + * [HHH-540] - Mapping a one-to-many collection with a non-null foreign key within a component fails on save + * [HHH-547] - Cannot commit using UserCollectionType and debug logging + * [HHH-548] - many-to-many faulty delete optimization when filter in use + * [HHH-554] - Hibernate 3 HQL to SQL FROM Clause Comma Generation Problem + * [HHH-558] - HQL doesn't support multi-byte character in class name and property names + * [HHH-559] - quoted multi-byte character in HQL is translated into weird character in SQL. + * [HHH-565] - delete-orphan generating AssertionFailure + * [HHH-566] - The result is not correct in 'createQuery("select new Foor(x,x) from Foo").scroll()' + * [HHH-570] - size operator fails on a many to many in HQL + * [HHH-571] - JDK 1.3 Compatibility Issue + * [HHH-573] - error when merging entity graph has cascade level>2 + * [HHH-575] - org.hibernate.cache.FilterKey is not Serializable + * [HHH-589] - parameterized expression inside function + * [HHH-594] - order-by mapping for collections overrides order by in HQL + * [HHH-601] - New temporary table feature assumes all persisters are ready + * [HHH-614] - SchemaUpdate broken in DB2/400 + * [HHH-622] - Spelling mistake 'intepreted' in org.hibernate.hql.PARSER warning + * [HHH-642] - criterias with projection + * [HHH-650] - FilterImpl is Serializable yet FilterDefinition is not + * [HHH-657] - Date parse exception using EntityMode.DOM4J + * [HHH-666] - JTAHelper.isInProgress( txn.getStatus()) throws NPE when txn null + +** New Feature + * [HHH-620] - Extra join conditions in HQL + * [HHH-640] - short-circuit dirty checking for instrumented classes + * [HHH-643] - support mutable="false" for collections + * [HHH-645] - Session.setReadOnly() + * [HHH-549] - portable to_char() function + * [HHH-576] - Hook to pre-process generated select strings in the Dialect + * [HHH-662] - Add support for definition of functional composite key ("properties") in joined subclass + +** Improvement + * [HHH-46] - Allow access to properties that are not joined + * [HHH-261] - Stored procedure support for SQLServer dialects + * [HHH-351] - multi-table bulk operations + * [HHH-574] - improve in naming named-query + * [HHH-596] - Auto-detect {..} in native SQL queries + * [HHH-641] - create constraints for many-to-one property-ref + * [HHH-501] - warn when a final method is tried to be proxied + * [HHH-525] - cglib related startup performance + * [HHH-557] - Helpful error message for non Serializable classes with a composite-id + * [HHH-586] - check immutable natural-ids + * [HHH-609] - Adds substr to PostgreSQL dialect + * [HHH-618] - documentation bugs + +** Patch + * [HHH-224] - JDataStore Dialect and updated Testfiles + * [HHH-366] - InformixDialect SQLExceptionConverter + * [HHH-536] - ImprovedNamingStrategy modifies capitalized column names inappropriately + * [HHH-632] - Informix Dialect missing from automatic dialect discovery + * [HHH-4] - CachedFile bugfix + configuration + autodetect resource as file + + +Changes in version 3.0.5 (25.5.2005) +------------------------------------ + +** Bug + * [HHH-516] - Interceptor.onFlushDirty() sometimes not called + * [HHH-517] - getDatabaseMajorVersion() not available in JDK 1.3 + * [HHH-518] - SQL parser does not recognize all whitespace + * [HHH-519] - broken SQL when traversing many-to-many to joined <subselect> + * [HHH-529] - Bug in merge() + +** New Feature + * added <natural-id> mapping + * [HHH-533] - allow unique-key on <property> and <many-to-one> + * [HHH-534] - efficient cache by natural key + * support for <comment> on MySQL + +** Improvement + * [HHH-526] - log "Aggressively releasing JDBC Connection" as DEBUG instead of INFO + * various logging improvements + + +Changes in version 3.0.4 (23.5.2005) +------------------------------------ + +** Bug + * [HHH-452] - UnsavedValueFactory.instantiate does not wrap the Exception it catches + * [HHH-456] - Session still holds references to entities after close() + * [HHH-457] - Log info for structured second-level cache entries is incorrect + * [HHH-466] - Made default for MS SQL dialect definition more flexible + * [HHH-473] - Formula can't contain SQL cast keyword + * [HHH-484] - Order-by not applied to collections fetched by OuterJoinLoader + * [HHH-487] - Possible empty union in UnionSubclassEntityPersister + * [HHH-505] - Possible NullPointerException in BigIntegerType + * [HHH-507] - Cached List does not show additions + * Fixed bugs in subselect fetching + +** New Feature + * [HHH-455] - Obtain non-intercepted Session by passing an EmptyInterceptor + * [HHH-467] - HQL: support for case when then else end IN select clause + * [HHH-485] - Support multiple collection join fetches (attention: Cartesian product) in native SQL queries + * Added SessionStatistics metric interface + * Added support for table and column level <comment> blocks + * Added Simplified Chinese translation of reference documentation (Xiaogang Cao) + +** Improvement + * Any query may now join fetch >1 collection role (attention: Cartesian product) + * [HHH-454] - Add 2292 integrityViolationCode to Oracle9Dialect + * [HHH-503] - Implemented ViolatedConstraintNameExtracter for HSQLDialect (Frank Grimes) + + +Changes in version 3.0.3 (8.5.2005) +----------------------------------- +* fixed bug in HQL for composite key classes which have a property named the same as the owning entity's id property +* replaced 'connection.aggressive_release' with 'hibernate.connection.release_mode' +* added ConnectionReleaseMode +* added eager fetch for any associations with fetch=join, even after a HQL query, or cache retrieval (EJB3) +* added replicate() isUpdate flag to OnReplicateVisitor, useful for native ids +* fixed ParameterizedTypes order of initialization +* fixed bug in DB2Dialect +* fixed EntityMode.DOM4J creation of duplicate <set> output +* fixed JDBCException error code handling +* fixed Criteria Restrictions.isEmpty()/isNotEmpty() when collection is mapped to superclass +* fixed HQL indexed collections access with no alias +* fixed HQL aggregate functions on components when "id" property is used +* fixed issue with non-cascading refresh to collections +* fixed query-timeout not being applied to bulk HQL (Stephan Fudeus) +* fixed pessimistic locking with Firebird (Yuichi Sugimura) +* updated Ant 1.6.3 +* improved validation of sql queries, throw QueryException if addEntity() nor addScalar() was called +* added automatic dialect detection if no dialect is configured +* added new tutorial (Michael Gloegl, Christian Bauer) + + +Changes in version 3.0.2 (27.4.2005) +------------------------------------ +* fixed union operations on PostgreSQL +* fixed HQL concat() function for Oracle dialect +* fixed auto-close/auto-flush during getCurrentSession() processing +* fixed ClassCastException with EntityMode.DOM4J +* fixed HQL dynamic instantiation with iterate() +* fixed HQL bug with missing parantheses and implicit joins +* fixed bug were Interceptor.getEntity() wasn't called if in cache +* fixed bug in merge() of sorted sets +* fixed bug in EntityMode.DOM4J with non-lazy embedded many-to-ones +* fixed Criteria/Projection ordering bug +* fixed HQL referencing component attribute +* fixed column duplication detection for components +* fixed eager fetching for many-to-many associations +* fixed stack overflow with auto_close_session and aggressive_release and unclosed ScrollableResults/HibernateIterator +* fixed bug in HQL parser regarding naked property refs which reference component properties +* fixed bug with eager fetched arrays not being loaded +* fixed bug in filter against joined-subclass +* improved CacheMode.GET/IGNORE, disabled cache put +* improved HQL support for standard SQL functions, including coalesce() and nullif() +* improved filtering of many-to-many associations +* added HQL support for cast(x as type) if SQL database supports it +* added increment id generation for union-subclass +* added ConnectionProvider.supportsAggressiveRelease() for managed environments +* added support for caching of queries if filter is enabled +* added PreparedStatement count to Statistics +* added transactional/nontransactional read()/get() to Cache API +* added quotation of schema names +* added Distinct to Projection API +* added config parameter 'connection.aggressive_release' + +Changes in version 3.0.1 (18.4.2005) +------------------------------------ +* added HQL tuple constructor/comparison feature +* added HQL "fetch all properties" override if instrumentation is used for lazy loading +* added HQL projection feature, return Lists instead of arrays for projection +* added HQL projection feature, return Maps with user-defined HQL SELECT aliases as keys +* added HQL support for expressions in aggregation functions +* added new IntegrityViolationException to MySQL dialect +* added value mapping type 'big_integer' +* added not-found="ignore|exception" switch for legacy associations (i.e. broken database integrity) +* added fully automatic Session scoping in JTA environments with sf.getCurrentSession() +* fixed bug in DTD that wouldn't allow union-subclass in separate file +* fixed a MS SQL Server case sensitivity issue with native SQL queries +* fixed a minor bug in subselect fetching +* fixed case sensitivity in HQL functions +* fixed a bug with listener assignment for save() operation (Matthew Inger) +* fixed return-property in named SQL queries to work with all identifier names +* fixed TransactionManager lookup (again) for WAS 6.0 +* fixed a bug with HQL batch delete and MS SQL Server +* fixed session not getting closed with auto_close when rollback occured +* improved concatentation handling in AST parser +* updated dom4j to avoid memory leak in old version +* updated C3P0 + + +Changes in version 3.0 (31.3.2005) +---------------------------------- +* added support for autoflush/autoclose to HibernateServiceMBean +* fixed initialization/session association detection problem of collections +* fixed creation of FK constraints to union superclass table +* fixed bug where union-subclass table did not get a PK constraint +* added a separate log category for HQL parser warnings and errors +* fixed bulk delete operation on MS SQL Server +* added support for proxying protected methods (Juozas) +* added support for unicode quoted strings in new HQL parser +* fixed implied joins in subselect WHERE clause in new HQL parser +* added SQLServer7Dialect to handle differences in functions +* added support for JNDI-bound cache instances, future use for JBoss Cache +* added scale attribute to column mappings for numeric precision control +* added fetch=subselect for collections +* added support for bulk update/delete against discriminator-based inheritence hierarchies +* added the ability to use naked property refs in HQL (required in update/delete statements) +* updated CGLIB 2.1.0 +* fixed NPE at BasicEntityPersister.getPropertyIndex (Todd Nine) +* fixed issue with entity-name and subclasses (Sverker Abrahamsson) +* fixed issue with correlated subqueries in new HQL parser +* fixed a problem with native SQL query mapping and embedded composite identifiers +* improved mapping binding, allowing unordered extends for pure entity-name hiearchies +* fixed NPE for delete() with deprecated Lifecycle interface +* fixed a problem with serial joins ending in component value in new HQL parser +* fixed inner join/subselect precedence problem in new HQL parser +* fixed indices() function in new HQL parser +* fixed a bug in InformixDialect, now correct LIMIT clause +* fixed a bug in idbag.remove() (Sebastien Cesbron) +* fixed a conflict on OracleDialect between setMaxResult and LockMode.UPGRADE +* fixed XML configuration file issue with SchemaExport +* fixed an ArrayIndexOutOfBounds problem +* renamed executeUpate() to executeUpdate() +* fixed batch loading for property-ref entities +* fixed loading from cache of <key property-ref> collection owner +* fixed minor bug in SQL exception reporting +* fixed dynamic-component cannot be bound to XML +* fixed querying component with formula property +* fixed incorrect table alias for order-by on many-to-many +* fixed a bug for unidirectional one-to-many with moving child objects +* fixed a bug with union-subclasses and persister creation +* fixed a HQL concatenation problem on MySQL +* fixed a bug where an unnecessary exception was thrown for a property-ref to a superclass property +* fixed minor dtd bug +* fixed new bug in Clob/Blob support +* fixed issue with INDEX_OP and subclass joins on theta-join dialects +* fixed some minor issues in query cache regions, including HB-1449 +* fixed superflous import and regression bug in verifyparameters +* fixed two bugs in select id generator (Malcolm Green) +* fixed increment generator for union-subclass mappings +* updated JBoss Cache to 1.2.1alpha, fixing locking issues +* made stat classes serializable +* fixed merge(), now ignores blob and clob fields +* added support/dialect for TimesTen +* improved algorithm for batch fetching, more aggressive +* improved toStrings()s for Statistics objects (Ryan Lynch) +* renamed <result-*> to <return-*> for externalized SQL query mapping +* renamed Session.openSession() for EntityMode to Session.getSession() +* added support for CASE in HQL +* fixed bug with filters and polymorphic queries +* fixed import ordering problem of super/subclass mappings +* switched to patched ANTLR 2.7.5, now using context classloader before doing class.forname +* TableHiloGenerator now falls back to TableGenerator properly with max_lo < 2 (Emmanuel Bernard) +* better transaction handling of TableGenerator in a JTA environment (Emmanuel Bernard) +* removed hard coded log4j dependency (Emmanuel Bernard) +* added support for stored procedure in named queries (Max Andersen) +* added <property-result> to named SQL queries to allow users to use sql without {}-markup +* added multi-column property support to native SQL mapping + +Changes in version 3.0rc1 (28.2.2005) +---------------------------------- +* introduced EntityModes, and XML mapping preview +* several minor dialect improvements +* fixed a problem where filters were not applied to subclasses +* fixed a problem where InstrumentTask would fail if applied to already-instrumented classes +* fixed many problems with new parser and made it the default (thanks again to Joshua for the new parser) +* implemented bulk update/delete queries for the new parser +* fixed a minor bug in the classic query parser +* renamed create() to persist() as per EJB3edr2 + +Changes in version 3.0 beta 4 (11.2.2005) +----------------------------------------- +* support unidirection one-to-many with a not-null foreign key +* support formulas for index and element of collections +* support one-to-ones mapped to formulas +* fixed a bug in proxying methods that return "this" +* optimized proxies for embededded composite id classes +* fixed a bug affecting <key-many-to-one> +* fixed a bug caching newly inserted objects +* introduced DetachedCriteria +* support subselects in Criteria queries +* miscellaneous Criteria API enhancements +* fixed a problem where hibernate.max_fetch_depth applied to eager fetching via setFetchMode() +* use inner joins for join fetching not-null fk associations +* support unique="true" in <component> and <properties> mappings +* union-subclass hierarchies may own collections (dtd bug) +* added guid support for Oracle +* new mechanism for auto-detecting unsaved-value +* pass state array in delete events +* improved implementation of hibernate.auto_close_session and hibernate.close_before_completion +* fixed a bug where components with only collections would be incorrectly nullified +* fixed a bug where criteria queries with projection could not be cached +* fixed a problem where duplicate column name aliases could be generated + +Changes in version 3.0 beta 3 (30.1.2005) +------------------------------------------ +* Major rework of Criteria queries, support for projection, grouping, aggregation, ordering by any attribute +* various improvements to new HQL parser (Joshua Davis) +* fixed a bug where <join fetch="select"> was broken for subclasses with duplicated property names +* fixed problems with long types in Oracle DDL generation +* added EnhancedUserType, UserCollectionType, UserVersionType +* added CacheMode +* fixed minor performance problem where cascade delete could add objects to second-level cache +* added hibernate.default_batch_fetch_size +* added hibernate.cache.use_structured_entries +* different classes and collection roles may now share a cache region +* don't include discriminators for abstract classes in generated SQL +* it is no longer truly necessary for composite identifier classes to implement equals()/hashCode() (but still recommended) +* workaround for bug in MySQL InnoDB with self-referential foreign keys +* added lazy="true" to many-to-one and one-to-one mappings (requires bytecode instrumentation) + +Changes in version 3.0 beta 2 (24.1.2005) +------------------------------------------ +* added LockAcquisitionErrorCodes to MySQL dialect (Jesse Barnum, Emmanuel Bernard) +* added MultipleHiLoPerTableGenerator, one hi value per row/per table (compliant with EJB3) +* added a generator handling multiple hi values per table (Emmanuel Bernard) +* added events for pre/post SQL operation interception +* added experimental support for JACC-aware configuration and events +* added full support for implicit polymorphism in Criteria queries +* added support annotated classes through XML configuration (Emmanuel Bernard) +* added support for WebSphere's weird TxManagerLookup +* added support for filters with dynamic-class mappings +* added support for lists of parameters in filters +* added support for scalar queries in createSQLQuery (Michael Gloegl) +* added support for scalar results in native SQL queries (Michael Gloegl) +* fixed SchemaExport/SchemaUpdate, now respect default_schema and default_catalog (Michael Gloegl) +* fixed a bug in one-to-one mapping with property-ref +* fixed a bug in the query cache lookup routine +* fixed compilation problems on IBM JDK 1.4. and JDK 1.3.1 +* fixed custom SQL for loading when using composite identifiers +* fixed exception thrown from optimistic locking failures +* fixed support for limit queries (select first ?) in Informix +* improved SchemaExport/Update, now respect default_schema and default_catalog +* improved dialect handling, throw an exception if no dialect has been set +* improved loading of mappings, no ordering of super/subclasses required anymore +* improved statistics for second-level cache +* improved table generators for hi/lo, can now be used in a JTA environment (Emmanuel Bernard) +* query engine: added support for 'trim([leading | trailing | both] [expression from] expression)' +* query engine: added support for DISTINCT and ALL +* query engine: added support for FETCH +* query engine: added support for HAVING count() +* query engine: added support for HQL NOT IN and EJBQL '[NOT] MEMBER OF' +* query engine: added support for ORDER BY COUNT(*) +* query engine: added support for collections of scalar values +* query engine: added support for literals in constructor select expressions. +* query engine: added support for select elements(..) from Foo f +* query engine: added support for template functions in the SELECT clause +* query engine: fixed NOT LIKE +* query engine: introduced EMPTY and added it to constant (support for IS [NOT] EMPTY) +* updated dom4j, OSCache, EHCache, JBoss Cache, Xerces, Xalan, and Log4j +* associated class where filter now applies to <one-to-one property-ref> + +Changes in version 3.0 beta 1 (21.12.2004) +------------------------------------------ +* reimplemented HQL using an ANTLR-based AST parser (Joshua Davis) +* added class="select" id generator +* added Query.setReadOnly() +* added hibernate.order_updates +* introduced cascade refresh +* added typed JDBC exceptions (Steve Ebersole) +* improved lifecycle for CacheProviders (Steve Ebersole) +* added Expression.isEmpty() +* fixed some minor mapping DTD bugs (Ben Sommerville) +* fixed auto-commit mode for SchemaUpdate +* added default-lazy to <hibernate-mapping>, which defaults to true! +* added fetch="join|select" and deprecated outer-join attribute +* fixed a bug where <custom-insert> was not used for entities with "identity" id generation +* fixed some problems with dynamic-class +* added property-level optimistic-lock attribute, to allow an unchecked property +* cascade lock() now cascades with LockMode.NONE +* fixed some bugs in filter handling (Steve Ebersole) +* added hibernate.transaction.flush_before_completion and hibernate.transaction.auto_flush_session +* added JSR-220 compliant create() and merge() operations +* cascade attribute is now multi-valued, with values save-update,create,merge,delete,delete-orphan,lock,evict,replicate,all-delete-orphan +* index and unique-key attributes may now be multi-valued +* introduced unsaved-value="undefined", the default for "assigned" ids and <composite-id>, which forces Hibernate to hit the db +* primitive typed <id> property mappings now default to unsaved-value="0" +* added ScrollMode +* added dialect for Derby (Simon Johnston) +* added MySQLMyISAMDialect and MySQLInnoDBDialect +* added precision and scale mapping attributes, for numeric types in DDL +* fixed a problem with duplicate column mappings on Sybase +* read-write cache now uses version numbers to ensure consistency with database, if available +* native SQL queries may now fetch a collection role (Steve Ebersole) +* added sequential-select, optional and inverse attributes to <join/> +* added <properties> element, which can be the target of a property-ref +* fixed a bug relating to composite property-refs +* Hibernate now much more robust if user does not implement equals()/hashCode() on id and unique key classes +* enabled batch deletes for versioned data +* fixed a minor bug in Session.close() +* removed uuid.string and renamed uuid.hex to plain uuid +* workaround for a MySQL bug in SchemaUpdate +* added JDBCException.getSQL() and made various improvements to exception flow +* createSQLQuery() now fully supports components +* fixed a bug in SQL generation for <joined-subclass> mappings +* fixed a bug where filter and query parameters could be bound in the wrong order (Steve Ebersole) +* fixed a problem where quantifiers could not appear in SQL fragments +* fixed a bug with dynamic components +* fixed a bug where Dialect default properties overrode user-specified properties (Ben Sommerville) +* fixed a bug where duplicate column name in a joined table caused an exception +* implemented two-phase load for dynamic components +* fixed a bug where cancelQuery() canceled a re-pooled statement +* deleted collections are now removed from session-level cache +* fixed a bug in LocaleType (Steve Ebersole) +* use "with rr" to obtain UPGRADE locks in DB2 +* package attribute now significant for extends +* fixed a minor problem with Hibernate Clobs and Blobs +* extends attribute does no longer require specific ordering of mapping files + +Changes in version 3.0 alpha (23.8.2004) +---------------------------------------- +* package rename net.sf.hibernate -> org.hibernate +* checked exceptions are now runtime exceptions +* some session methods deprecated and moved to org.hibernate.classic.Session +* removed various deprecated functionality +* added Filter API and mappings, for temporal, regional and permissioned data (Steve Ebersole, Gavin King) +* support cascade delete via ON DELETE CASCADE constraint +* added extra attributes to named query definition +* added hibernate.use_identifier_rollback +* added subselect mappings +* added lazy="true" to property mappings +* added <join/> for multitable mappings +* added <union-subclass/> for table-per-concrete-class strategy +* added Statistics API and JMX MBean (Gavin King, Emmanuel Bernard) +* introduced new event-driven design (Steve Ebersole) +* support for faster startup with Configuration.addCachableFile() (Joris Verschoor, Max Andersen) +* mask connection password for log level greater of equals to info (Joris Verschoor, Emmanuel Bernard) +* add check of named queries when building SessionFactory (Joris Verschoor, Emmanuel Bernard) +* added custom EntityResolver setting capability (Emmanuel Ligne, Emmanuel Bernard) +* PropertyValueException for null values in not-null properties of components (Emmanuel Bernard) +* enhanced support for single- and no-argument sql-functions in HQL select clause (Michael Gloegl) +* Added catalog element, to enable table names like catalog.schema.table (Michael Gloegl) +* Added <sql-insert>, <sql-update> and <sql-delete> support (Max Andersen) +* Support callable statements (stored procedures/functions) via callable="true" on custom sql (Max Andersen) +* Added support for type parameters and typedefs (Michael Gloegl) +* Added support for JDBC escape sequences in createSQLQuery (Max Andersen) +* Added statistics per SessionFactory (Gavin King, Emmanuel Bernard) +* Added a StatisticsService MBean for JMX publucation (Emmanuel Bernard) +* support for updates via rownum in Oracle +* fixed problems with SchemaUpdate +* support for <column formula="..."/> +* added hibernate.use_sql_comments +* added property-ref to collection <key/> +* fixed performance problems with <one-to-one property-ref=.../> +* enhanced UserType with new methods assemble()/disassemble() +* better algorithm for batch fetch batch sizes +* added <dynamic-class> +* added entity-name concept, and session methods save(entityName, object), update(entityName, object), etc +* added framework in proxy package +* native SQL queries may now fetch a collection role +* added <loader/> for class and collection mappings +* added getEntity() and getEntityName() to Interceptor +* formula-based discriminators and association mappings +* added "guid" id generation strategy +* various improvements to dialects +* <discriminator force="true"/> now acts as a filter on collections +* where filters now apply in the on clause in an outer join +* added hibernate.jdbc.factory_class to select a custom batcher +* session now uses entity name + id to enforce uniqueness, instead of table name + id + +Changes in version 2.1.6 (9.8.2004) +------------------------------------ +* fixed Quickstart/readme.txt instructions +* fixed DB2/400 identity column support +* fixed the scroll() query method +* fixed exotic classloader problems with CGLIB +* added insert="false" for discriminator columns which are part of a composite identifier +* added several new configuration settings to JMX HibernateService +* added new instantiate() method to SessionFactory.getClassMetadata() +* improved the HSQL DB dialect with features from new version +* added hibernate.jdbc.batch_versioned_data (Steve Ebersole) + +Changes in version 2.1.4 (2.6.2004) +------------------------------------ +* improved Session serialization support by adding ability to serialize unflushed sessions (Steve Ebersole) +* fixed Session.clear() functionality to clear the internal nonExists cache (Steve Ebersole) +* much better implementation of scroll() (Steve Ebersole) +* support "select new ..." for iterate() and scroll() (Steve Ebersole) +* added support for multi-parameter SQL functions (Steve Ebersole) +* fixed hbm2ddl generating infinite indexes on MySQL (Michael Gloegl) +* fixed alias precedence in HQL queries, function names are second (Steve Ebersole) +* added "transactional" as allowed cache concurrency strategy in XML configuration file +* improved System.getProperties() with security exception warning in secure environments +* improved Proxool integration, better property handling +* fixed problem with use of getDefinedMethod() in secure environments (Ken Arnold) +* fixed bug in createSQLQuery() which prohibited multiple aliases for the same entity (Max Andersen) +* fixed query cache misses when using named bind parameters (Michael Greer) +* recognize "left" and "right as keywords in SQL fragments +* recognize SQL quoted identifiers in SQL fragments +* improved identity handling on SQL Server by using scope_identity() for update counts (Arthur Fitt) +* added DB2390Dialect for DB2/390 databases (Kristoffer Dyrkorn) +* fixed a bug in toArray() of identifier bag collections (Khachchou Mohammed) +* fixed a problem with DDL generation for serial columns in Informix +* fixed a problem with DDL generation for timestamp columns in Informix (Michael Schmidt) +* fixed a NPE that occurred calling saveOrUpdateCopy() for components +* fixed a bug with replicate() and uninitialized collections +* fixed a bug caching one-to-one associations +* fixed eviction from named query cache regions + +Changes in version 2.1.3 (25.4.2004) +----------------------------------- +* added SELECT-clause SQL function support to main Dialects +* fixed a problem where some unnecessary selects where issued for optional one-to-one associations +* fixed a bug in SQL generation for criteria queries with multiple one-to-many joins +* deprecated everything related to PersistentEnum +* fixed an NPE that occurred when using <one-to-one property-ref> with composite ids +* fixed a problem with JCA adaptor on WebLogic (Michael Gloegl) +* improved behavior when removing elements from <idbag>s +* fixed a bug in getGeneratedKeys() support (Michael Gloegl, Kevin Day) +* fixed a bug when using Criteria queries with collections of joined-subclasses +* fixed an NPE that occurred when calling comparator() on a lazy sorted set (Attila Szegedi) +* fixed a bug when using setMaxResults() with native SQL queries in some Dialects +* validate that composite id classes override hashCode() (Adrien) +* fixed some minor problems with saveOrUpdateCopy() +* fixed some problems in OSCache provider +* fixed an NPE that occurred when calling a lazy collection after evicting from session +* fixed an NPE that occurred when select-before-update is used with unversioned data (Patrick Peralta) +* fixed a bug where dynamic-components could not be queried (Massimo Ferrari) +* SQL formula parser now recognizes all Dialect-specific SQL functions (Anthony Patricio) +* fixed a problem where SQL CASE statements could not appear in SQL formulas +* fixed a problem where subselects with joins could not appear in SQL formulas +* C3P0 and Proxool pools now cleaned up after SessionFactory.close() +* fixed a bug where dirty checking of mutable properties was broken after lock() +* fixed a minor bug where orphan delete was broken for newly saved instances +* added Query.setFetchSize() and Criteria.setFetchSize() +* PreparedStatement pooling in DBCPConnectionProvider can now be disabled (Emmanuel Bernard) +* Query.setProperties(Object) now detects array and collection valued properties and delegates to Query.setParameterList() (Max Andersen, Nick Heudecker) +* lengths of positional parameters and types arrays are now validated +* fixed an obscure problem where a PreparedStatement was not closed + +Changes in version 2.1.2 (4.2.2004) +----------------------------------- +* added Session.isDirty() +* fixed a very obscure concurrency problem with read-write cache for inverse collections +* deprecated Criteria.returnMaps() / Criteria.returnRootEntities() in favor of new ResultTransformer framework +* don't cache objects with dynamic-update="true" or <joined-subclass> mappings immediately after insert/update +* added version checking to saveOrUpdateCopy() +* fixed constraint violations that occurred when mixing identity columns with other id generation strategies +* added Sybase 11.9.2 dialect to support older versions of Sybase that do not support ANSI joins (Colm O' Flaherty) +* added Informix9Dialect (Finn McCann and Max Andersen) +* added DB2400Dialect (Peter DeGregorio) +* fixed a problem where mapping validation failure was reported as duplicate import (Michael Gloegl) +* fixed a problem with Expression.not() in MySQL (Michael Gloegl) +* added support for ResultSet.getGeneratedKeys() (David Morris, John Kristian) +* added check attribute to allow check constraints in DDL +* implicit polymorphism for Criteria queries (Shorn Tolley) +* use IF EXISTS for dropping hilo tables (Michael Gloegl) +* better exception report if deleted object is resaved by cascade +* support nested components in Example queries (Emmanuel Bernard) +* fixed a minor problem with onDelete() callbacks +* fixed an obscure problem with select-before-update +* added SunONETransactionManagerLookup (Robert Davidson) +* fixed a problem with replicate() and <joined-subclass> mappings +* made setParameterList() accept empty lists and deny null values (Max Andersen) +* validation check on query parameters now allows setParameter(x, null) (Max Andersen) +* added default-access to DTD (Max Andersen) +* made Query.setParameterList() accept empty lists and deny null values (Max Andersen) +* allow Query.setParameter(x, null) (Max Andersen) +* queries with "select new" now cacheable +* throw meaningful exception when lazy initialization occurs on disconnected session +* added default-access to <hibernate-mapping> (Max Andersen) +* added -text support to SchemaUpdate (Max Andersen, Matt Hall) +* fixed broken implementation of embedded composite keys with createSQLQuery() (Max Andersen) +* added hibernate.cache.use_minimal_puts config property to reduce unnecessary second-level cache puts +* optimized performance of orphan delete detection (Bertrand Renuart) +* fixed problem where unnecessary UPDATE occurred after INSERT for versioned objects with collections +* WebSphereTransactionManagerLookup for WAS 5.1 (Edina Pimp) +* Criteria queries now cacheable (Mario Ivankovits) +* fixed problem with ordered, paginated queries in DB2 (Tim Collins) +* fixed a bug caching <idbag>s +* lazy="true" collections are now lazy even when available in cache +* fixed a problem with version unsaved-value="negative" +* added hibernate.cache.region_prefix config property (William Drai) +* fixed problem where configuration input streams were not closed (Rajesh Patel) + +Changes in version 2.1.1 (17.12.2003) +------------------------------------- +* added optional package attribute to <hibernate-mapping> +* added <meta-value> element to allow simpler <any> mapping +* native SQL queries are now cacheable - added <synchronize> element to allow correct result set expiry +* fixed a bug in CGLIB2 integration (Chris Nockleberg) +* added NamingStrategy +* don't cache objects with formula properties immediately after insert/update +* log generated SQL to a special category +* type of property with access="field" may now be guessed using reflection + +Changes in version 2.1 final (12.12.2003) +----------------------------------------- +* fixed a problem with CGLIB2 proxies and method calls inside constructors +* fixed a bug running SchemaExportTask with mappings in jar files (Tom McCune) +* allow custom persister declaration for subclasses (Nick Johnson) +* fixed handling of sequences in SchemaUpdate on Oracle (Andrew Delpha) +* fixed a bug where Iterator did not handle single null values correctly +* detect and throw exception in the case of a duplicate property mapping +* don't auto-create indexes for collection foreign keys (roll back to 2.0.x) + +Changes in version 2.1 rc1 (29.11.2003) +--------------------------------------- +* long identifier and discriminator column names are now safely aliased (Max Andersen) +* cleaned up mapping package to allow applications to manipulate metamodel programmatically +* fixed a recent bug where collection sort order was lost in second-level cache +* formula attribute now supported for joined-subclass mappings +* formula properties may now be used anywhere in queries +* dialect-specific query pagination for SQL Server +* fixed a bug where a long path expression ending in collection access by index missed some tables in SQL FROM clause +* fixed a very ancient performance problem where null one-to-one associations caused n+1 selects +* added Session.saveOrUpdateCopy() +* fixed some bugs in Example queries +* fixed some minor bugs in dialect-specific query pagination +* immutable entity passed to update() is now lock()ed instead +* reworked the semantics of nonstrict-read-write +* JCS cache support now deprecated +* fixed some obscure bugs in collection handling +* migrated to CGLIB2 (thanks to Chris Nockleberg) +* fixed bugs in replicate() +* fixed a bug affecting joined-subclass mappings with dynamic-update=true +* performance improvements to boolean type mappings (Bertrand Renuart) +* integrated JBoss TreeCache clustered cache (thanks to Bela Ban and Ben Wang) +* fixed a bug in new query parameter validation (Steve Ebersole) +* fixed a bug where <any> mappings caused unnecessary ObjectDeletedException at flush time +* fixed a bug where associations with property-ref mappings were not properly cached +* throw PropertyValueException when not-null properties are null at flush time +* added unsaved-value attribute to version property mapping (Emmanuel Bernard) +* tolerate classnames containing $ (Steve Ebersole) + +Changes in version 2.1 beta 6 (5.11.2003) +----------------------------------------- +* added Session.cancelQuery() +* improvements to transaction handling for failed commit (thanks to Juergen Hoeller) +* added cascade="delete-orphan" +* fixed an exception that occurred when a property was declared not-null="true" update="false" (thanks to John Kristian) +* support multiple named query cache regions (Mikheil Kapanadze) +* some improvements to collection reattachment +* fixed a bad bug with adds to an uninitialized bag or list +* removed support for <dynabean/> components +* added <dynamic-component/> mapping for properties of type Map +* fixed a bug where schema export generated index names that were too long for DB2 +* allow per-region expiry policies in OSCache (Matthias Bogaert) +* fixed a stack overflow that could occur while initializing nonlazy collections +* fixed a bug in case-insensitive like for Example queries +* fixed a bug in ScrollableResults.setRowNumber() (Martin Priekopa) +* improvements to the cache concurrency strategies + +Changes in version 2.1 beta 5 (30.10.2003) +------------------------------------------ +* Support for custom CollectionPersister (Nick Johnson, Max Andersen) +* Support for named SQL queries (Max Andersen) +* duplicate named queries now throws MappingException instead of just logging warning (Max Andersen) +* fixed problems with WebSphereTransactionManagerLookup (Ralf Taugerbeck, Daniel Bradby) +* added support for custom collection persisters (thanks to Max Anderson, Nick Johnson) +* fixed a performance problem during query compilation (Bulent Erdemir) +* composite keys now supported in createSQLQuery() (Max Andersen) +* fixed JCA adaptor to run in WebLogic (Daniel Bradby) +* integrated SwarmCache (Jason Carreira) +* integrated OSCache (Matthias Bogaert) +* fixed an NPE that could occur with lists and orphan delete +* allow nullable one-to-one with property-ref +* improved usage of Dialect-specific limit SQL +* fixed problem where non-lazy collections held by cached objects were not immediately initialized +* fixed getReturnTypes() for native SQL queries (Max Andersen) +* fixed problems with Criterions that applied to multi-column properties +* check of rowcounts when JDBC batch updates enabled +* added named SQL queries using <sql-query> element (Max Andersen) +* added some extra validations so Hibernate fails earlier when user makes mistakes +* allow lazy="true" as an alternative to proxy="ClassName" +* removed dependency to commons-lang +* SchemaExport now creates indexes for collection foreign key columns if specified by Dialect +* fixed a bug parsing named parameters in setParameterList() +* select new Foo(...) will now tolerate null values if the constructor accepts a wrapper type +* fixed a problem detecting Proxool +* added logging of persistent object states during flush() +* allow "not null" as a discriminator value +* added "parameters" config param to "sequence" generator (Matthias Bogaert) + +Changes in version 2.1 beta 4 (3.10.2003) +----------------------------------------- +* fixed a bug where <any> mappings did not handle proxies correctly +* implemented new optimistic-lock strategies +* fixed several bugs in Criteria query API +* fixed a bug caching property-ref associations +* improvements to XML Databinder (Ara Abrahamian) +* added Session.replicate() and ReplicationMode +* added ScrollableResults.setRowNumber() / ScrollableResults.getRowNumber() +* added query cache and Query.setCacheable() +* added Criteria.returnMaps() +* fixed some problems with CGLIB proxies +* fixed an NPE that occurred when a joined-subclass of a versioned entity defined only collections +* added the access attribute, direct field access and the PropertyAccessor extension point +* added MatchMode for use with Criteria queries (thanks to Michael Gloegl) +* fixed a bug where some lazy="false" collections were not immediately initialized +* fixed problem with WebSphere 5 TransactionManager +* support schema attribute in MySQL, by using an underscore in the table name (Chris Hane) +* now seperate Dialects for Interbase and Firebird (Reha Cenani, Max Andersen) +* removed built-in PreparedStatement cache +* added Session.getSessionFactory() +* fixed problem with native SQL queries and Query.setProperties() (Max Andersen) +* Query now fully validates parameters against the query string before passing them to JDBC (Max Andersen) +* fixed an NPE in SessionFactory.close() +* fixed an NPE that occurred when using <idbag>s +* added SQL-level query results paging to DB2Dialect +* "foreign" id generator now handles detached instances + +Changes in version 2.1 beta 3 (7.9.2003) +---------------------------------------- +* added Example queries +* fixed an exception that occurred at startup with <key-many-to-one> and <joined-subclass> +* fixed a bug where composite-elements were not being updated if a property not in the equals() was changed +* <parent> property of a composite-element may now be used in equals() +* named parameters may now be used in HQL order by clause +* null value of version property now indicates unsaved instance +* added select-before-update attribute +* two-phase loading now use for components +* better implementation of equals()/hashCode() for proxies +* added property-ref attribute to <many-to-one> +* renamed result() to uniqueResult() +* added Session.get() +* added HashtableCacheProvider +* JTA TransactionManager now used even when not using Hibernate Transaction API +* always bypass process-level cache for LockMode.READ + +Changes in version 2.1 beta 2 (27.8.2003) +----------------------------------------- +* <subclass> and <joined-subclass> may now appear outside of a <class> element, by providing the extends attribute (Max Andersen) +* fixed an NPE at startup that was introduced in beta 1 +* fixed a bug in Map.putAll() +* new pluggable cache API +- deprecated <jcs-cache> in favor of <cache> +- net.sf.hibernate.cache.CacheProvider settable via hibernate.cache.provider_class +* more aggressive caching +* added Hibernate.close(Iterator) +* Criteria queries may now include joins +- Criteria.addJoin() +- Criteria.createCriteria() +* hibernate.transaction.manager_lookup_class should now ALWAYS be specified in JTA environment when using jcs caching +* fixed a bug caching <key-many-to-one> +* fixed bug where cached component did not get <parent> property populated +* added hibernate.max_fetch_depth property +* smarter outer-join fetching +* transient object may now be associated with session using Session.lock() +* added Query.result(), Criteria.result() + +Changes in version 2.1 beta 1 (10.8.2003) +----------------------------------------- +* batch-size attribute for collection and class mappings, to allow batch loading +* collections of "value types" (including composite-elements) may now appear in HQL from clause +* more efficient loading of collections, and better handling of non-lazy collections +* added HQL index() function to allow access to collection element index +* added Session.createSQLQuery() (Max Andersen) +* added outer-join attribute to collection mappings +* Criteria.setFetchMode() now applies to collection-valued path expressions +* added property-ref attribute to <one-to-one>, enabling unique foreign key associations +* added hibernate.max_fetch_depth config property +* added hibernate.hbm2ddl.auto config property +* fixed a bug with combination of <jcs-cache> and <key-many-to-one> +* support for Dialect-specific SQL functions in HQL select clause (David Channon) +* added Session.clear() + +Changes in version 2.0.2 (2.8.2003) +----------------------------------- +* subqueries may now use HAVING and GROUP BY clauses +* fixed a bug with setMaxResults(), setFirstResult() in HSQL (introduced in 2.0.1) +* fixed a bug in Set.removeAll() +* fixed a bug in SchemaUpdate (Mathias Bogaert) +* added weak typing functionality to ScrollableResults +* fixed a bug with "calendar" versioning in IBM JDK1.3.1 (workaround for JDK bug) +* fixed a bug in mapping DTD that caused a problem for hbm2java (Max Andersen) +* fixed a bug querying nested components +* SQL generation now prefers ANSI-style inner joins to theta inner joins +* fixed a bug caching collection references loaded using FETCH +* fixed a bug with composite foreign keys in normalized table mappings (Tom Sedge) +* limit support for Interbase (Ludovic Orban) +* added where attribute to <class> mappings +* added cascade="all-delete-orphan" for collection mappings +* fixed a bug binding named parameters with setMaxResults()/setFirstResults() +* fixed some minor bugs in HQL translator +* fixed a long-standing bug where a <key-many-to-one> could not be dereferenced in HQL +* SQL UPDATEs now occur in a predictable order (same order as objects were loaded) +* support for SELECT ... FOR UPDATE in SAPDB +* fixed bug where Criteria queries against a subclass also returned superclass instances +* fixed a very rare bug where an update could get lost with normalized mappings +* fixed a problem with proxied class heirarchies rooted at an interface or abstract class +* where and order-by attributes now allow SQL function calls and subselects +* added formula attribute to <property> tag, to allow "computed" properties +* fixed a bug where PreparedStatements were sometimes not closed when an exception occured +* workaround for a problem with <joined-subclass> and Interceptor.onFlushDirty() + +Changes in version 2.0.1 (17.6.2003) +------------------------------------ +* fixed some problems with new dialect-specific LIMIT clauses +* improved parsing of collection where attribute +* made one-to-many bags more efficient (they are really sets!) +* allowed type="calendar" for <version> properties +* fixed a bug with locking a versioned composite-id class +* refresh() may now take a transient instance +* added ProxoolConnectionProvider (Martin Crawford) +* fixed some minor JCA issues (Mike Mosiewicz) +* fixed a bug with FETCH and sorted associations +* improved performance of SchemaUpdate tool (Teodor Danciu) +* fixed a bug in Configuration.addFile(String) (Ken Geis) +* tidied up and documented hbm2ddl package (esp. Ant tasks) +* deprecated CounterGenerator in favor of IncrementGenerator +* improved logging during initialization +* deprecated "vm" in favor of "increment" id generator + +Changes in version 2.0 final (8.6.2003) +--------------------------------------- +* added "fetch" keyword to HQL +* added evict() methods to SessionFactory for JVM-level cache +* destroy caches from SessionFactory.close() +* fixed an NPE in Session.evict() (Simon Spero) +* added Query.setLockMode() +* tidied up implementation of Loader +* release ResultSets more aggressively +* miscellaneous improvements to some Dialects +* hbm2java now honors the sort attribute (Max Andersen) +* added exceptions to Interceptor interface +* fixed problem with setMaxResults(), setFirstResult() in Oracle (introduced in beta 6) +* fixed some SQL generation that was a problem for Sybase (Dietmar Posselt) +* fixed some problems with ODMG API (Oliver Gries) +* added JOTMTransactionManagerLookup (Low Heng Sin) +* added JOnASTransactionManagerLookup (?) +* fixed a bug in WeblogicTransactionManagerLookup (Mathias Bogaert) +* added Criteria.setFetchMode() +* added new Expressions +* much more elegant/robust handling of quoted identifiers +* renamed Hibernate.association() to Hibernate.entity() +* added dynamic-update and dynamic-insert mapping attributes +* fixed a bug with refresh() of objects with collections +* HQL aliases now optional - "from Cat" now legal +* platform-independant quoting of identifiers using backticks + +Changes in version 2.0 beta 6 (10.5.2003) +----------------------------------------- +* fixed a bug querying one-to-many associations to a <joined-subclass> +* added support for dialect-specific LIMIT-style clauses (David White) +* added <idbag> +* fixed bug in hashCode() of persistent collections +* <joined-subclass> now supported in HSQL (Wolfgang Jung) +* fixed problem for XML parsers which ignore default values declared in DTD +* <meta> tags can now be set to not be inheritable +* fixed bug in Expression.in() +* fixed an NPE that could occur from update() in very strange cases (Chris Nockleberg) +* disabled outer-join back to owner when initializing one-to-many (performance improvement) +* fixed a bug in Query.setParameterList() (Nick Heudecker) +* improved JCA support (Igor Fedorenko) + +Changes in version 2.0 beta 5 (21.4.2003) +----------------------------------------- +* Informix support (Steve Molitor) +* fixed a bug parsing "select new ... " queries +* deprecated "object" type in favor of <any> mappings +* added Session.contains() +* added extra DBCP config options (Alex Burgel) +* SessionFactory.close() now unbinds from JNDI +* added Session.evict() +* got rid of an unnecessary SQL DELETE issued when an empty collection was dereferenced +* where attribute of collection mappings no longer ignored for deletion +* improved logging +* support polymorphic associations to "embedded" composite id classes +* various bugfixes to collection filter parameter binding +* fixed some problems with proxies introduced in earlier beta versions +* fixed bug with self-reference in the case of identity column id generation +* added hibernate.cglib.use_reflection_optimizer property +* added nonstrict-read-write cache +* fixed an SQL-generation bug in new Criteria API +* added CompositeUserType +* sequence and table id generators now aware of default-schema +* added update and insert attributes to <component> element +* fixed a bug with expressions like elements(foo.bar.baz) in where clause +* more efficient Set initialization (two-phase load) +* removed support for hibernate.query.imports and added <import> mapping element +* fixed problem in DBCP connection validation and added new config properties +* hbm2java can now generate finder methods for persistent objects (experimental) (Matt Hall) +* hbm2java small fixes/refactorings to support generating more than one file per persistent object (Max Andersen) + +Changes in version 2.0 beta 4 (22.3.2003) +----------------------------------------- +* Major HQL improvements +- from "Foo as foo join foo.bars as bar" instead of "from foo in class Foo, bar in elements(foo.bars)" +- "select new Foo(bar.name, bar.amount) from ...." +- outer and full join support +* Query methods now return this, to allow chaining +* FrontBase support (Run Lussier) +* experimental JCA support (Daniel Bradby) +* hbm2java now can generate Beans style property events (Klaus Zimmermann) +* support SQL identifiers quoted with [] +* fixed bug with PostgreSQL +* name attribute now optional in .cfg.xml +* support for postgres ilike operator (M Lang) +* squash warnings with GNU JAXP (Chris Nockleberg) +* fixed a bug in Query.setParameterList() +* Ingres support (Ian Booth) +* collections now detect changes not made via wrapper for newly saved objects +* new (experimental) Criteria + Expression APIs +* Query.setEntity(), etc, now aware of proxies (also improved hueristics for guessing Type) +* added Hibernate.isInitialized() +* detect changes made directly to newly-wrapped collection (ie. not via the wrapper) +* added Hibernate.refresh(Object, LockMode) +* update(), saveOrUpdate() no longer initialize a proxy +* fixed problems with Sybase +* added force attribute to <discriminator> +* improved handling of null discriminator-value +* support SQL-style '' escape for HQL strings + +Changes in version 2.0 beta 3 (24.2.2003) +---------------------------------------- +* collections now represent null elements as a missing row +* collections now deserialize correctly (fix for bug in beta 2) +* standardised on dom4j for XML parsing +* fixed bugs in collection caching (an exception occurred for some sorted collections and some kinds of maps) +* allowed null discriminators +* set autocommit to true in SchemaUpdate +* fixed a stack overflow that could occur in toString() of classes created with hbm2java (Max Andersen) +* fixed a bug where composite-element <parent> property was not being set after retrieval from cache +* added where attribute to collection mappings to allow filtering +* fixed a exception that occurred when wrapping collections with sort="MyComparator" (Jason Horne) +* objects with mutable="false" are now never updated +* fixed an exception that occurs with <key-many-to-one> association to a class with a composite id (Stefano Travelli) +* added SchemaExport Ant task (Rong C Ou) +* integrated latest CGLIB release (Juozas Baliuka) +- added support for new CGLIB reflection optimizer (Juozas Baliuka) +* improved query cache algorithm (Who?) +* fixed a bug in "object" type +* Lists and arrays now represent null elements as a missing row +* fixed a bug in Hibernate PreparedStatement cache where maxRows and fetchSize were not cleared before re-caching +* fixed a bug in HibernateService that caused a restart to fail +* added SybaseAnywhereDialect (?) +* added SessionFactory.close() + +Changes in version 2.0 beta 2 (2.2.2003) +---------------------------------------- +* property column names may now be of any length (Mark Woon) +* fixed problem where CodeGenerator created private get/set pairs (Max Andersen) +* fixed all silly bugs in Configuration.configure() +* efficient collection updates from Session.update() +* added <jcs-class-cache> and <jcs-collection-cache> elements to hibernate-configuration.dtd +* support for normalized mappings for databases with DECODE instead of CASE (Simon Harris) +* added Oracle9Dialect +* added JRun4TransactionManagerLookup (Joseph Bissen) +* fixed JDBCException to keep reference to underlying SQLException +* fixed a bug loading many-to-many associations with a repeated column name +* fixed a bug in ShortType +* added IngresDialect (Ian Booth) +* added --config option to SchemaExport + +Changed in version 2.0 beta 1 (28.1.2003) +----------------------------------------- +* renamed packages to net.sf.hibernate.* +* all API methods now wrap SQLExceptions +* removed support for toplevel collections / subcollections +* created hibernate-mapping-2.0.dtd +- renamed 'readonly' attribute to 'inverse' +- renamed 'role' attribute to 'name' +- changed default value for 'unsaved-value' to "null" +- added mandatory 'name' attribute to <param> +- added <meta> tag +* created hibernate-configuration-2.0.dtd +* brand new Configuration API, including exposed mapping package +* completely reworked IdentifierGenerator framework +- built-in generators now auto-detect the type (so integer identity columns are supported, for example) +- parameters are now named +- built-in strategies are renamed +* expanded Interceptor interface +* removed exceptions that occur if an object is saved or deleted multiple times in a session +* added <parent> subelement to <composite-element> and <nested-composite-element> +* collections except for <bag>s now implement by-value equals() and hashCode() +* removed all deprecated methods +* added Session.refresh() +* added dynamic-update functionality +* added update and insert attributes to <property> and <many-to-one> mappings +* added elements(), indices(), size(), maxelement(), minelement(), maxindex(), minindex() collection functions to query language +* huge improvements to CodeGenerator (Max Andersen) +* enhanced outerjoin fetching support in queries +* experimental support for DynaBeans as components + +Changes in version 1.2.3 (28.1.2003) +------------------------------------ +* fixed a recently-introduced problem with Timestamp dirty checking +* added createClob(), createBlob() for streams (Benoit Menendez) +* SchemaUpdate now configures Dialect correctly (Michael Locher) +* update() now working for classes with embedded composite ids +* unsaved-value attribute now recognized for <composite-id> +* fixed a minor problem where a very specific kind of SQL select did not qualify a column name +* added Query.getQueryString() +* fixed an NPE that sometimes occurred when hibernate.connection.username was not specified +* fixed a bug in SchemaExport where foreign key constraints did not use qualified tablenames +* added isFirst(), isLast() to ScrollableResults +* fixed bug finding properties inherited by mapped interfaces + +Changes in version 1.2.1b (4.1.2003) +------------------------------------ +* fixed an NPE that occurred while loading Hibernate classes in IBM JVM +* arbitrary JNDI InitialContext properties may now be passed as hibernate.jndi.* +* fixed a problem where index column was not being nullified when an entity was removed from a one-to-many + +Changes in version 1.2.1 (31.12.2002) +------------------------------------- +* Changed the MySQL mapping of Hibernate "timestamp" to MySQL "DATETIME" (Matthias Schwinn) +* TransactionManagerLookup classes now define defaut UserTransaction JNDI names +* support for WebSphere 5 (Venkat Srinivasan) +* fixed a bug with query expressions of the form "foo.bar.id" for normalized mappings +* experimental Blob/Clob support (thanks to Benoit Menendez and Mark Woon) +* improvements to SchemaUpdater (Benoit Menendez) +* deprecated suspendFlushes() / resumeFlushes() in favor of FlushMode +* deprecated IDGenerationException in favor of IdentifierGenerationException +* fixed a bug introduced in 1.2 final where cascade save-update was sometimes ignored for readonly="true" bags +* fixed a bug caching null-valued one-to-one associations +* CodeGenerator now supports <bag> and <joined-subclass> +* fixed problem with TimestampType on DB2 (Jonas) +* fixed a bug in generated SQL for collections with <joined-subclass> mappings (Robson Miranda) +* fixed a bug caching Maps (Benoit Menendez) +* SchemaExport now accepts a .jar file as a source of mappings +* hibernate.dbcp.validationQuery setting (Juozas Baliuka) +* hibernate.c3p0.validate setting +* added Query.setTimeout() +* setMaxResults() now behaves sensibly on SAPDB (Russel Smyth) +* added Query.setProperties() and Query.getNamedParameters(), fixed a bug in Query.getReturnTypes() +* CodeGenerator now generates equals() and hashCode() for composite-id classes (and toString() for all classes) +* CodeGenerator now includes superclass properties in subclass constructors (Max Andersen) +* added Hibernate.custom() + +Changes in version 1.2 final (7.12.2002) +---------------------------------------- +* fixed a bug where uppercase IS NOT NULL, NOT IN, etc were not parsed correctly +* addition to readonly="true" bags now no longer requires collection initialization +* added ResinTransactionManagerLookup (Aapo Laakkonen) +* improved exception message when setting null to primitive type (Max Andersen) +* improved exception message for an unserializable identifier +* support for overloaded setter methods (patch by Alex Staubo) +* CodeGenerator support for <composite-element> (patch by Wolfgang Jung) + +Changes in version 1.2 beta 4 (29.11.2002) +------------------------------------------ +* fixed bugs in one-to-many associations to a <joined-subclass> +* LockMode class now properly serializable +* exceptions thrown by proxied objects are now propagated correctly (rather than being wrapped) +* made Calendar types compilable in JDK1.2 +* added --format and --delimiter options to SchemaExport (thanks to Richard Mixon) +* fix for problem with class with no properties + native id generation + MS SQL Server contributed by Max Andersen +* fixed a BAD bug in Hibernate.configure() (thanks to Rob Stokes) +* CodeGenerator now recognizes <key-many-to-one> (patch by Wolfgang Jung) +* CodeGenerator now recognizes <version> and <timestamp> (patch by Max Andersen) + +Changes in version 1.2 beta 3 (26.11.2002) +------------------------------------------ +* fixed bug in UPDATE SQL generation for <joined-subclass> mapping strategy (fix by Robson Miranda) +* support <composite-id> correctly in CodeGenerator (patch by Tom Cellucci) +* fixed an exception that occurred with short qualified tablenames +* added the polymorphism attribute to the <class> element +* allow "not between", "not in" in query language +* allow subqueries beginning with a from clause in query language +* query expressions like "not (foo.bar.baz=1)" now translated to "(bar.baz!=1 and foo.bar=bar.id)" +* support for PostgreSQL ~ operator (regular expression match) +* load(id, lockMode) now working for normalized table mappings +* now compiling properly under JDK1.2, 1.3 (fix by Tom Cellucci) +* support for subcollections in query language: foo.bars[2]['index'], foo.bars[4].elements, foo.bars[0].size, etc. +* added calendar and calendar_date types +* find() queries may now return scalar values +* component-type properties may appear in a select clause +* ConnectionProviders now set isolation level before toggle autocommit +* Iterator.next() now throws NoSuchElementException as per Iterator contract (fix by Alex Staubo) +* database reverse engineering GUI tool contributed by Tom Cellucci +* SchemaExport now generates column in mapping file order (rather than alphabetical order) +* <joined-subclass> mappings working on Oracle (?) + +Changes in version 1.2 beta 2 (15.11.2002) +------------------------------------------ +* support multi-argument SQL functions in queries +* reintroduced deprecated form of update() with slightly altered semantics +* fixed BAD problem in the generated SQL for certain queries +* added OrionTransactionManagerLookup + +Changes in version 1.2 beta 1 (11.11.2002) +------------------------------------------ +* Fixed a bad bug binding to JNDI with servers that use serialization in preference to getReference() +* support for quoted SQL identifiers (patch by Jean-Francois Nadeau) +* Hibernate.initialize() allows the user to force initialization of a proxy or persistent collection +* fix to minor bug in CodeGenerator by Max Andersen +* fixed a problem with outerjoin fetching of one-to-one associations defined on subclasses +* fixed a minor problem with proxies of classes that override finalize() +* finished work on normalized table mappings using <joined-subclass> declaration (only for databases with ANSI OUTER JOIN and CASE) +* deprecated hibernate-mapping.dtd in favor of hibernate-mapping-1.1.dtd +* reworked unmapped class / interface / table-per-concrete-class query functionality, fixing several problems +* removed deprecated methods +* deprecated findIdentifiers() +* fixed some problems with embedded composite identifiers +* fixed a bug cascading deletes to one-to-one associations +* CodeGenerator now generates isFoo() style getters for boolean properties (patch by Aapo Laakkonen) +* components may now have a nonpublic constructor (patch by Jon Lipsky) +* changes / bugfixes to MapGenerator tool +* experimental SchemaUpdate tool contributed by Christoph Sturm + +Changes in version 1.1.8 (30.10.2002) +------------------------------------- +* full support for composite keys in query language +* fixed bug where character type could not be null +* fixed bug parsing collection filters like: "group by this.date" +* fixed a bad bug where C3P0 properties were not always being used +* replaced hibernate.use_jdbc_batch with hibernate.jdbc.batch_size +* renamed some other properties to hibernate.jdbc.* +* made hibernate.show_sql settable from JMX (patch by Matas Veitas) +* added SessionFactory.getAllClassMetadata(), getAllCollectionMetadata (patch by Max Andersen) +* allowed use of concrete-class proxies with inherited classes ie. <subclass name="ConcreteClass" proxy="ConcreteClass"> +* HibernateException extends Apache commons lang NestableException (patch by Max Andersen) +* <parent> subelement of <component> allows a component to get a reference back to owning entity +* Query.setParameterList() to bind lists of values to "in (:list)" +* Java constants may now be used in Queries +* serialization of an object graph now removes all initialized proxies +* several other improvements to proxy handling +* proxies may now be used in JDK 1.2 + +Changes in version 1.1.7 (25.10.2002) +------------------------------------- +* added Session.createFilter() +* fixed a bug parsing queries with properties of form idXXX (introduced in 1.1.6) +* fixed a bug parsing queries with the id property named in the select clause (introduced in 1.1.6) +* fixed a bug dirty checking big_decimal (fix by Andrea Aime) + +Changes in version 1.1.6 (24.10.2002) +------------------------------------- +* classes without subclasses may now declare themselves as their own proxy +* outer-join attribute now working for component properties and <many-to-many> +* outer-join="true" will now force outerjoin loading for an association even if associated class has a proxy +* enabled oracle-style outerjoins for SAP DB +* version properties may now be long or short (previously always integer) +* discriminators may now be boolean type +* fixed the foo.bar.id.baz syntax for queries doing composite-key joins +* fixed an NPE that occurred when no Dialect was specified +* CodeGenerator now fully proxy-aware (patch by Max Andersen) +* removed dependency upon trove4j + +Changes in version 1.1.5b (20.10.2002) +-------------------------------------- +* fixed an NPE that occurred on JMX startup +* smarter fetching for one-to-one associations + +Changes in version 1.1.5 (19.10.2002) +------------------------------------- +* added built-in currency and timezone types +* hibernate-mapping-1.1.dtd +- added <index-many-to-many> and <composite-index> subelements of <map> +- added <key-property> and <key-many-to-one> +- renamed "save/update" to "save-update" +- tightened up the dtd (now using enumerated attribute types) +* enabled multi-column map indexes (ie. key of a Map) +* composited-id may now include a many-to-one association +* improvements to Databinder contributed by Brad Clow +* fixed bugs in minIndex, maxIndex, minElement, maxElement +* fixed a problem with JTATransaction in a JBoss BMT bean +* added addMapResource() to the MBean +* minor improvements to Configuration +* more accurate cache entry timestamping to increase the likelihood of cache hits +* JCS cache may now be used with JTATransaction in WebSphere, Weblogic, JBoss (thanks to Matt Baird) +* improvements to CodeGenerator contributed by Andrea Aime +* stopped a TransientObjectException that was being thrown when it shouldn't be +* re-enabled primary key export for tables of sets with not-null elements +* hibernate.statement.fetch_size configuration contributed by Matas Veitas +* added Interceptor application callback interface +* added metadata package to expose persistence metadata to the application +* changed filter() argument type from Collection to Object to allow filtering of arrays and Maps +* added <column> index attribute to allow table indexes to be specified in mapping document +* implemented support for queries against interfaces and abstract superclasses + +Changes in version 1.1.4b (4.10.2002) +------------------------------------- +* fixed problems for JDK1.2 (thanks to Chris Webb) + +Changes in version 1.1.4 (4.10.2002) +------------------------------------ +* New locking API +* disabled 2-phase load for objects contained in Sets (because they should be initialized before equals() or hashCode() is called) +* fixed a bug where non-serializable cache entries could not be cached by JCS auxiliary cache +* fixed a bug in dirty checking PersistentEnums +* deprecated getID() in favor of getIdentifier() (for mainly cosmetic reasons) +* HibernateService may now be subclassed to obtain mapping files by some other mechanism (patch by Chris Winters) + +Changes in version 1.1.3 (1.10.2002) +------------------------------------ +* new 2-phase loading process (replaces complicated "deferred" loading process) +* new ScrollableResults interface for efficiently navigating Query results +* removed deprecated interfaces +* created engine package to hold "internal" APIs (ie. the external contract of the impl package) +* fixed bug where a component defined before all collections in the mapping file caused collections to not be persisted (thanks to Michael Link) +* fixed a bug where cascaded saveOrUpdate was ignoring the unsaved-value setting +* faster Timestamp dirty checking + +Changes in version 1.1.2 (29.9.2002) +------------------------------------ +* added persister attibute of class mapping to support custom persistence strategies +* Support for Oracle outerjoins contributed by Jon Lipsky +* Reworked versioning, fixing bugs (and tightening tests) +* Fixed a bug where an ObjectNotFoundException was thrown for null one-to-one associations +* fixed problems with timestamps introduced in 1.1.1 +* added batch file for running demo + +Changes in version 1.1.1 (27.9.2002) +------------------------------------ +* Major refactoring / abstraction of persistence logic +* added maxIndex, minIndex, maxElement, minElement properties for collections +* added support for class names in where clause of queries +* fixed a bug where an association could become null after caching +* fixed a bug where an NPE could occur for a null component +* fixed minor bugs in SortedMap, SortedSet +* object type is now cacheable +* added big_integer type +* improved dirty checking for timestamp type + +Changes in version 1.1.0 (22.9.2002) +------------------------------------ +* implemented collection indexing with [] in query language +* fixed some minor query-language bugs + +Changes in version 1.1 beta 14 (19.9.2002) +------------------------------------------ +* bags now implement java.util.List +* delete() may now take a transient object +* bug where sorted collections were not being sorted fixed by Brad Clow +* fixed a bug in many-to-many association filtering +* no longer try to query connection metadata when using user-supplied connections +* added hibernate.use_scrollable_resultsets for user-supplied connections +* fixed a problem where sublists were not being proxied +* fixed a problem where Hibernate could not call methods of package-visibility classes +* removed obsolete select attribute from MapGenerator +* multiple occurrences of same path in a query no longer require multiple joins +* added WrongClassException + +Changes in version 1.1 beta 13 (15.9.2002) +------------------------------------------ +* added constants to Lifecycle interface +* fix for circular cascade="save/update" +* fixed a bug in cascaded update introduced in version 1.1 beta 11 +* added object type + +Changes in version 1.1 beta 12 (14.9.2002) +------------------------------------------ +* Session.filter() for applying a filter query to collections +* experimental ODMG API (OQL features are not yet compliant) +* new DBCPConnectionProvider for Apache commons-dbcp connection pool +* Session.lock() now does version number check even on databases with no FOR UPDATE clause +* introduced new cascade styles: cascade="save/update", cascade="delete" +* added default-cascade attribute +* foreign key columns lengths now automatically set to primary key column lengths for SchemaExport +* added error checking of row update counts when batching disabled +* major improvements to ProxyGenerator tool +* CodeGenerator now aware of proxy attribute +* integrated PointbaseDialect contributed by Ed Mackenzie +* fix for problem where Proxies were being initialized on identifier access by Christoph Sturm + +Changes in version 1.1 beta 11 (7.9.2002) +----------------------------------------- +* deprecated update() in favor of saveOrUpdate() and introduced unsaved-value attribute of <id> +* children mapped with cascade="all" are now always saved/updated even without a call to update(parent) +* support for composite-id classes where the composite id consists of properties of the persistent class +* added constrained attribute to <one-to-one> element +* added Validatable interface +* renamed several config properties (Hibernate issues log warnings for obsolete property usage) +* arbitrary JDBC connection properties may now be passed using hibernate.connection.* +* fixed a classloading bug in C3P0ConnectionProvider (introduced in 1.1 beta 10) +* CodeGenerator may now take multiple mapping files on the commandline + +Changes in version 1.1 beta 10 (28.8.2002) +------------------------------------------ +* fixed a bug that occurred when calling Session.update() for an object with no properties +* changed class loading to use the context classloader first +* introduced <timestamp> as an alternative to <version> +* added Query.getReturnTypes() +* fixed a bug with composite-elements introduced in 1.1 beta 7 +* save() may now be used to persist classes with composite-ids +* improved handling of nanoseconds values in Timestamps +* support for composite id properties + objects in select clause of iterate() +* beefed-up collection tests + +Changes in version 1.1 beta 9 (26.8.2002) +----------------------------------------- +* fixed a bug introduced in 1.1 beta 8 that could cause an NPE after deserializing a session with proxies +* deprecated insert() in favor of more flexible save() +* deprecated IDGenerator in favor of new IdentifierGenerator interface +* "assigned" id generator now returns the existing value of the id property instead of throwing an Exception +* fixed a problem where PreparedStatements were not being recached after retrieving a natively generated id + +Changes in version 1.1 beta 8 (25.8.2002) +----------------------------------------- +* fixed a bug introduced in 1.1 beta 6 where an updated element of an indexed one-to-many collection caused an SQLException +* uninitialized collections passed to update() may now be initialized in the new Session +* uninitialized proxies passed to update() may now be initialized in the new Session + +Changes in version 1.1 beta 7 (23.8.2002) +----------------------------------------- +* fixed a bug where Hibernate was not returning statements to the cache when batch updates were disabled +* fixed a bad bug parsing mappings with toplevel one-to-many associations +* fixed a bug with versioning and subcollections +* reworked Set updates again for much improved efficiency +* schema export now creates primary keys for indexed collection tables +* minor refactor to Type hierarchy +* improved some user-error detection +* fixed foreign key constraint creation for MySQL with Innodb tables + +Changes in version 1.1 beta 6b (20.8.2002) +------------------------------------------ +* Fixed a problem updating Sets +* added <bag> mapping for java.util.Collection + +Changes in version 1.1 beta 6 (20.8.2002) +----------------------------------------- +* completely reworked fetching code +- one-to-many associations now always fetched in a single select +- many-to-many associations fetched in a single select when outerjoin fetching is enabled +- this includes nested outerjoin fetching of the associated class! +- outerjoin fetching for <many-to-one> nested inside <component> or <composite-element> +- code refactored to be cleaner and faster +* removed unnecessary order by clause in List and array fetching SQL +* collections now individually update, insert and delete only rows that changed (thanks to Doug Currie) +* fixed a problem where exceptions were being wrapped in a LazyInitializationException for non-lazy collections +* added order-by attribute to <set> and <map> to specify a table column as defining the iteration order (JDK1.4 only) +* improved error detection in Session.update() +* further usage of JDBC2 batch updates +* some fine-tuning of JDBC2 feature usage configuration +* CodeGenerator will now generate components and arrays +* fixed problem where CodeGenerator could not generate classes in the default package +* improved logging of flush() activity +* renamed property hibernate.use_jdbc2 to hibernate.use_jdbc_batch + +Changes in version 1.1 beta 5 (13.8.2002) +----------------------------------------- +* hibernate.query.imports property to allow use of unqualified classnames in queries +* fixed a bug in collection flushing that was introduced in 1.1 beta 4 + +Changes in version 1.1 beta 4 (11.8.2002) +----------------------------------------- +* JMX integration (thanks to John Urberg) +* "having" clause in query language + +Changes in version 1.1 beta 3 (10.8.2002) +----------------------------------------- +* removed the select="all" attribute for <class> mappings - "select distinct" now specified in the hibernate query +* system properties now override hibernate.properties +* Session now flushes changes even less often (only when actual updates to the queried table(s) are waiting) +* fixed a *very* rare problem where an unnecessary update could be accidently issued before a delete + +Changes in version 1.1 beta 2 (6.8.2002) +---------------------------------------- +* fixed a bug exporting schemas with identity columns +* implemented factory-level caching of collections +* Datastore.storeJar() contributed by Christian Meunier +* added <mapping jar="jarfile"> to hibernate.cfg.xml + +Changes in version 1.1 beta 1 (4.8.2002) +---------------------------------------- +* new Query API including named parameters, pageable results +* subqueries in Hibernate queries (only for databases that support subselects) +* new DocBook documentation (contributed by Christian Bauer) +* support collections .elements, .indices inside select clause (even in aggregate functions) +* don't load collections before removal unless absolutely necessary +* mutable="false" attribute in <class> element to map immutable classes +* use JDBC batch to insert collection elements if hibernate.use_jdbc2 is set +* brand new PreparedStatementCache +* improvements to MYSQL dialect for long datatypes +* always check isAccessible() before setAccessible(true) +* removed extra unnecessary table join in queries with one-to-many association +* removed ugly "WHERE 1=1" from generated SQL +* fixed exception mapping a class with no properties (fix by Rob Stokes) +* logging enhancements including SQLException logging +* reworked factory-level cache and integrated JCS support (thanks to Christian Meunier) +* fixed a bug with circular references in cached data +* removed blocking cache support +* now rendering outerjoins as "LEFT OUTER JOIN" because "LEFT JOIN" caused problems for some Sybase versions +* added default Hibernate properties to Dialects +* native id generation now falls back to sequence id generation when identity columns not supported by the dialect +* fixed some problems with native id generation under HSQL +* may now use Session.insert() even when using native id generation + +Changes in version 1.0.1b (18.7.2002) +------------------------------------- +* fixed a bad bug in query parser when hibernate.query.substitutions was unset +* much improved build.xml Ant script +* latest c3p0.jar + +Changes in version 1.0.1 (17.7.2002) +------------------------------------ +* enabled use of scalar values and aggregate SQL functions in select clause of iterate() queries +* fixed bug in JNDI lookup for SessionFactory +* changed ordering of SQL inserts/deletes for child collections of a cascade-enabled association +- better behaviour for some not-null constraints +- performance optimization for bidirectional many-to-one associations +* added hibernate.query.substitutions property to allow named query constants (eg. translate 'true' to '1') +* added locale type for java.util.Locale +* added sequence hi/lo generator (seqhilo.long) +* fixed bug where load(), onLoad() callbacks were sometimes called at wrong time +* fixed an exception (fix by Eric Everman) and improved identifier searching in MapGenerator tool +* refactored SerializableType +* extra logging + error handling +* documentation enhancements + +Changes in version 0.9.17 (3.7.2002) +------------------------------------ +* Added UserType interface +* documented Lifecycle +* added some new trace messages to log +* bugfix to allow SQL functions like upper(), lower(), etc to work on all platforms +* documented SAP DB support (dialect contributed by Brad Clow) +* foreign key constraint export for SAP DB +* map index may be the composite-id of the element class (contributed by Jon Lipsky) +* fixes to CodeGenerator tool (contributed by Uros Jurglic) + +Changes in version 0.9.16 (19.6.2002) +------------------------------------ +* fixed bug cacheing objects with references to themselves +* support for composite ids of classes with no id property +* may now disable outer join (deep) fetching for an association by setting outer-join="false" +* enabled outer join fetching for one-to-one +* fixed a bug for mappings that specify class attribute of <one-to-many> +* fixed a bug where Hashbelt did not expire cached data in a timely fashion +* fixed a mistake in the mapping DTD +* new user-error check in update() + +Changes in version 0.9.15 (15.6.2002) +------------------------------------ +* one-to-one associations +* support for "tricky" mappings in SchemaExport tool (multiple properties to one column, etc) +* Transaction API contributed by Anton van Straaten +* SessionFactory may be bound to JNDI name by setting hibernate.session_factory_name +* Sessions are now Serializable! +* added Session.findIdentifiers() query methods +* new Lifecycle interface to replace deprecated PersistentLifecycle +* fixed problem where session did not autoflush on iterate() queries +* performance enhancements to collection dirty checking +* added Hibernate.configure() and configuration file format +* removed some deprecated methods +* refactored Type hierarchy +* query language identifiers now case sensitive (bugfix for case sensitive SQL dialects) +* username/password now optional for datasource (contributed by Emmanuel Bourg) +* much improved API documentation +* binary types now saved using streams if hibernate.use_streams_for_binary=true (contributed by Jon Lipsky) +* MySQL Strings now mapped to TEXT columns if length > 255 (contributed by Christoph Beck) + +Changes in version 0.9.14 (4.6.2002) +------------------------------------- +* lifecycle objects - properties now have a cascade attribute to cascade save, update, delete +* composite id properties may now be used in queries eg. foo.id.bar (contributed by Jon Lipsky) +* slightly changed semantics of update() so it now also save()s new transient instances +* Session now flushes() itself less often before query execution (performance enhancement) +* fixed problem where Session.save() returned null instead of the natively generated id +* fixed bug with object identity for cached classes +* fixed bug where delete(x) could not be called after update(x) +* MUCH improved Exception hierarchy +* deprecated create() +* added sql-type attribute to <column> tag to allow user to override default type mapping +* deeper fetching with use_outer_join +* new ConnectionProvider framework +* fixed a bug where blocking cache could return stale data +* now working again in JDK1.2.2 +* fixed problem with not-null associations + native key generation +* minor changes to PersistentLifecycle interface +* initial, minimal version of new Transaction mechanism +* MUCH improved documentation + +Changes in version 0.9.13 (25.5.2002) +------------------------------------- +* Datastore.storeResource() to load mapping files from classpath +* fixed a problem executing under JDK1.3 when compiled from JDK1.4 +* documentation improvements + +Changes in version 0.9.12 (24.5.2002) +------------------------------------ +* Session.update() methods to update a persistent instance from transient copy (as requested by many users) +* discriminator column name, type, length, etc now configurable by <discriminator> tag in mapping file +* discriminator column values configurable by discriminator-value attribute of <class> and <subclass> tags +* added Session.insert(object, id) for classes with no identifier property +* fixed another bad bug with connection handling (fix by Anton van Straaten) +* fixed a problem with deferred loading +* fixed a problem with sorted collections (fix by Anton van Straaten) +* nested collections of objects now require 2 SQL SELECTs to load, rather than size+1 +* session is NO LONGER atomic - application should discard session when exception occurs +* fixed problem where character type was mapped to VARCHAR column +* arrays of proxies now possible by using new element-class attribute of <array> tag +* fixed various problems with proxies +* added proxy generation tool +* proxy unit tests +* replaced two RuntimeExceptions with checked exceptions +* made hibernate.username/hibernate.password optional for DriverManager +* CodeGenerator now supports all hibernate basic types +* much improved caching algorithm for compiled queries +* may now specify properties simply by placing hibernate.properties in classpath +* documentation improvements + fixes +* --abstract switch to MapGenerator (contributed by Eric Everman) + +Changes in version 0.9.11 (12.5.2002) +------------------------------------ +* fixed major bug with connection handling (fix by Anton van Straaten) + +Changes in version 0.9.10 (11.5.2002) +------------------------------------ +* set a default schema name using SessionFactory property hibernate.default_schema +* code generator tool contributed by Brad Clow (www.workingmouse.com) +* lazy object initialization under JDK 1.3 and above +* fixed some error messages to go to logging framework, not stdout +* new system property hibernate.show_sql=true logs all executed SQL to stdout +* integration of bugfixes in c3p0 +* wrap IllegalArgumentExceptions in HibernateExceptions +* added ObjectNotFoundException and StaleObjectStateException +* fixed a bug when using schemas +* new caching strategy (and documented cache feature) + +Changes in version 0.9.9 (25.4.2002) +----------------------------------- +* sorted sets and maps (thanks to Doug Currie) +* mapping files may now be loaded using getResourceAsStream() (thanks to Markus Meissner) +* hibernate messages now logged by Apache commons-logging +* default hi/lo generator table now has column named "next_id", instead of "next" +* query language may now refer to identifier property name (eg. foo.fooKey as alternative to foo.id) +* hibernate.jndi_class, hibernate.jndi_url now optional when using datasource +* hibernate now throws an exception if you try to persist an object with a reference to a transient object +* improved connection pooling algorithm (hibernate.pool_size limits pooled conections) +* very experimental integration of c3p0 JDBC connection pool (http://sourceforge.net/projects/c3p0) +* now compiles under JDK 1.2.2 +* fixed bug persisting null components +* fixed bug where cached prepared statements were not cleaned up after disconnect() session +* fixed a null pointer exception in MappingByReflection + +Changes in version 0.9.8 (13.3.2002) +----------------------------------- +* supports database native key generation in Sybase, MS SQL, MySQL, DB2, Hypersonic (contributed by Christoph Sturm) +* supports Mckoi (dialect contributed by Doug Currie) +* supports Progress (dialect contributed by Phillip Baird) +* added exceptions to catch Session reentrancy from PersistentLifecycle.load() + store() +* experimental cross-transaction cache +* Session.lock() and Session.loadWithLock() for pessimistic locking +* HiLoGenerators may now use their own DriverManager connection properties + may now use same table across diff mapping files +* Session.flush(), Session.close() and Session.connection() replace Session.commit(), Session.cancel() +* Session.disconnect() and Session.reconnect() for long transactions +* added single JVM id generators vm.long, vm.hex +* added unique column constraints to mappings +* extensions to IDGenerator framework +* support sequence-style ID generation in Oracle, PostgreSQL, DB2, Interbase + +* fixed problem where subcollections of a collection that changed roles would be deleted +* changed class loading strategy to be compatible with JBoss +* stopped queries retrieving unnecessary columns +* mutable types (binary + serializable) now always detected as dirty + +Changes in version 0.9.7 (26.2.2002) +----------------------------------- +* save() now safe from foreign key violations (so create() is no longer preferred method of adding data) +* delete() now completely safe from foreign key violations - it no longer matters what order objects are deleted in +* removed Session.copy() +* hilo generators now NOT for use with application server datasources + +* fixed two intermittent bugs in queries +* fixed a problem where components not detected as dirty +* fixed broken hilo generator which was not updating database +* fixed a minor bug when hibernate.use_outer_join was set + +Changes in version 0.9.6 (24.2.2002) +----------------------------------- +* experimental XML generation +* added support for bi-directional associations (one-to-set, set-to-set) with <set readonly="true"> config +* reflective generation of mappings tool was contributed by Doug Currie +* Session operations now atomic, so exceptions are recoverable +* made ID properties optional in persistent classes +* support for multiple schemas through schema attribute of <hibernate-mapping>, <class>, <set>, <map>, etc. +* auto-creation of tables for hilo id generators (restriction: cannot use same table from more than one mapping file) +* added some more assertions to catch user "mistakes" like deleting transient or saving persistent objects + +* major rework of collections and fixed some bad bugs +* lazy initialization re-enabled for one-to-many associations (thanks to Georg Schneemayer) +* fixed a problem in the mapping DTD to allow nested components in collections +* fixed a BAD bug in RelationalDatabaseSession when loading objects with PersistentLifecycle callbacks (thanks to Paul Szego) +* fixed problems with quoted strings in query language +* fixed a bug where a stack overflow occurred instead of HibernateException thrown (thanks to Georg Schneemayer) +* fixed a bug deleting updated versioned data +* fixed some problems with name generation for indexes + foreign keys +* fixed problem in Sun JDK 1.4 (only?) where IllegalArgumentException was not handled +* minor improvements to handling of dates and times +* HiLoGenerator now safe for all transaction isolation levels + safe when rollback occurs +* noticed and fixed obscure piece of nonthreadsafe code outside of core persistence engine +* removed unnecessary drop constraints for some dialects + +* MUCH more comprehensive test suite + +* changed some terminology used in documentation +* added javadoc for API classes +* commented the mapping DTD + +Changes in version 0.9.5 (8.2.2002) +----------------------------------- +* supports HypersonicSQL (dialect contributed by Phillip Baird) +* supports Microsoft SQL server (with third party JDBC driver) +* proper command-line tool for schema generation and export +* deprecated the interface cirrus.hibernate.Persistent (due to popular demand) +* changes to hibernate-mapping DTD (required to support optional Persistent interface): +- deprecated <property type="package.PersistentClassName"/> in favor of <many-to-one class="package.PersistentClassName"/> +- deprecated <element type="package.PersistentClassName"/> in favor of <many-to-many class="package.PersistentClassName"/> +- deprecated <property role="..."/> in favor of <collection role="..."/> +- deprecated <element role=".."/> in favor of <subcollection role="..."/> +- deprecated <association> in favor of <one-to-many> +* class attribute optional in <component> and <composite-id> tags (determined by reflection) +* querying components of components now supported +* one-shot table creation (no use of unportable "alter table") +* time dataype support +* reflective mappings of java.sql.Time, java.sql.Timestamp, java.sql.Date +* fixed error msg thrown when class is missing a method but has a superclass +* property names now conform to JavaBean spec ("foo" instead of "Foo"). Note that "Foo" still works +* constructors of persistent classes may now be non-public +* collection indexes now mapped to not-null columns +* fixed obscure bug with querying collections inside components of components +* fixed potential bug related to cacheing of compiled queries +* major rewrite of code relating to O-R mappings +* Session.copy() and Session.equals() as convenience for users +* fixed repeated invocations of hasNext() on iterator + iterators now always work with distinct SQL resultsets +* McKoi dialect was contributed by Gabe Hicks + +Changes in version 0.9.4 (29.1.2002) +------------------------------------ +* fixed BAD bug where XML parsing would not work for parsers other than Xerces - thanks to Christian Winkler +* added some more assertions to catch user "mistakes" like changing ids or reusing existing ids + +Changes in version 0.9.3 (27.1.2002) +------------------------------------ +* repackaged (corrupted DatasourceConnectionProvider.class) +* better exception reporting using datasource +* added Datastore.storeClass() which looks for mapping file in classpath (class foo.Bar -> foo/Bar.hbm.xml) +* improved documentation + +Changes in version 0.9.2 (25.1.2002) +------------------------------------ +* iterate over query results (lazy instantiation of query results) +* added "select foo, bar" style queries returning multiple objects per row +* delete by query +* composite key support +* outer joins for faster (?) loading of associated objects ( set "hibernate.use_outer_join" to "true" ) +* connection pooling when using DriverManager +* foreign key constraint from unkeyed collection table to owner entity table +* improved drop tables script execution (still not infallible) +* added <composite-element> tag +* added not-null properties and elements +* added an optimisation for dates and components +* made some XML attributes optional +* fixed errors in documentation + documented some extra features +* bugfix: store() not getting called on lifecycle interface +* bugfix: schema generation for indexed associations +* added many tests + +Changes in version 0.9.1 (20.1.2002) +------------------------------------ +Too many to list + +Changes in version 0.8.1 (30.11.2001) +------------------------------------- +Initial alpha version + diff --git a/plugins/org.eclipse.emf.cdo.server.hibernate/lib/lgpl.txt b/plugins/org.eclipse.emf.cdo.server.hibernate/lib/lgpl.txt new file mode 100644 index 0000000000..1c03f74b99 --- /dev/null +++ b/plugins/org.eclipse.emf.cdo.server.hibernate/lib/lgpl.txt @@ -0,0 +1,504 @@ + GNU LESSER GENERAL PUBLIC LICENSE + Version 2.1, February 1999 + + Copyright (C) 1991, 1999 Free Software Foundation, Inc. + 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + +[This is the first released version of the Lesser GPL. It also counts + as the successor of the GNU Library Public License, version 2, hence + the version number 2.1.] + + Preamble + + The licenses for most software are designed to take away your +freedom to share and change it. By contrast, the GNU General Public +Licenses are intended to guarantee your freedom to share and change +free software--to make sure the software is free for all its users. + + This license, the Lesser General Public License, applies to some +specially designated software packages--typically libraries--of the +Free Software Foundation and other authors who decide to use it. You +can use it too, but we suggest you first think carefully about whether +this license or the ordinary General Public License is the better +strategy to use in any particular case, based on the explanations below. + + When we speak of free software, we are referring to freedom of use, +not price. Our General Public Licenses are designed to make sure that +you have the freedom to distribute copies of free software (and charge +for this service if you wish); that you receive source code or can get +it if you want it; that you can change the software and use pieces of +it in new free programs; and that you are informed that you can do +these things. + + To protect your rights, we need to make restrictions that forbid +distributors to deny you these rights or to ask you to surrender these +rights. These restrictions translate to certain responsibilities for +you if you distribute copies of the library or if you modify it. + + For example, if you distribute copies of the library, whether gratis +or for a fee, you must give the recipients all the rights that we gave +you. You must make sure that they, too, receive or can get the source +code. If you link other code with the library, you must provide +complete object files to the recipients, so that they can relink them +with the library after making changes to the library and recompiling +it. And you must show them these terms so they know their rights. + + We protect your rights with a two-step method: (1) we copyright the +library, and (2) we offer you this license, which gives you legal +permission to copy, distribute and/or modify the library. + + To protect each distributor, we want to make it very clear that +there is no warranty for the free library. Also, if the library is +modified by someone else and passed on, the recipients should know +that what they have is not the original version, so that the original +author's reputation will not be affected by problems that might be +introduced by others. + + Finally, software patents pose a constant threat to the existence of +any free program. We wish to make sure that a company cannot +effectively restrict the users of a free program by obtaining a +restrictive license from a patent holder. Therefore, we insist that +any patent license obtained for a version of the library must be +consistent with the full freedom of use specified in this license. + + Most GNU software, including some libraries, is covered by the +ordinary GNU General Public License. This license, the GNU Lesser +General Public License, applies to certain designated libraries, and +is quite different from the ordinary General Public License. We use +this license for certain libraries in order to permit linking those +libraries into non-free programs. + + When a program is linked with a library, whether statically or using +a shared library, the combination of the two is legally speaking a +combined work, a derivative of the original library. The ordinary +General Public License therefore permits such linking only if the +entire combination fits its criteria of freedom. The Lesser General +Public License permits more lax criteria for linking other code with +the library. + + We call this license the "Lesser" General Public License because it +does Less to protect the user's freedom than the ordinary General +Public License. It also provides other free software developers Less +of an advantage over competing non-free programs. These disadvantages +are the reason we use the ordinary General Public License for many +libraries. However, the Lesser license provides advantages in certain +special circumstances. + + For example, on rare occasions, there may be a special need to +encourage the widest possible use of a certain library, so that it becomes +a de-facto standard. To achieve this, non-free programs must be +allowed to use the library. A more frequent case is that a free +library does the same job as widely used non-free libraries. In this +case, there is little to gain by limiting the free library to free +software only, so we use the Lesser General Public License. + + In other cases, permission to use a particular library in non-free +programs enables a greater number of people to use a large body of +free software. For example, permission to use the GNU C Library in +non-free programs enables many more people to use the whole GNU +operating system, as well as its variant, the GNU/Linux operating +system. + + Although the Lesser General Public License is Less protective of the +users' freedom, it does ensure that the user of a program that is +linked with the Library has the freedom and the wherewithal to run +that program using a modified version of the Library. + + The precise terms and conditions for copying, distribution and +modification follow. Pay close attention to the difference between a +"work based on the library" and a "work that uses the library". The +former contains code derived from the library, whereas the latter must +be combined with the library in order to run. + + GNU LESSER GENERAL PUBLIC LICENSE + TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + + 0. This License Agreement applies to any software library or other +program which contains a notice placed by the copyright holder or +other authorized party saying it may be distributed under the terms of +this Lesser General Public License (also called "this License"). +Each licensee is addressed as "you". + + A "library" means a collection of software functions and/or data +prepared so as to be conveniently linked with application programs +(which use some of those functions and data) to form executables. + + The "Library", below, refers to any such software library or work +which has been distributed under these terms. A "work based on the +Library" means either the Library or any derivative work under +copyright law: that is to say, a work containing the Library or a +portion of it, either verbatim or with modifications and/or translated +straightforwardly into another language. (Hereinafter, translation is +included without limitation in the term "modification".) + + "Source code" for a work means the preferred form of the work for +making modifications to it. For a library, complete source code means +all the source code for all modules it contains, plus any associated +interface definition files, plus the scripts used to control compilation +and installation of the library. + + Activities other than copying, distribution and modification are not +covered by this License; they are outside its scope. The act of +running a program using the Library is not restricted, and output from +such a program is covered only if its contents constitute a work based +on the Library (independent of the use of the Library in a tool for +writing it). Whether that is true depends on what the Library does +and what the program that uses the Library does. + + 1. You may copy and distribute verbatim copies of the Library's +complete source code as you receive it, in any medium, provided that +you conspicuously and appropriately publish on each copy an +appropriate copyright notice and disclaimer of warranty; keep intact +all the notices that refer to this License and to the absence of any +warranty; and distribute a copy of this License along with the +Library. + + You may charge a fee for the physical act of transferring a copy, +and you may at your option offer warranty protection in exchange for a +fee. + + 2. You may modify your copy or copies of the Library or any portion +of it, thus forming a work based on the Library, and copy and +distribute such modifications or work under the terms of Section 1 +above, provided that you also meet all of these conditions: + + a) The modified work must itself be a software library. + + b) You must cause the files modified to carry prominent notices + stating that you changed the files and the date of any change. + + c) You must cause the whole of the work to be licensed at no + charge to all third parties under the terms of this License. + + d) If a facility in the modified Library refers to a function or a + table of data to be supplied by an application program that uses + the facility, other than as an argument passed when the facility + is invoked, then you must make a good faith effort to ensure that, + in the event an application does not supply such function or + table, the facility still operates, and performs whatever part of + its purpose remains meaningful. + + (For example, a function in a library to compute square roots has + a purpose that is entirely well-defined independent of the + application. Therefore, Subsection 2d requires that any + application-supplied function or table used by this function must + be optional: if the application does not supply it, the square + root function must still compute square roots.) + +These requirements apply to the modified work as a whole. If +identifiable sections of that work are not derived from the Library, +and can be reasonably considered independent and separate works in +themselves, then this License, and its terms, do not apply to those +sections when you distribute them as separate works. But when you +distribute the same sections as part of a whole which is a work based +on the Library, the distribution of the whole must be on the terms of +this License, whose permissions for other licensees extend to the +entire whole, and thus to each and every part regardless of who wrote +it. + +Thus, it is not the intent of this section to claim rights or contest +your rights to work written entirely by you; rather, the intent is to +exercise the right to control the distribution of derivative or +collective works based on the Library. + +In addition, mere aggregation of another work not based on the Library +with the Library (or with a work based on the Library) on a volume of +a storage or distribution medium does not bring the other work under +the scope of this License. + + 3. You may opt to apply the terms of the ordinary GNU General Public +License instead of this License to a given copy of the Library. To do +this, you must alter all the notices that refer to this License, so +that they refer to the ordinary GNU General Public License, version 2, +instead of to this License. (If a newer version than version 2 of the +ordinary GNU General Public License has appeared, then you can specify +that version instead if you wish.) Do not make any other change in +these notices. + + Once this change is made in a given copy, it is irreversible for +that copy, so the ordinary GNU General Public License applies to all +subsequent copies and derivative works made from that copy. + + This option is useful when you wish to copy part of the code of +the Library into a program that is not a library. + + 4. You may copy and distribute the Library (or a portion or +derivative of it, under Section 2) in object code or executable form +under the terms of Sections 1 and 2 above provided that you accompany +it with the complete corresponding machine-readable source code, which +must be distributed under the terms of Sections 1 and 2 above on a +medium customarily used for software interchange. + + If distribution of object code is made by offering access to copy +from a designated place, then offering equivalent access to copy the +source code from the same place satisfies the requirement to +distribute the source code, even though third parties are not +compelled to copy the source along with the object code. + + 5. A program that contains no derivative of any portion of the +Library, but is designed to work with the Library by being compiled or +linked with it, is called a "work that uses the Library". Such a +work, in isolation, is not a derivative work of the Library, and +therefore falls outside the scope of this License. + + However, linking a "work that uses the Library" with the Library +creates an executable that is a derivative of the Library (because it +contains portions of the Library), rather than a "work that uses the +library". The executable is therefore covered by this License. +Section 6 states terms for distribution of such executables. + + When a "work that uses the Library" uses material from a header file +that is part of the Library, the object code for the work may be a +derivative work of the Library even though the source code is not. +Whether this is true is especially significant if the work can be +linked without the Library, or if the work is itself a library. The +threshold for this to be true is not precisely defined by law. + + If such an object file uses only numerical parameters, data +structure layouts and accessors, and small macros and small inline +functions (ten lines or less in length), then the use of the object +file is unrestricted, regardless of whether it is legally a derivative +work. (Executables containing this object code plus portions of the +Library will still fall under Section 6.) + + Otherwise, if the work is a derivative of the Library, you may +distribute the object code for the work under the terms of Section 6. +Any executables containing that work also fall under Section 6, +whether or not they are linked directly with the Library itself. + + 6. As an exception to the Sections above, you may also combine or +link a "work that uses the Library" with the Library to produce a +work containing portions of the Library, and distribute that work +under terms of your choice, provided that the terms permit +modification of the work for the customer's own use and reverse +engineering for debugging such modifications. + + You must give prominent notice with each copy of the work that the +Library is used in it and that the Library and its use are covered by +this License. You must supply a copy of this License. If the work +during execution displays copyright notices, you must include the +copyright notice for the Library among them, as well as a reference +directing the user to the copy of this License. Also, you must do one +of these things: + + a) Accompany the work with the complete corresponding + machine-readable source code for the Library including whatever + changes were used in the work (which must be distributed under + Sections 1 and 2 above); and, if the work is an executable linked + with the Library, with the complete machine-readable "work that + uses the Library", as object code and/or source code, so that the + user can modify the Library and then relink to produce a modified + executable containing the modified Library. (It is understood + that the user who changes the contents of definitions files in the + Library will not necessarily be able to recompile the application + to use the modified definitions.) + + b) Use a suitable shared library mechanism for linking with the + Library. A suitable mechanism is one that (1) uses at run time a + copy of the library already present on the user's computer system, + rather than copying library functions into the executable, and (2) + will operate properly with a modified version of the library, if + the user installs one, as long as the modified version is + interface-compatible with the version that the work was made with. + + c) Accompany the work with a written offer, valid for at + least three years, to give the same user the materials + specified in Subsection 6a, above, for a charge no more + than the cost of performing this distribution. + + d) If distribution of the work is made by offering access to copy + from a designated place, offer equivalent access to copy the above + specified materials from the same place. + + e) Verify that the user has already received a copy of these + materials or that you have already sent this user a copy. + + For an executable, the required form of the "work that uses the +Library" must include any data and utility programs needed for +reproducing the executable from it. However, as a special exception, +the materials to be distributed need not include anything that is +normally distributed (in either source or binary form) with the major +components (compiler, kernel, and so on) of the operating system on +which the executable runs, unless that component itself accompanies +the executable. + + It may happen that this requirement contradicts the license +restrictions of other proprietary libraries that do not normally +accompany the operating system. Such a contradiction means you cannot +use both them and the Library together in an executable that you +distribute. + + 7. You may place library facilities that are a work based on the +Library side-by-side in a single library together with other library +facilities not covered by this License, and distribute such a combined +library, provided that the separate distribution of the work based on +the Library and of the other library facilities is otherwise +permitted, and provided that you do these two things: + + a) Accompany the combined library with a copy of the same work + based on the Library, uncombined with any other library + facilities. This must be distributed under the terms of the + Sections above. + + b) Give prominent notice with the combined library of the fact + that part of it is a work based on the Library, and explaining + where to find the accompanying uncombined form of the same work. + + 8. You may not copy, modify, sublicense, link with, or distribute +the Library except as expressly provided under this License. Any +attempt otherwise to copy, modify, sublicense, link with, or +distribute the Library is void, and will automatically terminate your +rights under this License. However, parties who have received copies, +or rights, from you under this License will not have their licenses +terminated so long as such parties remain in full compliance. + + 9. You are not required to accept this License, since you have not +signed it. However, nothing else grants you permission to modify or +distribute the Library or its derivative works. These actions are +prohibited by law if you do not accept this License. Therefore, by +modifying or distributing the Library (or any work based on the +Library), you indicate your acceptance of this License to do so, and +all its terms and conditions for copying, distributing or modifying +the Library or works based on it. + + 10. Each time you redistribute the Library (or any work based on the +Library), the recipient automatically receives a license from the +original licensor to copy, distribute, link with or modify the Library +subject to these terms and conditions. You may not impose any further +restrictions on the recipients' exercise of the rights granted herein. +You are not responsible for enforcing compliance by third parties with +this License. + + 11. If, as a consequence of a court judgment or allegation of patent +infringement or for any other reason (not limited to patent issues), +conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot +distribute so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you +may not distribute the Library at all. For example, if a patent +license would not permit royalty-free redistribution of the Library by +all those who receive copies directly or indirectly through you, then +the only way you could satisfy both it and this License would be to +refrain entirely from distribution of the Library. + +If any portion of this section is held invalid or unenforceable under any +particular circumstance, the balance of the section is intended to apply, +and the section as a whole is intended to apply in other circumstances. + +It is not the purpose of this section to induce you to infringe any +patents or other property right claims or to contest validity of any +such claims; this section has the sole purpose of protecting the +integrity of the free software distribution system which is +implemented by public license practices. Many people have made +generous contributions to the wide range of software distributed +through that system in reliance on consistent application of that +system; it is up to the author/donor to decide if he or she is willing +to distribute software through any other system and a licensee cannot +impose that choice. + +This section is intended to make thoroughly clear what is believed to +be a consequence of the rest of this License. + + 12. If the distribution and/or use of the Library is restricted in +certain countries either by patents or by copyrighted interfaces, the +original copyright holder who places the Library under this License may add +an explicit geographical distribution limitation excluding those countries, +so that distribution is permitted only in or among countries not thus +excluded. In such case, this License incorporates the limitation as if +written in the body of this License. + + 13. The Free Software Foundation may publish revised and/or new +versions of the Lesser General Public License from time to time. +Such new versions will be similar in spirit to the present version, +but may differ in detail to address new problems or concerns. + +Each version is given a distinguishing version number. If the Library +specifies a version number of this License which applies to it and +"any later version", you have the option of following the terms and +conditions either of that version or of any later version published by +the Free Software Foundation. If the Library does not specify a +license version number, you may choose any version ever published by +the Free Software Foundation. + + 14. If you wish to incorporate parts of the Library into other free +programs whose distribution conditions are incompatible with these, +write to the author to ask for permission. For software which is +copyrighted by the Free Software Foundation, write to the Free +Software Foundation; we sometimes make exceptions for this. Our +decision will be guided by the two goals of preserving the free status +of all derivatives of our free software and of promoting the sharing +and reuse of software generally. + + NO WARRANTY + + 15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO +WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW. +EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR +OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY +KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE +LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME +THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. + + 16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN +WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY +AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU +FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR +CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE +LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING +RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A +FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF +SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH +DAMAGES. + + END OF TERMS AND CONDITIONS + + How to Apply These Terms to Your New Libraries + + If you develop a new library, and you want it to be of the greatest +possible use to the public, we recommend making it free software that +everyone can redistribute and change. You can do so by permitting +redistribution under these terms (or, alternatively, under the terms of the +ordinary General Public License). + + To apply these terms, attach the following notices to the library. It is +safest to attach them to the start of each source file to most effectively +convey the exclusion of warranty; and each file should have at least the +"copyright" line and a pointer to where the full notice is found. + + <one line to give the library's name and a brief idea of what it does.> + Copyright (C) <year> <name of author> + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +Also add information on how to contact you by electronic and paper mail. + +You should also get your employer (if you work as a programmer) or your +school, if any, to sign a "copyright disclaimer" for the library, if +necessary. Here is a sample; alter the names: + + Yoyodyne, Inc., hereby disclaims all copyright interest in the + library `Frob' (a library for tweaking knobs) written by James Random Hacker. + + <signature of Ty Coon>, 1 April 1990 + Ty Coon, President of Vice + +That's all there is to it! + + diff --git a/plugins/org.eclipse.emf.cdo.server.hibernate/lib/readme.txt b/plugins/org.eclipse.emf.cdo.server.hibernate/lib/readme.txt new file mode 100644 index 0000000000..cd51d82ed1 --- /dev/null +++ b/plugins/org.eclipse.emf.cdo.server.hibernate/lib/readme.txt @@ -0,0 +1,54 @@ +Hibernate - Relational Persistence for Idiomatic Java +===================================================== +version 3.2.5, July 31, 2007 + +Instructions +------------ +Unzip to installation directory. + +See index.html in the doc/reference directory. + +Required jars are distributed in the lib subdirectory. + +Latest Documentation: + + http://hibernate.org + +Bug Reports: + + Hibernate JIRA (preferred) + hibernate-devel@lists.sourceforge.net + +Free Technical Support: + + http://forum.hibernate.org + +Commercial Support and Training: + + http://hibernate.org/SupportTraining + + +Get Up And Running Quick +------------------------ +Demo: + + (1) copy your JDBC driver to the lib directory + (2) edit etc/hibernate.properties + (3) run "ant eg" or "build eg" + (4) browse the sourcecode in eg/org/hibernate/auction + +Tests: + + (1) copy your JDBC driver to the lib directory + (2) edit etc/hibernate.properties + (3) run "ant junitreport" or "build junitreport" + (4) see build/test-reports/index.html + + +Other Stuff +----------- +This software is distributed under the terms of the FSF Lesser Gnu +Public License (see lgpl.txt). + +This product includes software developed by the Apache Software +Foundation (http://www.apache.org/). diff --git a/plugins/org.eclipse.emf.cdo.server.hibernate/license.html b/plugins/org.eclipse.emf.cdo.server.hibernate/license.html new file mode 100644 index 0000000000..d7b88e9416 --- /dev/null +++ b/plugins/org.eclipse.emf.cdo.server.hibernate/license.html @@ -0,0 +1,319 @@ +<html xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns="http://www.w3.org/TR/REC-html40"><head> +<meta http-equiv="Content-Type" content="text/html; charset=windows-1252"> +<meta name="ProgId" content="Word.Document"> +<meta name="Generator" content="Microsoft Word 9"> +<meta name="Originator" content="Microsoft Word 9"> +<link rel="File-List" href="http://www.eclipse.org/org/documents/Eclipse%20EPL%202003_11_10%20Final_files/filelist.xml"><title>Eclipse Public License - Version 1.0</title><!--[if gte mso 9]><xml> + <o:DocumentProperties> + <o:Revision>2</o:Revision> + <o:TotalTime>3</o:TotalTime> + <o:Created>2004-03-05T23:03:00Z</o:Created> + <o:LastSaved>2004-03-05T23:03:00Z</o:LastSaved> + <o:Pages>4</o:Pages> + <o:Words>1626</o:Words> + <o:Characters>9270</o:Characters> + <o:Lines>77</o:Lines> + <o:Paragraphs>18</o:Paragraphs> + <o:CharactersWithSpaces>11384</o:CharactersWithSpaces> + <o:Version>9.4402</o:Version> + </o:DocumentProperties> +</xml><![endif]--><!--[if gte mso 9]><xml> + <w:WordDocument> + <w:TrackRevisions/> + </w:WordDocument> +</xml><![endif]--> + + +<style> +<!-- + /* Font Definitions */ +@font-face + {font-family:Tahoma; + panose-1:2 11 6 4 3 5 4 4 2 4; + mso-font-charset:0; + mso-generic-font-family:swiss; + mso-font-pitch:variable; + mso-font-signature:553679495 -2147483648 8 0 66047 0;} + /* Style Definitions */ +p.MsoNormal, li.MsoNormal, div.MsoNormal + {mso-style-parent:""; + margin:0in; + margin-bottom:.0001pt; + mso-pagination:widow-orphan; + font-size:12.0pt; + font-family:"Times New Roman"; + mso-fareast-font-family:"Times New Roman";} +p + {margin-right:0in; + mso-margin-top-alt:auto; + mso-margin-bottom-alt:auto; + margin-left:0in; + mso-pagination:widow-orphan; + font-size:12.0pt; + font-family:"Times New Roman"; + mso-fareast-font-family:"Times New Roman";} +p.BalloonText, li.BalloonText, div.BalloonText + {mso-style-name:"Balloon Text"; + margin:0in; + margin-bottom:.0001pt; + mso-pagination:widow-orphan; + font-size:8.0pt; + font-family:Tahoma; + mso-fareast-font-family:"Times New Roman";} +@page Section1 + {size:8.5in 11.0in; + margin:1.0in 1.25in 1.0in 1.25in; + mso-header-margin:.5in; + mso-footer-margin:.5in; + mso-paper-source:0;} +div.Section1 + {page:Section1;} +--> +</style></head> + +<body style="" lang="EN-US"> + +<div class="Section1"> + +<p style="text-align: center;" align="center"><b>Eclipse Public License - v 1.0</b> +</p> + +<p><span style="font-size: 10pt;">THE ACCOMPANYING PROGRAM IS PROVIDED UNDER +THE TERMS OF THIS ECLIPSE PUBLIC LICENSE ("AGREEMENT"). ANY USE, +REPRODUCTION OR DISTRIBUTION OF THE PROGRAM CONSTITUTES RECIPIENT'S ACCEPTANCE +OF THIS AGREEMENT.</span> </p> + +<p><b><span style="font-size: 10pt;">1. DEFINITIONS</span></b> </p> + +<p><span style="font-size: 10pt;">"Contribution" means:</span> </p> + +<p class="MsoNormal" style="margin-left: 0.5in;"><span style="font-size: 10pt;">a) +in the case of the initial Contributor, the initial code and documentation +distributed under this Agreement, and<br clear="left"> +b) in the case of each subsequent Contributor:</span></p> + +<p class="MsoNormal" style="margin-left: 0.5in;"><span style="font-size: 10pt;">i) +changes to the Program, and</span></p> + +<p class="MsoNormal" style="margin-left: 0.5in;"><span style="font-size: 10pt;">ii) +additions to the Program;</span></p> + +<p class="MsoNormal" style="margin-left: 0.5in;"><span style="font-size: 10pt;">where +such changes and/or additions to the Program originate from and are distributed +by that particular Contributor. A Contribution 'originates' from a Contributor +if it was added to the Program by such Contributor itself or anyone acting on +such Contributor's behalf. Contributions do not include additions to the +Program which: (i) are separate modules of software distributed in conjunction +with the Program under their own license agreement, and (ii) are not derivative +works of the Program. </span></p> + +<p><span style="font-size: 10pt;">"Contributor" means any person or +entity that distributes the Program.</span> </p> + +<p><span style="font-size: 10pt;">"Licensed Patents " mean patent +claims licensable by a Contributor which are necessarily infringed by the use +or sale of its Contribution alone or when combined with the Program. </span></p> + +<p><span style="font-size: 10pt;">"Program" means the Contributions +distributed in accordance with this Agreement.</span> </p> + +<p><span style="font-size: 10pt;">"Recipient" means anyone who +receives the Program under this Agreement, including all Contributors.</span> </p> + +<p><b><span style="font-size: 10pt;">2. GRANT OF RIGHTS</span></b> </p> + +<p class="MsoNormal" style="margin-left: 0.5in;"><span style="font-size: 10pt;">a) +Subject to the terms of this Agreement, each Contributor hereby grants Recipient +a non-exclusive, worldwide, royalty-free copyright license to<span style="color: red;"> </span>reproduce, prepare derivative works of, publicly +display, publicly perform, distribute and sublicense the Contribution of such +Contributor, if any, and such derivative works, in source code and object code +form.</span></p> + +<p class="MsoNormal" style="margin-left: 0.5in;"><span style="font-size: 10pt;">b) +Subject to the terms of this Agreement, each Contributor hereby grants +Recipient a non-exclusive, worldwide,<span style="color: green;"> </span>royalty-free +patent license under Licensed Patents to make, use, sell, offer to sell, import +and otherwise transfer the Contribution of such Contributor, if any, in source +code and object code form. This patent license shall apply to the combination +of the Contribution and the Program if, at the time the Contribution is added +by the Contributor, such addition of the Contribution causes such combination +to be covered by the Licensed Patents. The patent license shall not apply to +any other combinations which include the Contribution. No hardware per se is +licensed hereunder. </span></p> + +<p class="MsoNormal" style="margin-left: 0.5in;"><span style="font-size: 10pt;">c) +Recipient understands that although each Contributor grants the licenses to its +Contributions set forth herein, no assurances are provided by any Contributor +that the Program does not infringe the patent or other intellectual property +rights of any other entity. Each Contributor disclaims any liability to Recipient +for claims brought by any other entity based on infringement of intellectual +property rights or otherwise. As a condition to exercising the rights and +licenses granted hereunder, each Recipient hereby assumes sole responsibility +to secure any other intellectual property rights needed, if any. For example, +if a third party patent license is required to allow Recipient to distribute +the Program, it is Recipient's responsibility to acquire that license before +distributing the Program.</span></p> + +<p class="MsoNormal" style="margin-left: 0.5in;"><span style="font-size: 10pt;">d) +Each Contributor represents that to its knowledge it has sufficient copyright +rights in its Contribution, if any, to grant the copyright license set forth in +this Agreement. </span></p> + +<p><b><span style="font-size: 10pt;">3. REQUIREMENTS</span></b> </p> + +<p><span style="font-size: 10pt;">A Contributor may choose to distribute the +Program in object code form under its own license agreement, provided that:</span> +</p> + +<p class="MsoNormal" style="margin-left: 0.5in;"><span style="font-size: 10pt;">a) +it complies with the terms and conditions of this Agreement; and</span></p> + +<p class="MsoNormal" style="margin-left: 0.5in;"><span style="font-size: 10pt;">b) +its license agreement:</span></p> + +<p class="MsoNormal" style="margin-left: 0.5in;"><span style="font-size: 10pt;">i) +effectively disclaims on behalf of all Contributors all warranties and +conditions, express and implied, including warranties or conditions of title +and non-infringement, and implied warranties or conditions of merchantability +and fitness for a particular purpose; </span></p> + +<p class="MsoNormal" style="margin-left: 0.5in;"><span style="font-size: 10pt;">ii) +effectively excludes on behalf of all Contributors all liability for damages, +including direct, indirect, special, incidental and consequential damages, such +as lost profits; </span></p> + +<p class="MsoNormal" style="margin-left: 0.5in;"><span style="font-size: 10pt;">iii) +states that any provisions which differ from this Agreement are offered by that +Contributor alone and not by any other party; and</span></p> + +<p class="MsoNormal" style="margin-left: 0.5in;"><span style="font-size: 10pt;">iv) +states that source code for the Program is available from such Contributor, and +informs licensees how to obtain it in a reasonable manner on or through a +medium customarily used for software exchange.<span style="color: blue;"> </span></span></p> + +<p><span style="font-size: 10pt;">When the Program is made available in source +code form:</span> </p> + +<p class="MsoNormal" style="margin-left: 0.5in;"><span style="font-size: 10pt;">a) +it must be made available under this Agreement; and </span></p> + +<p class="MsoNormal" style="margin-left: 0.5in;"><span style="font-size: 10pt;">b) a +copy of this Agreement must be included with each copy of the Program. </span></p> + +<p><span style="font-size: 10pt;">Contributors may not remove or alter any +copyright notices contained within the Program. </span></p> + +<p><span style="font-size: 10pt;">Each Contributor must identify itself as the +originator of its Contribution, if any, in a manner that reasonably allows +subsequent Recipients to identify the originator of the Contribution. </span></p> + +<p><b><span style="font-size: 10pt;">4. COMMERCIAL DISTRIBUTION</span></b> </p> + +<p><span style="font-size: 10pt;">Commercial distributors of software may +accept certain responsibilities with respect to end users, business partners +and the like. While this license is intended to facilitate the commercial use +of the Program, the Contributor who includes the Program in a commercial +product offering should do so in a manner which does not create potential +liability for other Contributors. Therefore, if a Contributor includes the +Program in a commercial product offering, such Contributor ("Commercial +Contributor") hereby agrees to defend and indemnify every other +Contributor ("Indemnified Contributor") against any losses, damages and +costs (collectively "Losses") arising from claims, lawsuits and other +legal actions brought by a third party against the Indemnified Contributor to +the extent caused by the acts or omissions of such Commercial Contributor in +connection with its distribution of the Program in a commercial product +offering. The obligations in this section do not apply to any claims or Losses +relating to any actual or alleged intellectual property infringement. In order +to qualify, an Indemnified Contributor must: a) promptly notify the Commercial +Contributor in writing of such claim, and b) allow the Commercial Contributor +to control, and cooperate with the Commercial Contributor in, the defense and +any related settlement negotiations. The Indemnified Contributor may participate +in any such claim at its own expense.</span> </p> + +<p><span style="font-size: 10pt;">For example, a Contributor might include the +Program in a commercial product offering, Product X. That Contributor is then a +Commercial Contributor. If that Commercial Contributor then makes performance +claims, or offers warranties related to Product X, those performance claims and +warranties are such Commercial Contributor's responsibility alone. Under this +section, the Commercial Contributor would have to defend claims against the +other Contributors related to those performance claims and warranties, and if a +court requires any other Contributor to pay any damages as a result, the +Commercial Contributor must pay those damages.</span> </p> + +<p><b><span style="font-size: 10pt;">5. NO WARRANTY</span></b> </p> + +<p><span style="font-size: 10pt;">EXCEPT AS EXPRESSLY SET FORTH IN THIS +AGREEMENT, THE PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT +WARRANTIES OR CONDITIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED INCLUDING, +WITHOUT LIMITATION, ANY WARRANTIES OR CONDITIONS OF TITLE, NON-INFRINGEMENT, +MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. Each Recipient is solely +responsible for determining the appropriateness of using and distributing the +Program and assumes all risks associated with its exercise of rights under this +Agreement , including but not limited to the risks and costs of program errors, +compliance with applicable laws, damage to or loss of data, programs or +equipment, and unavailability or interruption of operations. </span></p> + +<p><b><span style="font-size: 10pt;">6. DISCLAIMER OF LIABILITY</span></b> </p> + +<p><span style="font-size: 10pt;">EXCEPT AS EXPRESSLY SET FORTH IN THIS +AGREEMENT, NEITHER RECIPIENT NOR ANY CONTRIBUTORS SHALL HAVE ANY LIABILITY FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING WITHOUT LIMITATION LOST PROFITS), HOWEVER CAUSED AND ON ANY THEORY +OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING +NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OR DISTRIBUTION OF +THE PROGRAM OR THE EXERCISE OF ANY RIGHTS GRANTED HEREUNDER, EVEN IF ADVISED OF +THE POSSIBILITY OF SUCH DAMAGES.</span> </p> + +<p><b><span style="font-size: 10pt;">7. GENERAL</span></b> </p> + +<p><span style="font-size: 10pt;">If any provision of this Agreement is invalid +or unenforceable under applicable law, it shall not affect the validity or +enforceability of the remainder of the terms of this Agreement, and without +further action by the parties hereto, such provision shall be reformed to the +minimum extent necessary to make such provision valid and enforceable.</span> </p> + +<p><span style="font-size: 10pt;">If Recipient institutes patent litigation +against any entity (including a cross-claim or counterclaim in a lawsuit) +alleging that the Program itself (excluding combinations of the Program with +other software or hardware) infringes such Recipient's patent(s), then such +Recipient's rights granted under Section 2(b) shall terminate as of the date +such litigation is filed. </span></p> + +<p><span style="font-size: 10pt;">All Recipient's rights under this Agreement +shall terminate if it fails to comply with any of the material terms or +conditions of this Agreement and does not cure such failure in a reasonable +period of time after becoming aware of such noncompliance. If all Recipient's +rights under this Agreement terminate, Recipient agrees to cease use and +distribution of the Program as soon as reasonably practicable. However, +Recipient's obligations under this Agreement and any licenses granted by +Recipient relating to the Program shall continue and survive. </span></p> + +<p><span style="font-size: 10pt;">Everyone is permitted to copy and distribute +copies of this Agreement, but in order to avoid inconsistency the Agreement is +copyrighted and may only be modified in the following manner. The Agreement +Steward reserves the right to publish new versions (including revisions) of +this Agreement from time to time. No one other than the Agreement Steward has +the right to modify this Agreement. The Eclipse Foundation is the initial +Agreement Steward. The Eclipse Foundation may assign the responsibility to +serve as the Agreement Steward to a suitable separate entity. Each new version +of the Agreement will be given a distinguishing version number. The Program +(including Contributions) may always be distributed subject to the version of +the Agreement under which it was received. In addition, after a new version of +the Agreement is published, Contributor may elect to distribute the Program +(including its Contributions) under the new version. Except as expressly stated +in Sections 2(a) and 2(b) above, Recipient receives no rights or licenses to +the intellectual property of any Contributor under this Agreement, whether +expressly, by implication, estoppel or otherwise. All rights in the Program not +expressly granted under this Agreement are reserved.</span> </p> + +<p><span style="font-size: 10pt;">This Agreement is governed by the laws of the +State of New York and the intellectual property laws of the United States of +America. No party to this Agreement will bring a legal action under this +Agreement more than one year after the cause of action arose. Each party waives +its rights to a jury trial in any resulting litigation.</span> </p> + +<p class="MsoNormal"><!--[if !supportEmptyParas]--> <!--[endif]--><o:p></o:p></p> + +</div> + +</body></html>
\ No newline at end of file diff --git a/plugins/org.eclipse.emf.cdo.server.hibernate/mappings/meta.hbm.xml b/plugins/org.eclipse.emf.cdo.server.hibernate/mappings/meta.hbm.xml new file mode 100644 index 0000000000..f3c709c040 --- /dev/null +++ b/plugins/org.eclipse.emf.cdo.server.hibernate/mappings/meta.hbm.xml @@ -0,0 +1,70 @@ +<?xml version="1.0"?> +<!DOCTYPE hibernate-mapping SYSTEM "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd"> +<hibernate-mapping package="org.eclipse.emf.cdo.internal.protocol.model"> + + <class name="CDOModelElementImpl" table="cdo_modelelements" lazy="false"> + <id name="serverInfo" column="id" type="int"> + <generator class="increment" /> + </id> + <property name="name" type="string" not-null="true" length="255" /> + </class> + + <joined-subclass name="CDOPackageImpl" table="cdo_packages" lazy="false" extends="CDOModelElementImpl"> + <key/> + <property name="packageURI" column="uri" type="string" not-null="true" length="255" /> + <property name="ecore" type="text" not-null="false" /> + <property name="dynamic" type="boolean" not-null="true" /> + + <property name="metaIDRange" + type="org.eclipse.emf.cdo.server.internal.hibernate.tuplizer.CDOIDMetaRangeUserType" not-null="true"> + <column name="metaIDStart" /> + <column name="metaIDSize" /> + </property> + + <list name="classes" lazy="false" cascade="all, delete-orphan" access="field"> + <key /> + <list-index /> + <one-to-many class="CDOClassImpl" /> + </list> + + </joined-subclass> + + <class name="CDOClassProxy" table="cdo_classes_proxy" lazy="false"> + <id column="id" type="int"> + <generator class="increment" /> + </id> + <!-- set to not-null=false because it is nullified because of persist order --> + <many-to-one name="cdoClass" class="CDOClassImpl" not-null="false" cascade="merge,persist,save-update,lock,refresh" column="cdoclass"/> + </class> + + <joined-subclass name="CDOClassImpl" table="cdo_classes" lazy="false" extends="CDOModelElementImpl"> + <key/> + <property name="classifierID" column="classifier" type="int" not-null="true" /> + <property name="abstract" column="abstract" type="boolean" not-null="true" /> + + <list name="superTypes" lazy="false" cascade="merge,persist,save-update,lock,refresh" access="field"> + <key> + <column name="supertype"/> + </key> + <list-index /> + <many-to-many class="CDOClassProxy" /> + </list> + + <list name="features" lazy="false" cascade="all, delete-orphan" access="field"> + <key /> + <list-index /> + <one-to-many class="CDOFeatureImpl" /> + </list> + </joined-subclass> + + <joined-subclass name="CDOFeatureImpl" table="cdo_features" extends="CDOModelElementImpl"> + <key/> + <property name="featureID" column="feature" type="int" not-null="true" /> + <property name="type" type="org.eclipse.emf.cdo.server.internal.hibernate.tuplizer.CDOTypeUserType" + not-null="false" /> + <many-to-one name="referenceCDOClass" class="CDOClassImpl" column="reftype" not-null="false" cascade="persist, merge, save-update, evict, replicate, lock, refresh"/> + <property name="many" type="boolean" not-null="true" /> + <property name="containment" type="boolean" not-null="false" /> + </joined-subclass> + +</hibernate-mapping>
\ No newline at end of file diff --git a/plugins/org.eclipse.emf.cdo.server.hibernate/mappings/product.hbm.xml b/plugins/org.eclipse.emf.cdo.server.hibernate/mappings/product.hbm.xml new file mode 100644 index 0000000000..174d68a56f --- /dev/null +++ b/plugins/org.eclipse.emf.cdo.server.hibernate/mappings/product.hbm.xml @@ -0,0 +1,218 @@ +<?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.server.hibernate/mappings/resource.hbm.xml b/plugins/org.eclipse.emf.cdo.server.hibernate/mappings/resource.hbm.xml new file mode 100644 index 0000000000..2f67dcf344 --- /dev/null +++ b/plugins/org.eclipse.emf.cdo.server.hibernate/mappings/resource.hbm.xml @@ -0,0 +1,28 @@ +<?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="CDOResource" abstract="false" lazy="false" discriminator-value="cdoresource" table="`cdo_resources`"> + <meta attribute="eclassName">CDOResource</meta> + <meta attribute="epackage">http://www.eclipse.org/emf/CDO/resource/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"> + <meta attribute="syntheticId">true</meta> + <generator class="native"/> + </id> + <discriminator column="`dtype`" type="string"/> + <version name="e_version" column="e_version"> + <meta attribute="syntheticVersion">true</meta> + </version> + <property name="path" type="string" not-null="true" length="255" /> + <list name="contents" lazy="true" cascade="all,delete-orphan"> + <key/> + <list-index/> + <element type="org.eclipse.emf.cdo.server.internal.hibernate.tuplizer.CDOIDUserType"> + <column name="entityName"/> + <column name="idString"/> + <column name="idBinary" length="1000"/> + </element> + </list> + </class> +</hibernate-mapping> diff --git a/plugins/org.eclipse.emf.cdo.server.hibernate/plugin.properties b/plugins/org.eclipse.emf.cdo.server.hibernate/plugin.properties new file mode 100644 index 0000000000..ba2520ebbb --- /dev/null +++ b/plugins/org.eclipse.emf.cdo.server.hibernate/plugin.properties @@ -0,0 +1,25 @@ +# Copyright (c) 2004 - 2008 Eike Stepper, Germany. +# 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 + +# NLS_MESSAGEFORMAT_VAR + +# ============================================================================== +# Do not change the properties between this line and the last line containing: +# %%% END OF TRANSLATED PROPERTIES %%% +# Instead, either redefine an existing property, or create a new property, +# append it to the end of the file, and change the code to use the new name. +# ============================================================================== + +pluginName = CDO Server Hibernate (Incubation) +providerName = Eclipse.org + +# ============================================================================== +# %%% END OF TRANSLATED PROPERTIES %%% +# The above properties have been shipped for translation. +# ============================================================================== diff --git a/plugins/org.eclipse.emf.cdo.server.hibernate/plugin.xml b/plugins/org.eclipse.emf.cdo.server.hibernate/plugin.xml new file mode 100644 index 0000000000..fa29a77867 --- /dev/null +++ b/plugins/org.eclipse.emf.cdo.server.hibernate/plugin.xml @@ -0,0 +1,30 @@ +<?xml version="1.0" encoding="UTF-8"?> +<?eclipse version="3.3"?> +<!-- + <copyright> + + Copyright (c) 2004 - 2008 Eike Stepper, Germany. + 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 + + </copyright> +--> + +<plugin> + + + <extension + point="org.eclipse.emf.cdo.server.storeFactories"> + <storeFactory + class="org.eclipse.emf.cdo.server.internal.hibernate.HibernateStoreFactory" + storeType="hibernate"> + </storeFactory> + </extension> + + +</plugin> diff --git a/plugins/org.eclipse.emf.cdo.server.hibernate/src/log4j.properties b/plugins/org.eclipse.emf.cdo.server.hibernate/src/log4j.properties new file mode 100644 index 0000000000..43dfabf808 --- /dev/null +++ b/plugins/org.eclipse.emf.cdo.server.hibernate/src/log4j.properties @@ -0,0 +1,44 @@ +# Set root logger level to error and its only appender to A1. +log4j.rootCategory=error, A1 + +log4j.category.JPOX=OFF + +# A1 is set to be a ConsoleAppender. +log4j.appender.A1=org.apache.log4j.ConsoleAppender + +# A1 uses PatternLayout. +log4j.appender.A1.layout=org.apache.log4j.PatternLayout +log4j.appender.A1.layout.ConversionPattern=%-4r [%t] %-5p %c %x - %m%n + +#log4j.logger.org.hibernate=debug +log4j.logger.org.hibernate=debug +#org.hibernate.pretty + +### log HQL query parser activity +log4j.logger.org.hibernate.hql.ast.AST=debug + +### log just the SQL +log4j.logger.org.hibernate.SQL=debug + +### log JDBC bind parameters ### +log4j.logger.org.hibernate.type=debug +#log4j.logger.org.hibernate.type=debug + +### log schema export/update ### +log4j.logger.org.hibernate.tool.hbm2ddl=debug + +### log HQL parse trees +log4j.logger.org.hibernate.hql=debug + +### log cache activity ### +log4j.logger.org.hibernate.cache=debug + +### log transaction activity +log4j.logger.org.hibernate.transaction=debug + +### log JDBC resource acquisition +log4j.logger.org.hibernate.jdbc=debug + +### enable the following line if you want to track down connection ### +### leakages when using DriverManagerConnectionProvider ### +log4j.logger.org.hibernate.connection.DriverManagerConnectionProvider=debug diff --git a/plugins/org.eclipse.emf.cdo.server.hibernate/src/org/eclipse/emf/cdo/server/hibernate/CDOIDHibernate.java b/plugins/org.eclipse.emf.cdo.server.hibernate/src/org/eclipse/emf/cdo/server/hibernate/CDOIDHibernate.java new file mode 100644 index 0000000000..fd9cea4885 --- /dev/null +++ b/plugins/org.eclipse.emf.cdo.server.hibernate/src/org/eclipse/emf/cdo/server/hibernate/CDOIDHibernate.java @@ -0,0 +1,37 @@ +/*************************************************************************** + * Copyright (c) 2004 - 2008 Eike Stepper, 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 - additional api + **************************************************************************/ +package org.eclipse.emf.cdo.server.hibernate; + +import org.eclipse.emf.cdo.protocol.id.CDOIDObject; + +import java.io.Serializable; + +/** + * @author Eike Stepper + * @author Martin Taal + */ +public interface CDOIDHibernate extends CDOIDObject +{ + + public Serializable getId(); + + public void setId(Serializable id); + + public String getEntityName(); + + public void setEntityName(String entityName); + + public void setContent(byte[] content); + + public byte[] getContent(); + +} diff --git a/plugins/org.eclipse.emf.cdo.server.hibernate/src/org/eclipse/emf/cdo/server/hibernate/HibernateUtil.java b/plugins/org.eclipse.emf.cdo.server.hibernate/src/org/eclipse/emf/cdo/server/hibernate/HibernateUtil.java new file mode 100644 index 0000000000..2c32959f22 --- /dev/null +++ b/plugins/org.eclipse.emf.cdo.server.hibernate/src/org/eclipse/emf/cdo/server/hibernate/HibernateUtil.java @@ -0,0 +1,32 @@ +/*************************************************************************** + * Copyright (c) 2004 - 2008 Eike Stepper, 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 - added mappingProvider support + **************************************************************************/ +package org.eclipse.emf.cdo.server.hibernate; + +import java.util.Properties; + +import org.eclipse.emf.cdo.server.internal.hibernate.HibernateStore; + +/** + * @author Eike Stepper + * @author Martin Taal + */ +public final class HibernateUtil +{ + private HibernateUtil() + { + } + + public static IHibernateStore createStore(Properties properties, IHibernateMappingProvider mappingProvider) + { + return new HibernateStore(properties, mappingProvider); + } +} diff --git a/plugins/org.eclipse.emf.cdo.server.hibernate/src/org/eclipse/emf/cdo/server/hibernate/IHibernateMappingProvider.java b/plugins/org.eclipse.emf.cdo.server.hibernate/src/org/eclipse/emf/cdo/server/hibernate/IHibernateMappingProvider.java new file mode 100644 index 0000000000..3b538de318 --- /dev/null +++ b/plugins/org.eclipse.emf.cdo.server.hibernate/src/org/eclipse/emf/cdo/server/hibernate/IHibernateMappingProvider.java @@ -0,0 +1,29 @@ +/*************************************************************************** + * Copyright (c) 2004 - 2008 Martin Taal 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 - initial API and implementation + **************************************************************************/ +package org.eclipse.emf.cdo.server.hibernate; + +import java.util.Collection; +import java.util.Properties; + +/** + * Provides or generates a hibernate mapping on the basis of a set of EPackages and properties. An example of a + * hibernate mapping provider is Teneo, another provider can read the mapping from a hbm file based on the file location + * passed as a property. + * + * @author Martin Taal + */ +public interface IHibernateMappingProvider +{ + + // the passed modelObjects collection is defined as a collection of Objects + // to prevent binary dependency on emf. + public String provideMapping(Collection<Object> modelObjects, Properties properties); +} diff --git a/plugins/org.eclipse.emf.cdo.server.hibernate/src/org/eclipse/emf/cdo/server/hibernate/IHibernateStore.java b/plugins/org.eclipse.emf.cdo.server.hibernate/src/org/eclipse/emf/cdo/server/hibernate/IHibernateStore.java new file mode 100644 index 0000000000..3f0766c8a7 --- /dev/null +++ b/plugins/org.eclipse.emf.cdo.server.hibernate/src/org/eclipse/emf/cdo/server/hibernate/IHibernateStore.java @@ -0,0 +1,32 @@ +/*************************************************************************** + * Copyright (c) 2004 - 2008 Eike Stepper, Germany. + * 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.server.hibernate; + +import org.eclipse.emf.cdo.server.ISession; +import org.eclipse.emf.cdo.server.IStore; +import org.eclipse.emf.cdo.server.IView; + +import org.hibernate.SessionFactory; +import org.hibernate.cfg.Configuration; + +/** + * @author Eike Stepper + */ +public interface IHibernateStore extends IStore +{ + public Configuration getHibernateConfiguration(); + + public SessionFactory getHibernateSessionFactory(); + + public IHibernateStoreReader getReader(ISession session); + + public IHibernateStoreWriter getWriter(IView view); +} diff --git a/plugins/org.eclipse.emf.cdo.server.hibernate/src/org/eclipse/emf/cdo/server/hibernate/IHibernateStoreAccessor.java b/plugins/org.eclipse.emf.cdo.server.hibernate/src/org/eclipse/emf/cdo/server/hibernate/IHibernateStoreAccessor.java new file mode 100644 index 0000000000..a506b6e5b0 --- /dev/null +++ b/plugins/org.eclipse.emf.cdo.server.hibernate/src/org/eclipse/emf/cdo/server/hibernate/IHibernateStoreAccessor.java @@ -0,0 +1,25 @@ +/*************************************************************************** + * Copyright (c) 2004 - 2008 Eike Stepper, Germany. + * 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.server.hibernate; + +import org.eclipse.emf.cdo.server.IStoreAccessor; + +import org.hibernate.Session; + +/** + * @author Eike Stepper + */ +public interface IHibernateStoreAccessor extends IStoreAccessor +{ + public IHibernateStore getStore(); + + public Session getHibernateSession(); +} diff --git a/plugins/org.eclipse.emf.cdo.server.hibernate/src/org/eclipse/emf/cdo/server/hibernate/IHibernateStoreChunkReader.java b/plugins/org.eclipse.emf.cdo.server.hibernate/src/org/eclipse/emf/cdo/server/hibernate/IHibernateStoreChunkReader.java new file mode 100644 index 0000000000..dc36a94e53 --- /dev/null +++ b/plugins/org.eclipse.emf.cdo.server.hibernate/src/org/eclipse/emf/cdo/server/hibernate/IHibernateStoreChunkReader.java @@ -0,0 +1,21 @@ +/*************************************************************************** + * Copyright (c) 2004 - 2008 Eike Stepper, Germany. + * 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.server.hibernate; + +import org.eclipse.emf.cdo.server.IStoreChunkReader; + +/** + * @author Eike Stepper + */ +public interface IHibernateStoreChunkReader extends IStoreChunkReader +{ + public IHibernateStoreReader getStoreReader(); +} diff --git a/plugins/org.eclipse.emf.cdo.server.hibernate/src/org/eclipse/emf/cdo/server/hibernate/IHibernateStoreReader.java b/plugins/org.eclipse.emf.cdo.server.hibernate/src/org/eclipse/emf/cdo/server/hibernate/IHibernateStoreReader.java new file mode 100644 index 0000000000..1c2fc761b4 --- /dev/null +++ b/plugins/org.eclipse.emf.cdo.server.hibernate/src/org/eclipse/emf/cdo/server/hibernate/IHibernateStoreReader.java @@ -0,0 +1,23 @@ +/*************************************************************************** + * Copyright (c) 2004 - 2008 Eike Stepper, Germany. + * 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.server.hibernate; + +import org.eclipse.emf.cdo.protocol.model.CDOFeature; +import org.eclipse.emf.cdo.protocol.revision.CDORevision; +import org.eclipse.emf.cdo.server.IStoreReader; + +/** + * @author Eike Stepper + */ +public interface IHibernateStoreReader extends IHibernateStoreAccessor, IStoreReader +{ + public IHibernateStoreChunkReader createChunkReader(CDORevision revision, CDOFeature feature); +} diff --git a/plugins/org.eclipse.emf.cdo.server.hibernate/src/org/eclipse/emf/cdo/server/hibernate/IHibernateStoreWriter.java b/plugins/org.eclipse.emf.cdo.server.hibernate/src/org/eclipse/emf/cdo/server/hibernate/IHibernateStoreWriter.java new file mode 100644 index 0000000000..5ebd9fac01 --- /dev/null +++ b/plugins/org.eclipse.emf.cdo.server.hibernate/src/org/eclipse/emf/cdo/server/hibernate/IHibernateStoreWriter.java @@ -0,0 +1,20 @@ +/*************************************************************************** + * Copyright (c) 2004 - 2008 Eike Stepper, Germany. + * 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.server.hibernate; + +import org.eclipse.emf.cdo.server.IStoreWriter; + +/** + * @author Eike Stepper + */ +public interface IHibernateStoreWriter extends IHibernateStoreReader, IStoreWriter +{ +} diff --git a/plugins/org.eclipse.emf.cdo.server.hibernate/src/org/eclipse/emf/cdo/server/internal/hibernate/CDOHibernateThreadContext.java b/plugins/org.eclipse.emf.cdo.server.hibernate/src/org/eclipse/emf/cdo/server/internal/hibernate/CDOHibernateThreadContext.java new file mode 100644 index 0000000000..d0d6e5d781 --- /dev/null +++ b/plugins/org.eclipse.emf.cdo.server.hibernate/src/org/eclipse/emf/cdo/server/internal/hibernate/CDOHibernateThreadContext.java @@ -0,0 +1,82 @@ +/*************************************************************************** + * Copyright (c) 2004 - 2008 Martin Taal 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 - initial API and implementation + **************************************************************************/ +package org.eclipse.emf.cdo.server.internal.hibernate; + +import org.eclipse.emf.cdo.server.IStoreWriter.CommitContext; +import org.eclipse.emf.cdo.server.internal.hibernate.bundle.OM; + +import org.eclipse.net4j.internal.util.om.trace.ContextTracer; + +import org.hibernate.Session; + +/** + * @author Martin Taal + */ +public class CDOHibernateThreadContext +{ + private static final ContextTracer TRACER = new ContextTracer(OM.DEBUG, CDOHibernateThreadContext.class); + + private static ThreadLocal<CommitContext> commitContext = new ThreadLocal<CommitContext>(); + + private static ThreadLocal<Session> session = new ThreadLocal<Session>(); + + public static Session getSession() + { + if (session.get() == null) + { + throw new IllegalStateException("Session not set"); + } + return session.get(); + } + + public static void setSession(Session newSession) + { + if (newSession != null && session.get() != null) + { + throw new IllegalStateException("Session already set"); + } + if (newSession == null) + { + TRACER.trace("Clearing session in threadlocal"); + } + else + { + TRACER.trace("Setting session in threadlocal"); + } + session.set(newSession); + } + + public static CommitContext getCommitContext() + { + if (commitContext.get() == null) + { + throw new IllegalStateException("CommitContext not set"); + } + return commitContext.get(); + } + + public static void setCommitContext(CommitContext newCommitContext) + { + if (newCommitContext != null && commitContext.get() != null) + { + throw new IllegalStateException("CommitContext already set"); + } + if (newCommitContext == null) + { + TRACER.trace("Clearing commitcontext in threadlocal"); + } + else + { + TRACER.trace("Setting commitcontext in threadlocal"); + } + commitContext.set(newCommitContext); + } +} diff --git a/plugins/org.eclipse.emf.cdo.server.hibernate/src/org/eclipse/emf/cdo/server/internal/hibernate/CDOHibernateUtil.java b/plugins/org.eclipse.emf.cdo.server.hibernate/src/org/eclipse/emf/cdo/server/internal/hibernate/CDOHibernateUtil.java new file mode 100644 index 0000000000..d1cdef47f3 --- /dev/null +++ b/plugins/org.eclipse.emf.cdo.server.hibernate/src/org/eclipse/emf/cdo/server/internal/hibernate/CDOHibernateUtil.java @@ -0,0 +1,113 @@ +/*************************************************************************** + * Copyright (c) 2004 - 2008 Martin Taal 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 - initial API and implementation + **************************************************************************/ +package org.eclipse.emf.cdo.server.internal.hibernate; + +import org.eclipse.emf.cdo.protocol.id.CDOID; +import org.eclipse.emf.cdo.protocol.id.CDOIDTemp; +import org.eclipse.emf.cdo.protocol.revision.CDORevision; +import org.eclipse.emf.cdo.server.IStoreWriter.CommitContext; +import org.eclipse.emf.cdo.server.hibernate.CDOIDHibernate; + +import org.hibernate.Session; + +/** + * @author Martin Taal + */ +public class CDOHibernateUtil +{ + private static CDOHibernateUtil instance = new CDOHibernateUtil(); + + /** + * @return the instance + */ + public static CDOHibernateUtil getInstance() + { + return instance; + } + + /** + * @param instance + * the instance to set + */ + public static void setInstance(CDOHibernateUtil instance) + { + CDOHibernateUtil.instance = instance; + } + + public String getEntityName(CDORevision cdoRevision) + { + return cdoRevision.getCDOClass().getName(); + } + + /** + * Translates a temporary cdoID into a hibernate ID, by finding the object it refers to in the CommitContext and then + * returning or by persisting the object. Note assumes that the hibernate session and CommitContext are set in + * CDOHibernateThreadContext. + */ + public CDOIDHibernate getCDOIDHibernate(CDOID cdoID) + { + final CDORevision cdoRevision = getCDORevision(cdoID); + if (cdoRevision.getID() instanceof CDOIDHibernate) + { + return (CDOIDHibernate)cdoRevision.getID(); + } + final Session session = CDOHibernateThreadContext.getSession(); + session.saveOrUpdate(cdoRevision); + if (!(cdoRevision.getID() instanceof CDOIDHibernate)) + { + throw new IllegalStateException("CDORevision " + cdoRevision.getCDOClass().getName() + " " + cdoRevision.getID() + + " does not have a hibernate cdoid after saving/updating it"); + } + return (CDOIDHibernate)cdoRevision.getID(); + } + + /** + * Gets a current object, first checks the new and dirty objects from the commitcontent. Otherwise reads it from the + * session. + */ + public CDORevision getCDORevision(CDOID id) + { + final CommitContext commitContext = CDOHibernateThreadContext.getCommitContext(); + for (CDORevision revision : commitContext.getNewObjects()) + { + if (revision.getID().equals(id)) + { + return revision; + } + } + for (CDORevision revision : commitContext.getDirtyObjects()) + { + if (revision.getID().equals(id)) + { + return revision; + } + } + + // maybe the temp was already translated + if (id instanceof CDOIDTemp) + { + final CDOID newID = commitContext.getIDMappings().get(id); + if (newID != null) + { + return getCDORevision(newID); + } + } + + if (!(id instanceof CDOIDHibernate)) + { + throw new IllegalArgumentException("Passed cdoid is not an instance of CDOIDHibernate but a " + + id.getClass().getName() + ": " + id); + } + final CDOIDHibernate cdoIDHibernate = (CDOIDHibernate)id; + final Session session = CDOHibernateThreadContext.getSession(); + return (CDORevision)session.get(cdoIDHibernate.getEntityName(), cdoIDHibernate.getId()); + } +} diff --git a/plugins/org.eclipse.emf.cdo.server.hibernate/src/org/eclipse/emf/cdo/server/internal/hibernate/CDOIDHibernateFactoryImpl.java b/plugins/org.eclipse.emf.cdo.server.hibernate/src/org/eclipse/emf/cdo/server/internal/hibernate/CDOIDHibernateFactoryImpl.java new file mode 100644 index 0000000000..4482fa128c --- /dev/null +++ b/plugins/org.eclipse.emf.cdo.server.hibernate/src/org/eclipse/emf/cdo/server/internal/hibernate/CDOIDHibernateFactoryImpl.java @@ -0,0 +1,38 @@ +/*************************************************************************** + * Copyright (c) 2004 - 2008 Eike Stepper, Germany. + * 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.server.internal.hibernate; + +import org.eclipse.emf.cdo.protocol.id.CDOIDObject; +import org.eclipse.emf.cdo.protocol.id.CDOIDObjectFactory; + +import org.eclipse.net4j.util.io.ExtendedDataInput; + +/** + * @author Eike Stepper + */ +public class CDOIDHibernateFactoryImpl implements CDOIDObjectFactory +{ + private static final Class<?>[] CLASSES = { CDOIDHibernateImpl.class, CDOIDHibernateImpl.Legacy.class }; + + public CDOIDHibernateFactoryImpl() + { + } + + public Class<?>[] getCDOIDObjectClasses() + { + return CLASSES; + } + + public CDOIDObject createCDOIDObject(ExtendedDataInput in) + { + return new CDOIDHibernateImpl(); + } +} diff --git a/plugins/org.eclipse.emf.cdo.server.hibernate/src/org/eclipse/emf/cdo/server/internal/hibernate/CDOIDHibernateImpl.java b/plugins/org.eclipse.emf.cdo.server.hibernate/src/org/eclipse/emf/cdo/server/internal/hibernate/CDOIDHibernateImpl.java new file mode 100644 index 0000000000..cb68df1102 --- /dev/null +++ b/plugins/org.eclipse.emf.cdo.server.hibernate/src/org/eclipse/emf/cdo/server/internal/hibernate/CDOIDHibernateImpl.java @@ -0,0 +1,263 @@ +/*************************************************************************** + * Copyright (c) 2004 - 2008 Eike Stepper, 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 - added hibernate specifics + **************************************************************************/ +package org.eclipse.emf.cdo.server.internal.hibernate; + +import org.eclipse.emf.cdo.internal.protocol.id.AbstractCDOID; +import org.eclipse.emf.cdo.protocol.id.CDOIDObject; +import org.eclipse.emf.cdo.protocol.model.CDOClassRef; +import org.eclipse.emf.cdo.server.hibernate.CDOIDHibernate; + +import org.eclipse.net4j.util.io.ExtendedDataInput; +import org.eclipse.net4j.util.io.ExtendedDataOutput; + +import java.io.ByteArrayInputStream; +import java.io.ByteArrayOutputStream; +import java.io.IOException; +import java.io.ObjectInputStream; +import java.io.ObjectOutputStream; +import java.io.Serializable; + +/** + * @author Eike Stepper + * @author Martin Taal + */ +public class CDOIDHibernateImpl extends AbstractCDOID implements CDOIDHibernate +{ + private static final long serialVersionUID = 1L; + + private Serializable id; + + private String entityName; + + public CDOIDHibernateImpl() + { + } + + public Type getType() + { + return Type.OBJECT; + } + + public CDOClassRef getClassRef() + { + return null; + } + + public CDOIDObject asLegacy(CDOClassRef classRef) + { + return new Legacy(classRef); + } + + public void read(ExtendedDataInput in) throws IOException + { + final byte[] content = in.readByteArray(); + setContent(content); + } + + public void setContent(byte[] content) + { + try + { + final ObjectInputStream ois = new ObjectInputStream(new ByteArrayInputStream(content)); + final SerializableContent contentObject = (SerializableContent)ois.readObject(); + setId(contentObject.getId()); + setEntityName(contentObject.getEntityName()); + ois.close(); + } + catch (ClassNotFoundException e) + { + throw new IllegalArgumentException(e); + } + catch (IOException e) + { + throw new IllegalStateException(e); + } + } + + public byte[] getContent() + { + try + { + final ByteArrayOutputStream bos = new ByteArrayOutputStream(); + final ObjectOutputStream oos = new ObjectOutputStream(bos); + final SerializableContent content = new SerializableContent(); + content.setId(getId()); + content.setEntityName(getEntityName()); + oos.writeObject(content); + return bos.toByteArray(); + } + catch (IOException e) + { + throw new IllegalStateException(e); + } + + } + + public void write(ExtendedDataOutput out) throws IOException + { + out.writeByteArray(getContent()); + } + + @Override + public boolean equals(Object obj) + { + if (!(obj instanceof CDOIDHibernate)) + { + return false; + } + + return id.equals(((CDOIDHibernate)obj).getId()) && entityName.equals(((CDOIDHibernate)obj).getEntityName()); + } + + @Override + public int hashCode() + { + return id.hashCode(); + } + + @Override + public String toString() + { + return getClass().getName() + ": " + entityName + " (id:" + id.toString() + ")"; + } + + // used for serialization + private static class SerializableContent implements Serializable + { + private static final long serialVersionUID = 1L; + + private Serializable id; + + private String entityName; + + /** + * @return the id + */ + public Serializable getId() + { + return id; + } + + /** + * @param id + * the id to set + */ + public void setId(Serializable id) + { + this.id = id; + } + + /** + * @return the entityName + */ + public String getEntityName() + { + return entityName; + } + + /** + * @param entityName + * the entityName to set + */ + public void setEntityName(String entityName) + { + this.entityName = entityName; + } + } + + /** + * @author Eike Stepper + */ + public static final class Legacy extends CDOIDHibernateImpl + { + private static final long serialVersionUID = 1L; + + private CDOClassRef classRef; + + public Legacy() + { + } + + public Legacy(CDOClassRef classRef) + { + if (classRef == null) + { + throw new IllegalArgumentException("classRef == null"); + } + + this.classRef = classRef; + } + + @Override + public Type getType() + { + return Type.LEGACY_OBJECT; + } + + @Override + public CDOClassRef getClassRef() + { + return classRef; + } + + public void setClassRef(CDOClassRef classRef) + { + this.classRef = classRef; + } + + @Override + public Legacy asLegacy(CDOClassRef classRef) + { + return this; + } + + @Override + public String toString() + { + return super.toString() + "(" + classRef + ")"; + } + } + + /** + * @return the id + */ + public Serializable getId() + { + return id; + } + + /** + * @param id + * the id to set + */ + public void setId(Serializable id) + { + this.id = id; + } + + /** + * @return the entityName + */ + public String getEntityName() + { + return entityName; + } + + /** + * @param entityName + * the entityName to set + */ + public void setEntityName(String entityName) + { + this.entityName = entityName; + } +} diff --git a/plugins/org.eclipse.emf.cdo.server.hibernate/src/org/eclipse/emf/cdo/server/internal/hibernate/HibernateCDOPackageHandler.java b/plugins/org.eclipse.emf.cdo.server.hibernate/src/org/eclipse/emf/cdo/server/internal/hibernate/HibernateCDOPackageHandler.java new file mode 100644 index 0000000000..ac262fd4f2 --- /dev/null +++ b/plugins/org.eclipse.emf.cdo.server.hibernate/src/org/eclipse/emf/cdo/server/internal/hibernate/HibernateCDOPackageHandler.java @@ -0,0 +1,293 @@ +/*************************************************************************** + * Copyright (c) 2004 - 2008 Eike Stepper, 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 - moved code from HibernateStore to this class + **************************************************************************/ +package org.eclipse.emf.cdo.server.internal.hibernate; + +import org.eclipse.emf.cdo.internal.protocol.model.CDOClassImpl; +import org.eclipse.emf.cdo.internal.protocol.model.CDOFeatureImpl; +import org.eclipse.emf.cdo.internal.protocol.model.CDOPackageImpl; +import org.eclipse.emf.cdo.protocol.model.CDOClass; +import org.eclipse.emf.cdo.protocol.model.CDOFeature; +import org.eclipse.emf.cdo.protocol.model.CDOPackage; +import org.eclipse.emf.cdo.protocol.model.CDOPackageInfo; +import org.eclipse.emf.cdo.server.internal.hibernate.bundle.OM; + +import org.eclipse.net4j.internal.util.om.trace.ContextTracer; +import org.eclipse.net4j.util.WrappedException; +import org.eclipse.net4j.util.io.IOUtil; + +import org.hibernate.Criteria; +import org.hibernate.Session; +import org.hibernate.SessionFactory; +import org.hibernate.Transaction; +import org.hibernate.cfg.Configuration; +import org.hibernate.tool.hbm2ddl.SchemaUpdate; + +import java.io.InputStream; +import java.util.ArrayList; +import java.util.Collection; +import java.util.List; +import java.util.Properties; + +/** + * Delegate which stores and retrieves cdo packages. + * + * @author Eike Stepper + * @author Martin Taal + */ +public class HibernateCDOPackageHandler +{ + private static final ContextTracer TRACER = new ContextTracer(OM.DEBUG, HibernateStoreWriter.class); + + private static final ContextTracer WARNING = new ContextTracer(OM.WARNING, HibernateStoreWriter.class); + + private Configuration configuration; + + private SessionFactory sessionFactory; + + private int nextPackageID; + + private int nextClassID; + + private int nextFeatureID; + + private Properties properties; + + private Collection<CDOPackageInfo> cdoPackageInfos = null; + + private Collection<CDOPackage> cdoPackages = null; + + private HibernateStore hibernateStore; + + public HibernateCDOPackageHandler(Properties props, HibernateStore hibernateStore) + { + properties = props; + this.hibernateStore = hibernateStore; + TRACER.trace("Created " + this.getClass().getName() + " with properties:"); + for (Object keyObject : props.keySet()) + { + TRACER.trace("Property: " + keyObject + ": " + props.get(keyObject)); + } + } + + public void writePackages(CDOPackage... cdoPackages) + { + TRACER.trace("Persisting new CDOPackages"); + final Session session = getSessionFactory().openSession(); + final Transaction tx = session.beginTransaction(); + boolean err = true; + try + { + for (CDOPackage cdoPackage : cdoPackages) + { + if (null != getCDOPackage(cdoPackage.getPackageURI())) + { + WARNING.trace("CDOPackage " + cdoPackage.getPackageURI() + " already exists not persisting it again!"); + continue; + } + TRACER.trace("Persisting CDOPackage " + cdoPackage.getPackageURI()); + session.saveOrUpdate(cdoPackage); + } + tx.commit(); + err = false; + } + finally + { + if (err) + { + tx.rollback(); + } + session.close(); + } + reset(); + hibernateStore.reInitialize(); + } + + public void writePackage(CDOPackage cdoPackage) + { + if (null != getCDOPackage(cdoPackage.getPackageURI())) + { + WARNING.trace("CDOPackage " + cdoPackage.getPackageURI() + " already exists not persisting it again!"); + return; + } + final Session session = getSessionFactory().openSession(); + final Transaction tx = session.beginTransaction(); + boolean err = true; + try + { + TRACER.trace("Persisting CDOPackage " + cdoPackage.getPackageURI()); + session.saveOrUpdate(cdoPackage); + tx.commit(); + err = false; + } + finally + { + if (err) + { + tx.rollback(); + } + session.close(); + } + reset(); + hibernateStore.reInitialize(); + } + + public CDOPackage getCDOPackage(String uri) + { + TRACER.trace("Getting CDOPackage using uri: " + uri); + for (CDOPackage cdoPackage : cdoPackages) + { + if (cdoPackage.getPackageURI().compareTo(uri) == 0) + { + TRACER.trace("CDOPackage found"); + return cdoPackage; + } + } + TRACER.trace("CDOPackage NOT found"); + return null; + } + + public Collection<CDOPackageInfo> getCDOPackageInfos() + { + readPackages(); + return cdoPackageInfos; + } + + public Collection<CDOPackage> getCDOPackages() + { + readPackages(); + return cdoPackages; + } + + protected void readPackages() + { + if (cdoPackageInfos == null) + { + TRACER.trace("Reading CDOPackages from db"); + Collection<CDOPackageInfo> result = new ArrayList<CDOPackageInfo>(); + Collection<CDOPackage> resultPackages = new ArrayList<CDOPackage>(); + Session session = getSessionFactory().openSession(); + try + { + Criteria criteria = session.createCriteria(CDOPackageImpl.class); + List<?> list = criteria.list(); + TRACER.trace("Found " + list.size() + " CDOPackages in DB"); + for (Object object : list) + { + CDOPackageImpl cdoPackage = (CDOPackageImpl)object; + TRACER.trace("Read CDOPackage: " + cdoPackage.getName()); + result.add(new CDOPackageInfo(cdoPackage.getPackageURI(), cdoPackage.isDynamic(), null)); + cdoPackage.setPackageManager(hibernateStore.getRepository().getPackageManager()); + resultPackages.add(cdoPackage); + + // repair something + // TODO: set this in the mapping with a bi-directional relation + for (CDOClass cdoClass : cdoPackage.getClasses()) + { + ((CDOClassImpl)cdoClass).setContainingPackage(cdoPackage); + for (CDOFeature cdoFeature : cdoClass.getFeatures()) + { + ((CDOFeatureImpl)cdoFeature).setContainingClass(cdoClass); + } + } + } + cdoPackages = resultPackages; + cdoPackageInfos = result; + } + finally + { + session.close(); + } + } + TRACER.trace("Finished reading CDOPackages"); + } + + public synchronized SessionFactory getSessionFactory() + { + if (sessionFactory == null) + { + sessionFactory = configuration.buildSessionFactory(); + } + + return sessionFactory; + } + + public synchronized int getNextPackageID() + { + // TODO Better synchronization + return nextPackageID++; + } + + public synchronized int getNextClassID() + { + // TODO Better synchronization + return nextClassID++; + } + + public synchronized int getNextFeatureID() + { + // TODO Better synchronization + return nextFeatureID++; + } + + public void reset() + { + cdoPackageInfos = null; + cdoPackages = null; + } + + protected void doActivate() + { + TRACER.trace("Activating CDOPackageHandler"); + + initConfiguration(); + initSchema(); + } + + protected void doDeactivate() throws Exception + { + TRACER.trace("De-Activating CDOPackageHandler"); + + if (sessionFactory != null) + { + sessionFactory.close(); + sessionFactory = null; + } + } + + protected void initConfiguration() + { + TRACER.trace("Initializing datastore for CDO metadata"); + InputStream in = null; + + try + { + in = OM.BUNDLE.getInputStream("mappings/meta.hbm.xml"); + configuration = new Configuration(); + configuration.addInputStream(in); + configuration.setProperties(properties); + } + catch (Exception ex) + { + throw WrappedException.wrap(ex); + } + finally + { + IOUtil.close(in); + } + } + + protected void initSchema() + { + TRACER.trace("Updating db schema for Hibernate PackageHandler"); + new SchemaUpdate(configuration).execute(true, true); + } +} 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 new file mode 100644 index 0000000000..167fca6343 --- /dev/null +++ b/plugins/org.eclipse.emf.cdo.server.hibernate/src/org/eclipse/emf/cdo/server/internal/hibernate/HibernateStore.java @@ -0,0 +1,298 @@ +/*************************************************************************** + * Copyright (c) 2004 - 2008 Eike Stepper, 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 - moved cdopackage handler to other class, changed configuration + **************************************************************************/ +package org.eclipse.emf.cdo.server.internal.hibernate; + +import org.eclipse.emf.cdo.internal.server.Store; +import org.eclipse.emf.cdo.protocol.id.CDOIDObjectFactory; +import org.eclipse.emf.cdo.protocol.model.CDOPackage; +import org.eclipse.emf.cdo.server.ISession; +import org.eclipse.emf.cdo.server.IView; +import org.eclipse.emf.cdo.server.hibernate.IHibernateMappingProvider; +import org.eclipse.emf.cdo.server.hibernate.IHibernateStore; +import org.eclipse.emf.cdo.server.internal.hibernate.bundle.OM; + +import org.eclipse.net4j.internal.util.om.trace.ContextTracer; +import org.eclipse.net4j.util.WrappedException; +import org.eclipse.net4j.util.io.IOUtil; + +import org.hibernate.SessionFactory; +import org.hibernate.cfg.Configuration; +import org.hibernate.tool.hbm2ddl.SchemaUpdate; + +import java.io.InputStream; +import java.util.ArrayList; +import java.util.Collection; +import java.util.Properties; + +/** + * @author Eike Stepper + * @author Martin Taal + */ +public class HibernateStore extends Store implements IHibernateStore +{ + public static final String TYPE = "hibernate"; + + private static final ContextTracer TRACER = new ContextTracer(OM.DEBUG, HibernateStore.class); + + private static final CDOIDObjectFactory CDOID_OBJECT_FACTORY = new CDOIDHibernateFactoryImpl(); + + /** + * Used to give different extensions of Hibernate a context when initializing + */ + private static ThreadLocal<HibernateStore> currentHibernateStore = new ThreadLocal<HibernateStore>(); + + private Configuration hibernateConfiguration; + + private SessionFactory hibernateSessionFactory; + + private HibernateCDOPackageHandler packageHandler; + + @SuppressWarnings("unused") + private IHibernateMappingProvider mappingProvider; + + private Properties properties; + + public HibernateStore(Properties props, IHibernateMappingProvider mappingProvider) + { + super(TYPE); + properties = props; + packageHandler = new HibernateCDOPackageHandler(props, this); + this.mappingProvider = mappingProvider; + TRACER.trace("Created " + this.getClass().getName() + " with properties:"); + for (Object keyObject : props.keySet()) + { + TRACER.trace("Property: " + keyObject + ": " + props.get(keyObject)); + } + if (mappingProvider != null) + { + TRACER.trace("With mappingProvider " + mappingProvider.getClass().getName()); + } + } + + public Configuration getHibernateConfiguration() + { + return hibernateConfiguration; + } + + public synchronized SessionFactory getHibernateSessionFactory() + { + if (hibernateSessionFactory == null) + { + TRACER.trace("Initializing SessionFactory for HibernateStore"); + currentHibernateStore.set(this); + try + { + hibernateSessionFactory = hibernateConfiguration.buildSessionFactory(); + } + finally + { + currentHibernateStore.set(null); + } + } + + return hibernateSessionFactory; + } + + public boolean hasAuditingSupport() + { + return false; + } + + public boolean hasBranchingSupport() + { + return false; + } + + public boolean hasWriteDeltaSupport() + { + return false; + } + + public CDOIDObjectFactory getCDOIDObjectFactory() + { + return CDOID_OBJECT_FACTORY; + } + + @Override + public HibernateStoreReader getReader(ISession session) + { + return (HibernateStoreReader)super.getReader(session); + } + + @Override + public HibernateStoreReader createReader(ISession session) + { + return new HibernateStoreReader(this, session); + } + + @Override + public HibernateStoreWriter getWriter(IView view) + { + return (HibernateStoreWriter)super.getWriter(view); + } + + @Override + public HibernateStoreWriter createWriter(IView view) + { + return new HibernateStoreWriter(this, view); + } + + public synchronized int getNextPackageID() + { + return packageHandler.getNextPackageID(); + } + + public synchronized int getNextClassID() + { + return packageHandler.getNextClassID(); + } + + public synchronized int getNextFeatureID() + { + return packageHandler.getNextFeatureID(); + } + + public boolean wasCrashed() + { + return false; + } + + public void repairAfterCrash() + { + throw new UnsupportedOperationException(); // TODO Implement me + } + + public HibernateCDOPackageHandler getPackageHandler() + { + return packageHandler; + } + + @Override + // TODO: synchronize?? + protected void doActivate() throws Exception + { + TRACER.trace("Activating HibernateStore"); + + super.doActivate(); + + // activate the package store + packageHandler.doActivate(); + + initConfiguration(); + initSchema(); + } + + @Override + protected void doDeactivate() throws Exception + { + TRACER.trace("De-Activating HibernateStore"); + if (hibernateSessionFactory != null) + { + TRACER.trace("Closing SessionFactory"); + hibernateSessionFactory.close(); + hibernateSessionFactory = null; + } + + packageHandler.doDeactivate(); + + super.doDeactivate(); + } + + // is called after a new package has been added + // TODO: synchronize?? + // TODO: combine with doActivate/doDeactivate?? + // TODO: assumes that packageHandler has been reset + protected void reInitialize() + { + TRACER.trace("Re-Initializing HibernateStore"); + if (hibernateSessionFactory != null) + { + if (!hibernateSessionFactory.isClosed()) + { + TRACER.trace("Closing SessionFactory"); + hibernateSessionFactory.close(); + } + hibernateSessionFactory = null; + } + initConfiguration(); + initSchema(); + } + + protected void initConfiguration() + { + TRACER.trace("Initializing Configuration"); + + InputStream in = null; + + try + { + final Collection<CDOPackage> cdoPackages = getPackageHandler().getCDOPackages(); + final Collection<Object> ecoreStrs = new ArrayList<Object>(); + + hibernateConfiguration = new Configuration(); + + final String mapping; + + if (cdoPackages.size() > 0) + { + TRACER.trace("Mapping ecore to hibernate for CDOPackages:"); + for (CDOPackage cdoPackage : cdoPackages) + { + TRACER.trace("adding ecore for CDOPackage " + cdoPackage.getPackageURI()); + ecoreStrs.add(cdoPackage.getEcore()); + } + // DISABLED to prevent teneo dependency + // mapping = mappingProvider.provideMapping(ecoreStrs, properties); + // TRACER.trace(mapping); + // System.err.println(mapping); + mapping = null; + in = OM.BUNDLE.getInputStream("mappings/product.hbm.xml"); + hibernateConfiguration.addInputStream(in); + } + else + { + mapping = null; + TRACER.trace("No CDOPackages found, ecore not mapped to hibernate"); + } + + TRACER.trace("Adding resource.hbm.xml to configuration"); + in = OM.BUNDLE.getInputStream("mappings/resource.hbm.xml"); + hibernateConfiguration.addInputStream(in); + if (mapping != null) + { + TRACER.trace("Adding generated mapping to configuration"); + hibernateConfiguration.addXML(mapping); + } + + hibernateConfiguration.setProperties(properties); + } + catch (Exception ex) + { + throw WrappedException.wrap(ex); + } + finally + { + IOUtil.close(in); + } + } + + protected void initSchema() + { + TRACER.trace("Updating db schema for HibernateStore"); + new SchemaUpdate(hibernateConfiguration).execute(true, true); + } + + public static HibernateStore getCurrentHibernateStore() + { + return currentHibernateStore.get(); + } +} 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 new file mode 100644 index 0000000000..2c3dbce6d4 --- /dev/null +++ b/plugins/org.eclipse.emf.cdo.server.hibernate/src/org/eclipse/emf/cdo/server/internal/hibernate/HibernateStoreAccessor.java @@ -0,0 +1,96 @@ +/*************************************************************************** + * Copyright (c) 2004 - 2008 Eike Stepper, 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 - specific hibernate functionality + **************************************************************************/ +package org.eclipse.emf.cdo.server.internal.hibernate; + +import org.eclipse.emf.cdo.internal.server.StoreAccessor; +import org.eclipse.emf.cdo.server.ISession; +import org.eclipse.emf.cdo.server.IView; +import org.eclipse.emf.cdo.server.hibernate.IHibernateStoreAccessor; +import org.eclipse.emf.cdo.server.internal.hibernate.bundle.OM; + +import org.eclipse.net4j.internal.util.om.trace.ContextTracer; + +import org.hibernate.Session; +import org.hibernate.SessionFactory; + +/** + * @author Eike Stepper + * @author Martin Taal + */ +public class HibernateStoreAccessor extends StoreAccessor implements IHibernateStoreAccessor +{ + private static final ContextTracer TRACER = new ContextTracer(OM.DEBUG, HibernateStoreAccessor.class); + + private Session hibernateSession; + + protected HibernateStoreAccessor(HibernateStore store, ISession session) + { + super(store, session); + TRACER.trace("Created " + this.getClass().getName() + " for repository " + store.getRepository().getName()); + } + + protected HibernateStoreAccessor(HibernateStore store, IView view) + { + super(store, view); + TRACER.trace("Created " + this.getClass().getName() + " for repository " + store.getRepository().getName()); + } + + protected Session createHibernateSession() + { + TRACER.trace("Creating hibernate session and setting it in threadlocal CDOHibernateThreadContext"); + final SessionFactory sessionFactory = getStore().getHibernateSessionFactory(); + final Session session = sessionFactory.openSession(); + CDOHibernateThreadContext.setSession(session); + return session; + } + + @Override + protected void doRelease() + { + TRACER.trace("Releasing hibernate session"); + CDOHibernateThreadContext.setSession(null); + clearHibernateSession(); + } + + /** Clears the current hibernate session and sets a new one in the thread context */ + public void resetHibernateSession() + { + clearHibernateSession(); + getHibernateSession(); + } + + @Override + public HibernateStore getStore() + { + return (HibernateStore)super.getStore(); + } + + public void clearHibernateSession() + { + TRACER.trace("Removing hibernate session"); + if (hibernateSession != null && hibernateSession.isOpen()) + { + TRACER.trace("Closing hibernate session"); + hibernateSession.close(); + } + hibernateSession = null; + } + + public Session getHibernateSession() + { + if (hibernateSession == null) + { + hibernateSession = createHibernateSession(); + } + return hibernateSession; + } +} 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 new file mode 100644 index 0000000000..aa3c212daf --- /dev/null +++ b/plugins/org.eclipse.emf.cdo.server.hibernate/src/org/eclipse/emf/cdo/server/internal/hibernate/HibernateStoreChunkReader.java @@ -0,0 +1,55 @@ +/*************************************************************************** + * Copyright (c) 2004 - 2008 Eike Stepper, Germany. + * 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.server.internal.hibernate; + +import org.eclipse.emf.cdo.internal.server.StoreChunkReader; +import org.eclipse.emf.cdo.protocol.model.CDOFeature; +import org.eclipse.emf.cdo.protocol.revision.CDORevision; +import org.eclipse.emf.cdo.server.hibernate.IHibernateStoreChunkReader; +import org.eclipse.emf.cdo.server.hibernate.IHibernateStoreReader; + +import java.util.List; + +/** + * @author Eike Stepper + */ +public class HibernateStoreChunkReader extends StoreChunkReader implements IHibernateStoreChunkReader +{ + public HibernateStoreChunkReader(IHibernateStoreReader storeReader, CDORevision revision, CDOFeature feature) + { + super(storeReader, revision, feature); + } + + @Override + public HibernateStoreReader getStoreReader() + { + return (HibernateStoreReader)super.getStoreReader(); + } + + @Override + public void addSimpleChunk(int index) + { + super.addSimpleChunk(index); + throw new UnsupportedOperationException(); // TODO Implement me + } + + @Override + public void addRangedChunk(int fromIndex, int toIndex) + { + super.addRangedChunk(fromIndex, toIndex); + throw new UnsupportedOperationException(); // TODO Implement me + } + + public List<Chunk> executeRead() + { + throw new UnsupportedOperationException(); // TODO Implement me + } +} diff --git a/plugins/org.eclipse.emf.cdo.server.hibernate/src/org/eclipse/emf/cdo/server/internal/hibernate/HibernateStoreFactory.java b/plugins/org.eclipse.emf.cdo.server.hibernate/src/org/eclipse/emf/cdo/server/internal/hibernate/HibernateStoreFactory.java new file mode 100644 index 0000000000..6cda2111c7 --- /dev/null +++ b/plugins/org.eclipse.emf.cdo.server.hibernate/src/org/eclipse/emf/cdo/server/internal/hibernate/HibernateStoreFactory.java @@ -0,0 +1,43 @@ +/*************************************************************************** + * Copyright (c) 2004 - 2008 Eike Stepper, Germany. + * 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.server.internal.hibernate; + +import org.eclipse.emf.cdo.server.IStore; +import org.eclipse.emf.cdo.server.IStoreFactory; + +import org.w3c.dom.Element; + +/** + * @author Eike Stepper + */ +public class HibernateStoreFactory implements IStoreFactory +{ + public HibernateStoreFactory() + { + } + + public String getStoreType() + { + return HibernateStore.TYPE; + } + + public IStore createStore(Element storeConfig) + { + throw new UnsupportedOperationException(); // TODO Implement me + // IMappingStrategy mappingStrategy = getMappingStrategy(storeConfig); + // IDBAdapter dbAdapter = getDBAdapter(storeConfig); + // DataSource dataSource = getDataSource(storeConfig); + // IDBConnectionProvider connectionProvider = DBUtil.createConnectionProvider(dataSource); + // HibernateStore store = new HibernateStore(mappingStrategy, dbAdapter, connectionProvider); + // mappingStrategy.setStore(store); + // return store; + } +} diff --git a/plugins/org.eclipse.emf.cdo.server.hibernate/src/org/eclipse/emf/cdo/server/internal/hibernate/HibernateStoreReader.java b/plugins/org.eclipse.emf.cdo.server.hibernate/src/org/eclipse/emf/cdo/server/internal/hibernate/HibernateStoreReader.java new file mode 100644 index 0000000000..c93dea27d7 --- /dev/null +++ b/plugins/org.eclipse.emf.cdo.server.hibernate/src/org/eclipse/emf/cdo/server/internal/hibernate/HibernateStoreReader.java @@ -0,0 +1,144 @@ +/*************************************************************************** + * Copyright (c) 2004 - 2008 Eike Stepper, 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 - specific hibernate functionality + **************************************************************************/ +package org.eclipse.emf.cdo.server.internal.hibernate; + +import org.eclipse.emf.cdo.protocol.id.CDOID; +import org.eclipse.emf.cdo.protocol.model.CDOClassRef; +import org.eclipse.emf.cdo.protocol.model.CDOFeature; +import org.eclipse.emf.cdo.protocol.model.CDOPackage; +import org.eclipse.emf.cdo.protocol.model.CDOPackageInfo; +import org.eclipse.emf.cdo.protocol.model.resource.CDOResourceClass; +import org.eclipse.emf.cdo.protocol.revision.CDORevision; +import org.eclipse.emf.cdo.server.ISession; +import org.eclipse.emf.cdo.server.IView; +import org.eclipse.emf.cdo.server.hibernate.CDOIDHibernate; +import org.eclipse.emf.cdo.server.hibernate.IHibernateStoreReader; +import org.eclipse.emf.cdo.server.internal.hibernate.bundle.OM; + +import org.eclipse.net4j.internal.util.om.trace.ContextTracer; +import org.eclipse.net4j.util.io.CloseableIterator; + +import org.hibernate.Criteria; +import org.hibernate.Query; +import org.hibernate.Session; +import org.hibernate.criterion.Expression; + +import java.util.Collection; +import java.util.List; + +/** + * @author Eike Stepper + * @author Martin Taal + */ +public class HibernateStoreReader extends HibernateStoreAccessor implements IHibernateStoreReader +{ + private static final ContextTracer TRACER = new ContextTracer(OM.DEBUG, HibernateStoreReader.class); + + public HibernateStoreReader(HibernateStore store, ISession session) + { + super(store, session); + TRACER.trace("Created " + this.getClass().getName() + " for repository " + store.getRepository().getName()); + } + + protected HibernateStoreReader(HibernateStore store, IView view) + { + super(store, view); + TRACER.trace("Created " + this.getClass().getName() + " for repository " + store.getRepository().getName()); + } + + public HibernateStoreChunkReader createChunkReader(CDORevision revision, CDOFeature feature) + { + return new HibernateStoreChunkReader(this, revision, feature); + } + + public CloseableIterator<CDOID> readObjectIDs(boolean withTypes) + { + throw new UnsupportedOperationException(); + } + + public CDOClassRef readObjectType(CDOID id) + { + final CDORevision cdoRevision = readRevision(id, -1); + return cdoRevision.getCDOClass().createClassRef(); + } + + public void readPackage(CDOPackage cdoPackage) + { + // does nothing, assumes that the packages have been read + } + + public Collection<CDOPackageInfo> readPackageInfos() + { + return getStore().getPackageHandler().getCDOPackageInfos(); + } + + public CDOID readResourceID(String path) + { + TRACER.trace("Finding resourceid using path " + path); + final Session session = getHibernateSession(); + + final Criteria criteria = session.createCriteria(CDOResourceClass.NAME); + criteria.add(Expression.eq("path", path)); + final List<?> result = criteria.list(); + if (result.size() == 0) + { + TRACER.trace("Resource not found"); + // TODO: throw exception? + return null; + } + // TODO: throw exception if list.size() > 1? + final CDORevision cdoRevision = (CDORevision)result.get(0); + return cdoRevision.getID(); + } + + public String readResourcePath(CDOID id) + { + if (id == null) + { + throw new IllegalArgumentException("ID must be not null"); + } + if (!(id instanceof CDOIDHibernate)) + { + throw new IllegalArgumentException("ID type " + id.getClass().getName() + " not supported by hibernate reader"); + } + + TRACER.trace("Finding resource using id " + id); + + final Session session = getHibernateSession(); + final Query qry = session.createQuery("select path from " + CDOResourceClass.NAME + " where id=:id"); + final CDOIDHibernate idHibernate = (CDOIDHibernate)id; + qry.setParameter("id", idHibernate.getId()); + final List<?> result = qry.list(); + if (result.size() == 0) + { + TRACER.trace("Resource not found"); + // TODO: throw exception? + return null; + } + return (String)result.get(0); + } + + public CDORevision readRevision(CDOID id, int referenceChunk) + { + return CDOHibernateUtil.getInstance().getCDORevision(id); + } + + public CDORevision readRevisionByTime(CDOID id, int referenceChunk, long timeStamp) + { + throw new UnsupportedOperationException(); + } + + public CDORevision readRevisionByVersion(CDOID id, int referenceChunk, int version) + { + throw new UnsupportedOperationException(); + } +} diff --git a/plugins/org.eclipse.emf.cdo.server.hibernate/src/org/eclipse/emf/cdo/server/internal/hibernate/HibernateStoreWriter.java b/plugins/org.eclipse.emf.cdo.server.hibernate/src/org/eclipse/emf/cdo/server/internal/hibernate/HibernateStoreWriter.java new file mode 100644 index 0000000000..c482783e73 --- /dev/null +++ b/plugins/org.eclipse.emf.cdo.server.hibernate/src/org/eclipse/emf/cdo/server/internal/hibernate/HibernateStoreWriter.java @@ -0,0 +1,154 @@ +/*************************************************************************** + * Copyright (c) 2004 - 2008 Eike Stepper, 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 - added hibernate specific implementation + **************************************************************************/ +package org.eclipse.emf.cdo.server.internal.hibernate; + +import org.eclipse.emf.cdo.internal.protocol.model.CDOClassImpl; +import org.eclipse.emf.cdo.internal.protocol.model.CDOClassProxy; +import org.eclipse.emf.cdo.protocol.model.CDOFeature; +import org.eclipse.emf.cdo.protocol.model.CDOPackage; +import org.eclipse.emf.cdo.protocol.revision.CDORevision; +import org.eclipse.emf.cdo.protocol.revision.delta.CDORevisionDelta; +import org.eclipse.emf.cdo.server.IView; +import org.eclipse.emf.cdo.server.hibernate.IHibernateStoreWriter; +import org.eclipse.emf.cdo.server.internal.hibernate.bundle.OM; + +import org.eclipse.net4j.internal.util.om.trace.ContextTracer; + +import org.hibernate.FlushMode; +import org.hibernate.Session; + +/** + * @author Eike Stepper + */ +public class HibernateStoreWriter extends HibernateStoreReader implements IHibernateStoreWriter +{ + private static final ContextTracer TRACER = new ContextTracer(OM.DEBUG, HibernateStoreWriter.class); + + public HibernateStoreWriter(HibernateStore store, IView view) + { + super(store, view); + TRACER.trace("Created " + this.getClass().getName() + " for repository " + store.getRepository().getName()); + } + + @Override + public void commit(CommitContext context) + { + TRACER.trace("Committing transaction"); + + writePackages(context.getNewPackages()); + + try + { + // start with fresh hibernate session + final Session session = getHibernateSession(); + CDOHibernateThreadContext.setCommitContext(context); + session.setFlushMode(FlushMode.COMMIT); + session.beginTransaction(); + for (Object o : context.getNewObjects()) + { + final CDORevision cdoRevision = (CDORevision)o; + session.save(CDOHibernateUtil.getInstance().getEntityName(cdoRevision), o); + TRACER + .trace("Persisted new Object " + ((CDORevision)o).getCDOClass().getName() + " id: " + cdoRevision.getID()); + } + for (Object o : context.getDirtyObjects()) + { + final CDORevision cdoRevision = (CDORevision)o; + session.update(CDOHibernateUtil.getInstance().getEntityName(cdoRevision), o); + TRACER.trace("Updated Object " + ((CDORevision)o).getCDOClass().getName() + " id: " + cdoRevision.getID()); + } + TRACER.trace("Commit hibernate transaction"); + session.getTransaction().commit(); + } + finally + { + TRACER.trace("Clearing used hibernate session"); + CDOHibernateThreadContext.setCommitContext(null); + } + + TRACER.trace("Applying id mappings"); + context.applyIDMappings(); + } + + @Override + public boolean isReader() + { + return false; + } + + @Override + public void rollback(CommitContext context) + { + // don't do anything as the real action is done at commit (which does not happen now) + TRACER.trace("Rollbacked called"); + } + + @Override + protected void writeClass(CDOClassImpl cdoClass) + { + throw new UnsupportedOperationException("Should not be called, should be handled by hibernate cascade"); + } + + @Override + protected void writeFeature(CDOFeature feature) + { + throw new UnsupportedOperationException("Should not be called, should be handled by hibernate cascade"); + } + + @Override + protected void writePackages(CDOPackage... cdoPackages) + { + if (cdoPackages != null && cdoPackages.length > 0) + { + getStore().getPackageHandler().writePackages(cdoPackages); + } + + // set a new hibernatesession in the thread + resetHibernateSession(); + } + + @Override + protected void writePackage(CDOPackage cdoPackage) + { + throw new UnsupportedOperationException("Should not be called"); + } + + @Override + protected void writeRevision(CDORevision revision) + { + // do nothing, do it all at commit + } + + @Override + protected void writeRevisionDelta(CDORevisionDelta revisionDelta) + { + throw new UnsupportedOperationException("Should not be called"); + } + + @Override + protected void writeRevisionDeltas(CDORevisionDelta[] revisionDeltas) + { + throw new UnsupportedOperationException("Should not be called"); + } + + @Override + protected void writeRevisions(CDORevision[] revisions) + { + // don't do anything it is done at commit + } + + @Override + protected void writeSuperType(CDOClassImpl type, CDOClassProxy superType) + { + throw new UnsupportedOperationException("Should not be called, should be handled by hibernate cascade"); + } +} diff --git a/plugins/org.eclipse.emf.cdo.server.hibernate/src/org/eclipse/emf/cdo/server/internal/hibernate/bundle/OM.java b/plugins/org.eclipse.emf.cdo.server.hibernate/src/org/eclipse/emf/cdo/server/internal/hibernate/bundle/OM.java new file mode 100644 index 0000000000..02decb274d --- /dev/null +++ b/plugins/org.eclipse.emf.cdo.server.hibernate/src/org/eclipse/emf/cdo/server/internal/hibernate/bundle/OM.java @@ -0,0 +1,46 @@ +/*************************************************************************** + * Copyright (c) 2004 - 2008 Eike Stepper, Germany. + * 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.server.internal.hibernate.bundle; + +import org.eclipse.net4j.util.om.OMBundle; +import org.eclipse.net4j.util.om.OMPlatform; +import org.eclipse.net4j.util.om.OSGiActivator; +import org.eclipse.net4j.util.om.log.OMLogger; +import org.eclipse.net4j.util.om.trace.OMTracer; + +/** + * The <em>Operations & Maintenance</em> class of this bundle. + * + * @author Eike Stepper + */ +public abstract class OM +{ + public static final String BUNDLE_ID = "org.eclipse.emf.cdo.server.hibernate"; //$NON-NLS-1$ + + public static final OMBundle BUNDLE = OMPlatform.INSTANCE.bundle(BUNDLE_ID, OM.class); + + public static final OMTracer DEBUG = BUNDLE.tracer("debug"); //$NON-NLS-1$ + + public static final OMTracer WARNING = BUNDLE.tracer("warn"); //$NON-NLS-1$ + + public static final OMLogger LOG = BUNDLE.logger(); + + /** + * @author Eike Stepper + */ + public static final class Activator extends OSGiActivator + { + public Activator() + { + super(BUNDLE); + } + } +} diff --git a/plugins/org.eclipse.emf.cdo.server.hibernate/src/org/eclipse/emf/cdo/server/internal/hibernate/info/ClassServerInfo.java b/plugins/org.eclipse.emf.cdo.server.hibernate/src/org/eclipse/emf/cdo/server/internal/hibernate/info/ClassServerInfo.java new file mode 100644 index 0000000000..9c581fd273 --- /dev/null +++ b/plugins/org.eclipse.emf.cdo.server.hibernate/src/org/eclipse/emf/cdo/server/internal/hibernate/info/ClassServerInfo.java @@ -0,0 +1,18 @@ +/*************************************************************************** + * Copyright (c) 2004 - 2008 Eike Stepper, Germany. + * 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.server.internal.hibernate.info; + +/** + * @author Eike Stepper + */ +public final class ClassServerInfo extends ServerInfo +{ +} diff --git a/plugins/org.eclipse.emf.cdo.server.hibernate/src/org/eclipse/emf/cdo/server/internal/hibernate/info/FeatureServerInfo.java b/plugins/org.eclipse.emf.cdo.server.hibernate/src/org/eclipse/emf/cdo/server/internal/hibernate/info/FeatureServerInfo.java new file mode 100644 index 0000000000..df0339ce11 --- /dev/null +++ b/plugins/org.eclipse.emf.cdo.server.hibernate/src/org/eclipse/emf/cdo/server/internal/hibernate/info/FeatureServerInfo.java @@ -0,0 +1,18 @@ +/*************************************************************************** + * Copyright (c) 2004 - 2008 Eike Stepper, Germany. + * 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.server.internal.hibernate.info; + +/** + * @author Eike Stepper + */ +public final class FeatureServerInfo extends ServerInfo +{ +} diff --git a/plugins/org.eclipse.emf.cdo.server.hibernate/src/org/eclipse/emf/cdo/server/internal/hibernate/info/PackageServerInfo.java b/plugins/org.eclipse.emf.cdo.server.hibernate/src/org/eclipse/emf/cdo/server/internal/hibernate/info/PackageServerInfo.java new file mode 100644 index 0000000000..be70519c17 --- /dev/null +++ b/plugins/org.eclipse.emf.cdo.server.hibernate/src/org/eclipse/emf/cdo/server/internal/hibernate/info/PackageServerInfo.java @@ -0,0 +1,18 @@ +/*************************************************************************** + * Copyright (c) 2004 - 2008 Eike Stepper, Germany. + * 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.server.internal.hibernate.info; + +/** + * @author Eike Stepper + */ +public final class PackageServerInfo extends ServerInfo +{ +} diff --git a/plugins/org.eclipse.emf.cdo.server.hibernate/src/org/eclipse/emf/cdo/server/internal/hibernate/info/ServerInfo.java b/plugins/org.eclipse.emf.cdo.server.hibernate/src/org/eclipse/emf/cdo/server/internal/hibernate/info/ServerInfo.java new file mode 100644 index 0000000000..90769ee831 --- /dev/null +++ b/plugins/org.eclipse.emf.cdo.server.hibernate/src/org/eclipse/emf/cdo/server/internal/hibernate/info/ServerInfo.java @@ -0,0 +1,18 @@ +/*************************************************************************** + * Copyright (c) 2004 - 2008 Eike Stepper, Germany. + * 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.server.internal.hibernate.info; + +/** + * @author Eike Stepper + */ +public abstract class ServerInfo +{ +} diff --git a/plugins/org.eclipse.emf.cdo.server.hibernate/src/org/eclipse/emf/cdo/server/internal/hibernate/tuplizer/CDOIDMetaRangeUserType.java b/plugins/org.eclipse.emf.cdo.server.hibernate/src/org/eclipse/emf/cdo/server/internal/hibernate/tuplizer/CDOIDMetaRangeUserType.java new file mode 100644 index 0000000000..313c7d98d9 --- /dev/null +++ b/plugins/org.eclipse.emf.cdo.server.hibernate/src/org/eclipse/emf/cdo/server/internal/hibernate/tuplizer/CDOIDMetaRangeUserType.java @@ -0,0 +1,120 @@ +/*************************************************************************** + * Copyright (c) 2008 - 2008 Martin Taal 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 - initial api + **************************************************************************/ +package org.eclipse.emf.cdo.server.internal.hibernate.tuplizer; + +import org.eclipse.emf.cdo.internal.protocol.id.CDOIDMetaImpl; +import org.eclipse.emf.cdo.internal.protocol.id.CDOIDMetaRangeImpl; +import org.eclipse.emf.cdo.protocol.id.CDOIDMeta; +import org.eclipse.emf.cdo.protocol.id.CDOIDMetaRange; + +import org.hibernate.Hibernate; +import org.hibernate.usertype.UserType; + +import java.io.Serializable; +import java.sql.PreparedStatement; +import java.sql.ResultSet; +import java.sql.SQLException; +import java.sql.Types; + +/** + * @author Martin Taal + */ +public class CDOIDMetaRangeUserType implements UserType +{ + + private static final int[] SQL_TYPES = { Types.INTEGER, Types.INTEGER }; + + public int[] sqlTypes() + { + return SQL_TYPES; + } + + public Class<?> returnedClass() + { + return CDOIDMetaRange.class; + } + + public boolean isMutable() + { + return true; + } + + public CDOIDMetaRangeUserType() + { + } + + public Object deepCopy(Object value) + { + final CDOIDMetaRange cdoRange = (CDOIDMetaRange)value; + final CDOIDMeta newCdoIDMeta = new CDOIDMetaImpl(((CDOIDMetaImpl)cdoRange.getLowerBound()).getLongValue()); + return new CDOIDMetaRangeImpl(newCdoIDMeta, cdoRange.size()); + } + + public boolean equals(Object x, Object y) + { + if (x == y) + { + return true; + } + if (x == null || y == null) + { + return false; + } + return x.equals(y); + } + + public Object nullSafeGet(ResultSet rs, String[] names, Object owner) throws SQLException + { + final Integer start = (Integer)Hibernate.INTEGER.nullSafeGet(rs, names[0]); + final Integer size = (Integer)Hibernate.INTEGER.nullSafeGet(rs, names[1]); + if (size == null || start == null) + { + return null; + } + final CDOIDMeta newCdoIDMeta = new CDOIDMetaImpl(start); + return new CDOIDMetaRangeImpl(newCdoIDMeta, size); + } + + public void nullSafeSet(PreparedStatement statement, Object value, int index) throws SQLException + { + if (value != null) + { + final CDOIDMetaRange cdoRange = (CDOIDMetaRange)value; + statement.setLong(index, ((CDOIDMeta)cdoRange.getLowerBound()).getLongValue()); + statement.setInt(index + 1, cdoRange.size()); + } + else + { + statement.setNull(index, Types.INTEGER); + statement.setNull(index + 1, Types.INTEGER); + } + } + + public Serializable disassemble(Object value) + { + return (Serializable)value; + } + + public Object assemble(Serializable cachedValue, Object owner) + { + return cachedValue; + } + + public Object replace(Object original, Object target, Object owner) + { + return original; + } + + public int hashCode(Object x) + { + return x.hashCode(); + } +} diff --git a/plugins/org.eclipse.emf.cdo.server.hibernate/src/org/eclipse/emf/cdo/server/internal/hibernate/tuplizer/CDOIDPropertyGetter.java b/plugins/org.eclipse.emf.cdo.server.hibernate/src/org/eclipse/emf/cdo/server/internal/hibernate/tuplizer/CDOIDPropertyGetter.java new file mode 100644 index 0000000000..440eee16c6 --- /dev/null +++ b/plugins/org.eclipse.emf.cdo.server.hibernate/src/org/eclipse/emf/cdo/server/internal/hibernate/tuplizer/CDOIDPropertyGetter.java @@ -0,0 +1,60 @@ +/*************************************************************************** + * Copyright (c) 2004 - 2008 Martin Taal + * 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 - copied from CDORevisionPropertyHandler and adapted + **************************************************************************/ +package org.eclipse.emf.cdo.server.internal.hibernate.tuplizer; + +import org.eclipse.emf.cdo.internal.protocol.revision.InternalCDORevision; +import org.eclipse.emf.cdo.server.hibernate.CDOIDHibernate; + +import org.hibernate.HibernateException; + +/** + * @author Martin Taal + */ +public class CDOIDPropertyGetter extends CDOPropertyGetter +{ + private static final long serialVersionUID = 1L; + + public CDOIDPropertyGetter(CDORevisionTuplizer tuplizer, String propertyName) + { + super(tuplizer, propertyName); + } + + @Override + public Object get(Object target) throws HibernateException + { + final InternalCDORevision revision = (InternalCDORevision)target; + if (!(revision.getID() instanceof CDOIDHibernate)) + { + return null; + } + final CDOIDHibernate cdoID = (CDOIDHibernate)revision.getID(); + if (isVirtualProperty()) + { + return cdoID.getId(); + } + else + { + final Object id = super.get(target); + // TODO: does this make sense? + // if (cdoID.getId() == null) + // { + // cdoID.setId((Serializable)id); + // } + return id; + } + } + + @Override + protected boolean isVirtualPropertyAllowed() + { + return true; + } +} diff --git a/plugins/org.eclipse.emf.cdo.server.hibernate/src/org/eclipse/emf/cdo/server/internal/hibernate/tuplizer/CDOIDPropertySetter.java b/plugins/org.eclipse.emf.cdo.server.hibernate/src/org/eclipse/emf/cdo/server/internal/hibernate/tuplizer/CDOIDPropertySetter.java new file mode 100644 index 0000000000..d1f68bade2 --- /dev/null +++ b/plugins/org.eclipse.emf.cdo.server.hibernate/src/org/eclipse/emf/cdo/server/internal/hibernate/tuplizer/CDOIDPropertySetter.java @@ -0,0 +1,78 @@ +/*************************************************************************** + * Copyright (c) 2004 - 2008 Martin Taal + * 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 - copied from CDORevisionPropertyHandler and adapted + **************************************************************************/ +package org.eclipse.emf.cdo.server.internal.hibernate.tuplizer; + +import org.eclipse.emf.cdo.internal.protocol.revision.InternalCDORevision; +import org.eclipse.emf.cdo.protocol.id.CDOID; +import org.eclipse.emf.cdo.protocol.id.CDOIDTemp; +import org.eclipse.emf.cdo.server.IStoreWriter.CommitContext; +import org.eclipse.emf.cdo.server.hibernate.CDOIDHibernate; +import org.eclipse.emf.cdo.server.internal.hibernate.CDOHibernateThreadContext; +import org.eclipse.emf.cdo.server.internal.hibernate.CDOIDHibernateImpl; + +import org.hibernate.HibernateException; +import org.hibernate.engine.SessionFactoryImplementor; + +import java.io.Serializable; + +/** + * @author Martin Taal + */ +public class CDOIDPropertySetter extends CDOPropertySetter +{ + private static final long serialVersionUID = 1L; + + public CDOIDPropertySetter(CDORevisionTuplizer tuplizer, String propertyName) + { + super(tuplizer, propertyName); + } + + @Override + public void set(Object target, Object value, SessionFactoryImplementor factory) throws HibernateException + { + if (value == null) + { + return; + } + final InternalCDORevision revision = (InternalCDORevision)target; + final CDOID cdoID = revision.getID(); + if (cdoID == null) + { + final CDOIDHibernate newCDOID = new CDOIDHibernateImpl(); + newCDOID.setId((Serializable)value); + newCDOID.setEntityName(revision.getCDOClass().getName()); + revision.setID(newCDOID); + } + else if (cdoID instanceof CDOIDTemp) + { + final CommitContext commitContext = CDOHibernateThreadContext.getCommitContext(); + final CDOIDHibernate newCDOID = new CDOIDHibernateImpl(); + newCDOID.setId((Serializable)value); + newCDOID.setEntityName(revision.getCDOClass().getName()); + revision.setID(newCDOID); + commitContext.addIDMapping((CDOIDTemp)cdoID, newCDOID); + } + else + { + final CDOIDHibernate hbCDOID = (CDOIDHibernate)revision.getID(); + if (!hbCDOID.getId().equals(value)) + { + throw new IllegalStateException("Current id and new id are different " + value + "/" + hbCDOID.getId()); + } + } + } + + @Override + protected boolean isVirtualPropertyAllowed() + { + return true; + } +} diff --git a/plugins/org.eclipse.emf.cdo.server.hibernate/src/org/eclipse/emf/cdo/server/internal/hibernate/tuplizer/CDOIDUserType.java b/plugins/org.eclipse.emf.cdo.server.hibernate/src/org/eclipse/emf/cdo/server/internal/hibernate/tuplizer/CDOIDUserType.java new file mode 100644 index 0000000000..c59903b5a1 --- /dev/null +++ b/plugins/org.eclipse.emf.cdo.server.hibernate/src/org/eclipse/emf/cdo/server/internal/hibernate/tuplizer/CDOIDUserType.java @@ -0,0 +1,136 @@ +/*************************************************************************** + * Copyright (c) 2008 - 2008 Martin Taal 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 - initial api + **************************************************************************/ +package org.eclipse.emf.cdo.server.internal.hibernate.tuplizer; + +import org.eclipse.emf.cdo.protocol.id.CDOID; +import org.eclipse.emf.cdo.protocol.id.CDOIDTemp; +import org.eclipse.emf.cdo.protocol.revision.CDORevision; +import org.eclipse.emf.cdo.server.hibernate.CDOIDHibernate; +import org.eclipse.emf.cdo.server.internal.hibernate.CDOHibernateUtil; +import org.eclipse.emf.cdo.server.internal.hibernate.CDOIDHibernateImpl; + +import org.hibernate.Hibernate; +import org.hibernate.usertype.UserType; + +import java.io.Serializable; +import java.sql.PreparedStatement; +import java.sql.ResultSet; +import java.sql.SQLException; +import java.sql.Types; + +/** + * Persists a cdoid in the db. + */ +public class CDOIDUserType implements UserType +{ + + // second varchar is just for informational purposes + private static final int[] SQL_TYPES = { Types.VARCHAR, Types.VARCHAR, Types.VARBINARY }; + + public int[] sqlTypes() + { + return SQL_TYPES; + } + + public Class<?> returnedClass() + { + return CDOID.class; + } + + public boolean isMutable() + { + return false; + } + + public CDOIDUserType() + { + } + + public Object deepCopy(Object value) + { + return value; + } + + public boolean equals(Object x, Object y) + { + if (x == y) + { + return true; + } + if (x == null || y == null) + { + return false; + } + return x.equals(y); + } + + public Object nullSafeGet(ResultSet rs, String[] names, Object owner) throws SQLException + { + final String entityName = (String)Hibernate.STRING.nullSafeGet(rs, names[0]); + if (rs.wasNull() || entityName == null) + { + return null; + } + final byte[] content = (byte[])Hibernate.BINARY.nullSafeGet(rs, names[2]); + final CDOIDHibernate cdoID = new CDOIDHibernateImpl(); + cdoID.setContent(content); + return cdoID; + } + + public void nullSafeSet(PreparedStatement statement, Object value, int index) throws SQLException + { + if (value == null) + { + statement.setNull(index, Types.VARCHAR); + statement.setNull(index, Types.VARCHAR); + statement.setNull(index, Types.VARBINARY); + } + if (value != null) + { + final CDOIDHibernate cdoID; + if (value instanceof CDOIDTemp) + { + cdoID = CDOHibernateUtil.getInstance().getCDOIDHibernate((CDOID)value); + } + else if (value instanceof CDORevision) + { + cdoID = (CDOIDHibernate)((CDORevision)value).getID(); + } + else + { + cdoID = (CDOIDHibernate)value; + } + statement.setString(index, cdoID.getEntityName()); + statement.setString(index + 1, cdoID.getId().toString()); + statement.setBytes(index + 2, cdoID.getContent()); + } + } + + public Serializable disassemble(Object value) + { + return (Serializable)value; + } + + public Object assemble(Serializable cachedValue, Object owner) + { + return cachedValue; + } + + public Object replace(Object original, Object target, Object owner) + { + return original; + } + + public int hashCode(Object x) + { + return x.hashCode(); + } +} diff --git a/plugins/org.eclipse.emf.cdo.server.hibernate/src/org/eclipse/emf/cdo/server/internal/hibernate/tuplizer/CDOManyReferenceGetter.java b/plugins/org.eclipse.emf.cdo.server.hibernate/src/org/eclipse/emf/cdo/server/internal/hibernate/tuplizer/CDOManyReferenceGetter.java new file mode 100644 index 0000000000..c8169bd6af --- /dev/null +++ b/plugins/org.eclipse.emf.cdo.server.hibernate/src/org/eclipse/emf/cdo/server/internal/hibernate/tuplizer/CDOManyReferenceGetter.java @@ -0,0 +1,76 @@ +/*************************************************************************** + * Copyright (c) 2004 - 2008 Martin Taal 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 - copied from CDORevisionPropertyHandler and adapted + **************************************************************************/ +package org.eclipse.emf.cdo.server.internal.hibernate.tuplizer; + +import org.eclipse.emf.cdo.internal.protocol.revision.InternalCDORevision; + +import org.eclipse.net4j.internal.util.collection.MoveableArrayList; + +import org.hibernate.HibernateException; +import org.hibernate.collection.PersistentCollection; + +/** + * @author Martin Taal + */ + +// Howto handle hibernate lists: +// - a new owner: the owner is persisted and its lists are replaced with hibernate +// persistentlist, the hibernate persitentlist will have a delegate (internally) which is the list which was previously +// present in the owner. +// - an existing owner: the owner is read from the db and hibernate will set a persistentlist +// directly +// +// The solution also needs to handle the following: +// - cdo does not have direct java references but stores cdoids in the list while hibernate expects real java object +// references. +// - cdo uses a moveablearraylist and not the standard arraylist +// +// The solution: +// - never return null when hibernate asks for the current value of the manyreference, always +// return a MoveableArrayList so that hibernate uses that as the delegate, set the MoveableArrayList +public class CDOManyReferenceGetter extends CDOPropertyGetter +{ + private static final long serialVersionUID = 1L; + + public CDOManyReferenceGetter(CDORevisionTuplizer tuplizer, String propertyName) + { + super(tuplizer, propertyName); + } + + @Override + public Object get(Object target) throws HibernateException + { + // check if there is already a persistentcollection + final PersistentCollection collection = PersistableListHolder.getInstance().getListMapping(target, getCDOFeature()); + if (collection != null) + { + return collection; + } + + // not yet, get the moveablearraylist + @SuppressWarnings("unchecked") + MoveableArrayList<Object> list = (MoveableArrayList<Object>)super.get(target); + if (list == null) + { + // TODO: what initial size? + list = new MoveableArrayList<Object>(10); + final InternalCDORevision revision = (InternalCDORevision)target; + revision.setValue(getCDOFeature(), list); + } + + // wrap the moveablearraylist + final HibernateMoveableListWrapper wrapper = new HibernateMoveableListWrapper(); + wrapper.setDelegate(list); + + // and return it + return wrapper; + } +} 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 new file mode 100644 index 0000000000..8f57dacad3 --- /dev/null +++ b/plugins/org.eclipse.emf.cdo.server.hibernate/src/org/eclipse/emf/cdo/server/internal/hibernate/tuplizer/CDOManyReferenceSetter.java @@ -0,0 +1,42 @@ +/*************************************************************************** + * Copyright (c) 2004 - 2008 Martin Taal + * 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 - copied from CDORevisionPropertyHandler and adapted + **************************************************************************/ +package org.eclipse.emf.cdo.server.internal.hibernate.tuplizer; + +import org.hibernate.HibernateException; +import org.hibernate.collection.PersistentCollection; +import org.hibernate.collection.PersistentList; +import org.hibernate.engine.SessionFactoryImplementor; + +/** + * @author Martin Taal + */ +public class CDOManyReferenceSetter extends CDOPropertySetter +{ + private static final long serialVersionUID = 1L; + + public CDOManyReferenceSetter(CDORevisionTuplizer tuplizer, String propertyName) + { + super(tuplizer, propertyName); + } + + @Override + public void set(Object target, Object value, SessionFactoryImplementor factory) throws HibernateException + { + // do some checking + if (!(value instanceof PersistentList)) + { + throw new IllegalArgumentException("Value is not a persistentlist but a " + value.getClass().getName()); + } + + // only set it in the listholder + PersistableListHolder.getInstance().putListMapping(target, getCDOFeature(), (PersistentCollection)value); + } +} diff --git a/plugins/org.eclipse.emf.cdo.server.hibernate/src/org/eclipse/emf/cdo/server/internal/hibernate/tuplizer/CDOPropertyGetter.java b/plugins/org.eclipse.emf.cdo.server.hibernate/src/org/eclipse/emf/cdo/server/internal/hibernate/tuplizer/CDOPropertyGetter.java new file mode 100644 index 0000000000..44c680e15a --- /dev/null +++ b/plugins/org.eclipse.emf.cdo.server.hibernate/src/org/eclipse/emf/cdo/server/internal/hibernate/tuplizer/CDOPropertyGetter.java @@ -0,0 +1,61 @@ +/*************************************************************************** + * Copyright (c) 2004 - 2008 Martin Taal + * 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 - copied from CDORevisionPropertyHandler and adapted + **************************************************************************/ +package org.eclipse.emf.cdo.server.internal.hibernate.tuplizer; + +import org.eclipse.emf.cdo.internal.protocol.revision.InternalCDORevision; + +import org.hibernate.HibernateException; +import org.hibernate.engine.SessionImplementor; +import org.hibernate.property.Getter; + +import java.lang.reflect.Method; +import java.util.Map; + +/** + * @author Martin Taal + */ +public class CDOPropertyGetter extends CDOPropertyHandler implements Getter +{ + private static final long serialVersionUID = 1L; + + public CDOPropertyGetter(CDORevisionTuplizer tuplizer, String propertyName) + { + super(tuplizer, propertyName); + } + + public Object get(Object target) throws HibernateException + { + InternalCDORevision revision = (InternalCDORevision)target; + return revision.getValue(getCDOFeature()); + } + + @SuppressWarnings("unchecked") + public Object getForInsert(Object target, Map mergeMap, SessionImplementor session) throws HibernateException + { + return get(target); + } + + public Method getMethod() + { + return null; + } + + public String getMethodName() + { + return null; + } + + @SuppressWarnings("unchecked") + public Class getReturnType() + { + return Object.class; + } +} diff --git a/plugins/org.eclipse.emf.cdo.server.hibernate/src/org/eclipse/emf/cdo/server/internal/hibernate/tuplizer/CDOPropertyHandler.java b/plugins/org.eclipse.emf.cdo.server.hibernate/src/org/eclipse/emf/cdo/server/internal/hibernate/tuplizer/CDOPropertyHandler.java new file mode 100644 index 0000000000..ee887657fc --- /dev/null +++ b/plugins/org.eclipse.emf.cdo.server.hibernate/src/org/eclipse/emf/cdo/server/internal/hibernate/tuplizer/CDOPropertyHandler.java @@ -0,0 +1,79 @@ +/*************************************************************************** + * Copyright (c) 2004 - 2008 Martin Taal + * 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 - copied from CDORevisionPropertyHandler and adapted + **************************************************************************/ +package org.eclipse.emf.cdo.server.internal.hibernate.tuplizer; + +import org.eclipse.emf.cdo.protocol.model.CDOFeature; +import org.eclipse.emf.cdo.server.internal.hibernate.bundle.OM; + +import org.eclipse.net4j.internal.util.om.trace.ContextTracer; + +/** + * @author Martin Taal + */ +public abstract class CDOPropertyHandler +{ + private CDORevisionTuplizer tuplizer; + + private CDOFeature cdoFeature; + + private boolean virtualProperty = false; + + private final ContextTracer tracer = new ContextTracer(OM.DEBUG, this.getClass()); + + public CDOPropertyHandler(CDORevisionTuplizer tuplizer, String propertyName) + { + this.tuplizer = tuplizer; + cdoFeature = tuplizer.getCDOClass().lookupFeature(propertyName); + getTracer().trace( + "Created " + this.getClass().getName() + " for cdoClass/feature: " + tuplizer.getCDOClass().getName() + "." + + propertyName); + if (cdoFeature == null) + { + if (isVirtualPropertyAllowed()) + { + virtualProperty = true; + getTracer().trace("This is a virtualproperty"); + } + else + { + throw new IllegalStateException("Feature not found: " + propertyName); + } + } + } + + protected ContextTracer getTracer() + { + return tracer; + } + + public CDORevisionTuplizer getTuplizer() + { + return tuplizer; + } + + public CDOFeature getCDOFeature() + { + return cdoFeature; + } + + protected boolean isVirtualPropertyAllowed() + { + return false; + } + + /** + * @return the virtualProperty + */ + public boolean isVirtualProperty() + { + return virtualProperty; + } +} diff --git a/plugins/org.eclipse.emf.cdo.server.hibernate/src/org/eclipse/emf/cdo/server/internal/hibernate/tuplizer/CDOPropertySetter.java b/plugins/org.eclipse.emf.cdo.server.hibernate/src/org/eclipse/emf/cdo/server/internal/hibernate/tuplizer/CDOPropertySetter.java new file mode 100644 index 0000000000..d0c7578356 --- /dev/null +++ b/plugins/org.eclipse.emf.cdo.server.hibernate/src/org/eclipse/emf/cdo/server/internal/hibernate/tuplizer/CDOPropertySetter.java @@ -0,0 +1,48 @@ +/*************************************************************************** + * Copyright (c) 2004 - 2008 Martin Taal + * 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 - copied from CDORevisionPropertyHandler and adapted + **************************************************************************/ +package org.eclipse.emf.cdo.server.internal.hibernate.tuplizer; + +import org.eclipse.emf.cdo.internal.protocol.revision.InternalCDORevision; + +import org.hibernate.HibernateException; +import org.hibernate.engine.SessionFactoryImplementor; +import org.hibernate.property.Setter; + +import java.lang.reflect.Method; + +/** + * @author Martin Taal + */ +public class CDOPropertySetter extends CDOPropertyHandler implements Setter +{ + private static final long serialVersionUID = 1L; + + public CDOPropertySetter(CDORevisionTuplizer tuplizer, String propertyName) + { + super(tuplizer, propertyName); + } + + public Method getMethod() + { + return null; + } + + public String getMethodName() + { + return null; + } + + public void set(Object target, Object value, SessionFactoryImplementor factory) throws HibernateException + { + InternalCDORevision revision = (InternalCDORevision)target; + revision.setValue(getCDOFeature(), value); + } +} diff --git a/plugins/org.eclipse.emf.cdo.server.hibernate/src/org/eclipse/emf/cdo/server/internal/hibernate/tuplizer/CDOReferenceGetter.java b/plugins/org.eclipse.emf.cdo.server.hibernate/src/org/eclipse/emf/cdo/server/internal/hibernate/tuplizer/CDOReferenceGetter.java new file mode 100644 index 0000000000..55b50ccd93 --- /dev/null +++ b/plugins/org.eclipse.emf.cdo.server.hibernate/src/org/eclipse/emf/cdo/server/internal/hibernate/tuplizer/CDOReferenceGetter.java @@ -0,0 +1,40 @@ +/*************************************************************************** + * Copyright (c) 2004 - 2008 Martin Taal + * 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 - copied from CDORevisionPropertyHandler and adapted + **************************************************************************/ +package org.eclipse.emf.cdo.server.internal.hibernate.tuplizer; + +import org.eclipse.emf.cdo.protocol.id.CDOID; +import org.eclipse.emf.cdo.server.internal.hibernate.CDOHibernateUtil; + +import org.hibernate.HibernateException; + +/** + * @author Martin Taal + */ +public class CDOReferenceGetter extends CDOPropertyGetter +{ + private static final long serialVersionUID = 1L; + + public CDOReferenceGetter(CDORevisionTuplizer tuplizer, String propertyName) + { + super(tuplizer, propertyName); + } + + @Override + public Object get(Object target) throws HibernateException + { + final Object o = super.get(target); + if (o instanceof CDOID) + { + return CDOHibernateUtil.getInstance().getCDORevision((CDOID)o); + } + return o; + } +} diff --git a/plugins/org.eclipse.emf.cdo.server.hibernate/src/org/eclipse/emf/cdo/server/internal/hibernate/tuplizer/CDOReferenceSetter.java b/plugins/org.eclipse.emf.cdo.server.hibernate/src/org/eclipse/emf/cdo/server/internal/hibernate/tuplizer/CDOReferenceSetter.java new file mode 100644 index 0000000000..1c14778466 --- /dev/null +++ b/plugins/org.eclipse.emf.cdo.server.hibernate/src/org/eclipse/emf/cdo/server/internal/hibernate/tuplizer/CDOReferenceSetter.java @@ -0,0 +1,36 @@ +/*************************************************************************** + * Copyright (c) 2004 - 2008 Martin Taal + * 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 - copied from CDORevisionPropertyHandler and adapted + **************************************************************************/ +package org.eclipse.emf.cdo.server.internal.hibernate.tuplizer; + +import org.eclipse.emf.cdo.protocol.revision.CDORevision; + +import org.hibernate.HibernateException; +import org.hibernate.engine.SessionFactoryImplementor; + +/** + * @author Martin Taal + */ +public class CDOReferenceSetter extends CDOPropertySetter +{ + private static final long serialVersionUID = 1L; + + public CDOReferenceSetter(CDORevisionTuplizer tuplizer, String propertyName) + { + super(tuplizer, propertyName); + } + + @Override + public void set(Object target, Object value, SessionFactoryImplementor factory) throws HibernateException + { + final CDORevision cdoValue = (CDORevision)value; + super.set(target, cdoValue.getID(), factory); + } +} diff --git a/plugins/org.eclipse.emf.cdo.server.hibernate/src/org/eclipse/emf/cdo/server/internal/hibernate/tuplizer/CDORevisionInstantiator.java b/plugins/org.eclipse.emf.cdo.server.hibernate/src/org/eclipse/emf/cdo/server/internal/hibernate/tuplizer/CDORevisionInstantiator.java new file mode 100644 index 0000000000..dcfacafb1d --- /dev/null +++ b/plugins/org.eclipse.emf.cdo.server.hibernate/src/org/eclipse/emf/cdo/server/internal/hibernate/tuplizer/CDORevisionInstantiator.java @@ -0,0 +1,60 @@ +/*************************************************************************** + * Copyright (c) 2004 - 2008 Eike Stepper, Germany. + * 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.server.internal.hibernate.tuplizer; + +import org.eclipse.emf.cdo.internal.protocol.revision.InternalCDORevision; +import org.eclipse.emf.cdo.protocol.id.CDOID; +import org.eclipse.emf.cdo.protocol.model.CDOClass; +import org.eclipse.emf.cdo.protocol.revision.CDORevisionUtil; +import org.eclipse.emf.cdo.server.IPackageManager; +import org.eclipse.emf.cdo.server.IRepository; +import org.eclipse.emf.cdo.server.IRevisionManager; + +import org.hibernate.mapping.PersistentClass; +import org.hibernate.tuple.Instantiator; + +import java.io.Serializable; + +/** + * @author Eike Stepper + */ +public class CDORevisionInstantiator implements Instantiator +{ + private static final long serialVersionUID = 1L; + + private CDOClass cdoClass; + + private IRevisionManager revisionManager; + + public CDORevisionInstantiator(CDORevisionTuplizer tuplizer, PersistentClass mappingInfo) + { + cdoClass = tuplizer.getCDOClass(); + IPackageManager packageManager = (IPackageManager)cdoClass.getPackageManager(); + IRepository repository = packageManager.getRepository(); + revisionManager = repository.getRevisionManager(); + } + + public Object instantiate() + { + // TODO CDO can't create a revision w/o CDOID + return instantiate(null); + } + + public Object instantiate(Serializable id) + { + return CDORevisionUtil.create(revisionManager, cdoClass, (CDOID)id);// TODO Is simply casting ok? + } + + public boolean isInstance(Object object) + { + return object instanceof InternalCDORevision; + } +} diff --git a/plugins/org.eclipse.emf.cdo.server.hibernate/src/org/eclipse/emf/cdo/server/internal/hibernate/tuplizer/CDORevisionLazyInitializer.java b/plugins/org.eclipse.emf.cdo.server.hibernate/src/org/eclipse/emf/cdo/server/internal/hibernate/tuplizer/CDORevisionLazyInitializer.java new file mode 100644 index 0000000000..d80557b13d --- /dev/null +++ b/plugins/org.eclipse.emf.cdo.server.hibernate/src/org/eclipse/emf/cdo/server/internal/hibernate/tuplizer/CDORevisionLazyInitializer.java @@ -0,0 +1,42 @@ +/*************************************************************************** + * Copyright (c) 2004 - 2008 Eike Stepper, Germany. + * 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.server.internal.hibernate.tuplizer; + +import org.eclipse.emf.cdo.internal.protocol.revision.InternalCDORevision; + +import org.hibernate.engine.SessionImplementor; +import org.hibernate.proxy.AbstractLazyInitializer; + +import java.io.Serializable; + +/** + * @author Eike Stepper + */ +public class CDORevisionLazyInitializer extends AbstractLazyInitializer implements Serializable +{ + private static final long serialVersionUID = 1L; + + CDORevisionLazyInitializer(String entityName, Serializable id, SessionImplementor session) + { + super(entityName, id, session); + } + + public InternalCDORevision getRevision() + { + return (InternalCDORevision)getImplementation(); + } + + @SuppressWarnings("unchecked") + public Class getPersistentClass() + { + throw new UnsupportedOperationException(); + } +} diff --git a/plugins/org.eclipse.emf.cdo.server.hibernate/src/org/eclipse/emf/cdo/server/internal/hibernate/tuplizer/CDORevisionPropertyAccessor.java b/plugins/org.eclipse.emf.cdo.server.hibernate/src/org/eclipse/emf/cdo/server/internal/hibernate/tuplizer/CDORevisionPropertyAccessor.java new file mode 100644 index 0000000000..1a80a78ac0 --- /dev/null +++ b/plugins/org.eclipse.emf.cdo.server.hibernate/src/org/eclipse/emf/cdo/server/internal/hibernate/tuplizer/CDORevisionPropertyAccessor.java @@ -0,0 +1,155 @@ +/*************************************************************************** + * Copyright (c) 2004 - 2008 Eike Stepper, Germany. + * 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.server.internal.hibernate.tuplizer; + +import org.eclipse.emf.cdo.internal.protocol.revision.InternalCDORevision; +import org.eclipse.emf.cdo.protocol.model.CDOFeature; + +import org.hibernate.HibernateException; +import org.hibernate.PropertyNotFoundException; +import org.hibernate.engine.SessionFactoryImplementor; +import org.hibernate.engine.SessionImplementor; +import org.hibernate.property.Getter; +import org.hibernate.property.PropertyAccessor; +import org.hibernate.property.Setter; + +import java.lang.reflect.Method; +import java.util.Map; + +/** + * @author Eike Stepper + */ +public class CDORevisionPropertyAccessor implements PropertyAccessor +{ + private CDORevisionTuplizer tuplizer; + + public CDORevisionPropertyAccessor(CDORevisionTuplizer tuplizer) + { + this.tuplizer = tuplizer; + } + + public CDORevisionTuplizer getTuplizer() + { + return tuplizer; + } + + @SuppressWarnings("unchecked") + public Getter getGetter(Class theClass, String propertyName) throws PropertyNotFoundException + { + return new CDORevisionGetter(this, propertyName); + } + + @SuppressWarnings("unchecked") + public Setter getSetter(Class theClass, String propertyName) throws PropertyNotFoundException + { + return new CDORevisionSetter(this, propertyName); + } + + /** + * @author Eike Stepper + */ + public static class BaseAccessor + { + private CDORevisionPropertyAccessor propertyAccessor; + + private CDOFeature cdoFeature; + + public BaseAccessor(CDORevisionPropertyAccessor propertyAccessor, String propertyName) + { + this.propertyAccessor = propertyAccessor; + cdoFeature = propertyAccessor.getTuplizer().getCDOClass().lookupFeature(propertyName); + if (cdoFeature == null) + { + throw new IllegalStateException("Feature not found: " + propertyName); + } + } + + public CDORevisionPropertyAccessor getPropertyAccessor() + { + return propertyAccessor; + } + + public CDOFeature getCDOFeature() + { + return cdoFeature; + } + } + + /** + * @author Eike Stepper + */ + public static class CDORevisionGetter extends BaseAccessor implements Getter + { + private static final long serialVersionUID = 1L; + + public CDORevisionGetter(CDORevisionPropertyAccessor propertyAccessor, String propertyName) + { + super(propertyAccessor, propertyName); + } + + public Object get(Object target) throws HibernateException + { + InternalCDORevision revision = (InternalCDORevision)target; + return revision.getValue(getCDOFeature()); + } + + @SuppressWarnings("unchecked") + public Object getForInsert(Object target, Map mergeMap, SessionImplementor session) throws HibernateException + { + return get(target); + } + + public Method getMethod() + { + return null; + } + + public String getMethodName() + { + return null; + } + + @SuppressWarnings("unchecked") + public Class getReturnType() + { + return Object.class; + } + } + + /** + * @author Eike Stepper + */ + public static class CDORevisionSetter extends BaseAccessor implements Setter + { + private static final long serialVersionUID = 1L; + + public CDORevisionSetter(CDORevisionPropertyAccessor propertyAccessor, String propertyName) + { + super(propertyAccessor, propertyName); + } + + public Method getMethod() + { + return null; + } + + public String getMethodName() + { + return null; + } + + public void set(Object target, Object value, SessionFactoryImplementor factory) throws HibernateException + { + InternalCDORevision revision = (InternalCDORevision)target; + revision.setValue(getCDOFeature(), value); + } + } +} diff --git a/plugins/org.eclipse.emf.cdo.server.hibernate/src/org/eclipse/emf/cdo/server/internal/hibernate/tuplizer/CDORevisionProxy.java b/plugins/org.eclipse.emf.cdo.server.hibernate/src/org/eclipse/emf/cdo/server/internal/hibernate/tuplizer/CDORevisionProxy.java new file mode 100644 index 0000000000..da85d7d8a6 --- /dev/null +++ b/plugins/org.eclipse.emf.cdo.server.hibernate/src/org/eclipse/emf/cdo/server/internal/hibernate/tuplizer/CDORevisionProxy.java @@ -0,0 +1,302 @@ +/*************************************************************************** + * Copyright (c) 2004 - 2008 Eike Stepper, Germany. + * 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.server.internal.hibernate.tuplizer; + +import org.eclipse.emf.cdo.internal.protocol.revision.InternalCDORevision; +import org.eclipse.emf.cdo.protocol.id.CDOID; +import org.eclipse.emf.cdo.protocol.id.CDOIDProvider; +import org.eclipse.emf.cdo.protocol.id.CDOIDTemp; +import org.eclipse.emf.cdo.protocol.model.CDOClass; +import org.eclipse.emf.cdo.protocol.model.CDOFeature; +import org.eclipse.emf.cdo.protocol.revision.CDORevision; +import org.eclipse.emf.cdo.protocol.revision.CDORevisionData; +import org.eclipse.emf.cdo.protocol.revision.CDORevisionResolver; +import org.eclipse.emf.cdo.protocol.revision.delta.CDORevisionDelta; + +import org.eclipse.net4j.util.collection.MoveableList; +import org.eclipse.net4j.util.io.ExtendedDataOutput; + +import org.hibernate.proxy.HibernateProxy; +import org.hibernate.proxy.LazyInitializer; + +import java.io.IOException; +import java.io.Serializable; +import java.util.Map; + +/** + * @author Eike Stepper + */ +public class CDORevisionProxy implements HibernateProxy, InternalCDORevision, Serializable +{ + private static final long serialVersionUID = 1L; + + private CDORevisionLazyInitializer li; + + CDORevisionProxy(CDORevisionLazyInitializer li) + { + this.li = li; + } + + public Object writeReplace() + { + return this; + } + + public LazyInitializer getHibernateLazyInitializer() + { + return li; + } + + public void add(CDOFeature feature, int index, Object value) + { + li.getRevision().add(feature, index, value); + } + + public void adjustReferences(Map<CDOIDTemp, CDOID> idMappings) + { + li.getRevision().adjustReferences(idMappings); + } + + public void clear(CDOFeature feature) + { + li.getRevision().clear(feature); + } + + public CDORevisionDelta compare(CDORevision origin) + { + return li.getRevision().compare(origin); + } + + public boolean contains(CDOFeature feature, Object value) + { + return li.getRevision().contains(feature, value); + } + + public Object get(CDOFeature feature, int index) + { + return li.getRevision().get(feature, index); + } + + public CDOClass getCDOClass() + { + return li.getRevision().getCDOClass(); + } + + public CDOID getContainerID() + { + return li.getRevision().getContainerID(); + } + + public int getContainingFeatureID() + { + return li.getRevision().getContainingFeatureID(); + } + + public long getCreated() + { + return li.getRevision().getCreated(); + } + + public CDORevisionData getData() + { + return li.getRevision().getData(); + } + + public CDOID getID() + { + return li.getRevision().getID(); + } + + public MoveableList<Object> getList(CDOFeature feature, int size) + { + return li.getRevision().getList(feature, size); + } + + public MoveableList<Object> getList(CDOFeature feature) + { + return li.getRevision().getList(feature); + } + + public CDOID getResourceID() + { + return li.getRevision().getResourceID(); + } + + public long getRevised() + { + return li.getRevision().getRevised(); + } + + public CDORevision getRevision() + { + return li.getRevision().getRevision(); + } + + public CDORevisionResolver getRevisionResolver() + { + return li.getRevision().getRevisionResolver(); + } + + public Object getValue(CDOFeature feature) + { + return li.getRevision().getValue(feature); + } + + public int getVersion() + { + return li.getRevision().getVersion(); + } + + public int hashCode(CDOFeature feature) + { + return li.getRevision().hashCode(feature); + } + + public int indexOf(CDOFeature feature, Object value) + { + return li.getRevision().indexOf(feature, value); + } + + public boolean isCurrent() + { + return li.getRevision().isCurrent(); + } + + public boolean isEmpty(CDOFeature feature) + { + return li.getRevision().isEmpty(feature); + } + + public boolean isResource() + { + return li.getRevision().isResource(); + } + + public boolean isSet(CDOFeature feature) + { + return li.getRevision().isSet(feature); + } + + public boolean isTransactional() + { + return li.getRevision().isTransactional(); + } + + public boolean isValid(long timeStamp) + { + return li.getRevision().isValid(timeStamp); + } + + public int lastIndexOf(CDOFeature feature, Object value) + { + return li.getRevision().lastIndexOf(feature, value); + } + + public void merge(CDORevisionDelta delta) + { + li.getRevision().merge(delta); + } + + public Object move(CDOFeature feature, int targetIndex, int sourceIndex) + { + return li.getRevision().move(feature, targetIndex, sourceIndex); + } + + public Object remove(CDOFeature feature, int index) + { + return li.getRevision().remove(feature, index); + } + + public Object set(CDOFeature feature, int index, Object value) + { + return li.getRevision().set(feature, index, value); + } + + public void setContainerID(CDOID containerID) + { + li.getRevision().setContainerID(containerID); + } + + public void setContainingFeatureID(int containingFeatureID) + { + li.getRevision().setContainingFeatureID(containingFeatureID); + } + + public void setCreated(long created) + { + li.getRevision().setCreated(created); + } + + public void setID(CDOID id) + { + li.getRevision().setID(id); + } + + public void setListSize(CDOFeature feature, int size) + { + li.getRevision().setListSize(feature, size); + } + + public void setResourceID(CDOID resourceID) + { + li.getRevision().setResourceID(resourceID); + } + + public void setRevised(long revised) + { + li.getRevision().setRevised(revised); + } + + public int setTransactional() + { + return li.getRevision().setTransactional(); + } + + public void setUntransactional() + { + li.getRevision().setUntransactional(); + } + + public Object setValue(CDOFeature feature, Object value) + { + return li.getRevision().setValue(feature, value); + } + + public void setVersion(int version) + { + li.getRevision().setVersion(version); + } + + public int size(CDOFeature feature) + { + return li.getRevision().size(feature); + } + + public <T> T[] toArray(CDOFeature feature, T[] array) + { + return li.getRevision().toArray(feature, array); + } + + public Object[] toArray(CDOFeature feature) + { + return li.getRevision().toArray(feature); + } + + public void unset(CDOFeature feature) + { + li.getRevision().unset(feature); + } + + public void write(ExtendedDataOutput out, CDOIDProvider idProvider, int referenceChunk) throws IOException + { + li.getRevision().write(out, idProvider, referenceChunk); + } +} diff --git a/plugins/org.eclipse.emf.cdo.server.hibernate/src/org/eclipse/emf/cdo/server/internal/hibernate/tuplizer/CDORevisionProxyFactory.java b/plugins/org.eclipse.emf.cdo.server.hibernate/src/org/eclipse/emf/cdo/server/internal/hibernate/tuplizer/CDORevisionProxyFactory.java new file mode 100644 index 0000000000..320f6e1469 --- /dev/null +++ b/plugins/org.eclipse.emf.cdo.server.hibernate/src/org/eclipse/emf/cdo/server/internal/hibernate/tuplizer/CDORevisionProxyFactory.java @@ -0,0 +1,45 @@ +/*************************************************************************** + * Copyright (c) 2004 - 2008 Eike Stepper, Germany. + * 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.server.internal.hibernate.tuplizer; + +import org.hibernate.HibernateException; +import org.hibernate.engine.SessionImplementor; +import org.hibernate.proxy.HibernateProxy; +import org.hibernate.proxy.ProxyFactory; +import org.hibernate.type.AbstractComponentType; + +import java.io.Serializable; +import java.lang.reflect.Method; +import java.util.Set; + +/** + * @author Eike Stepper + */ +public class CDORevisionProxyFactory implements ProxyFactory +{ + private String entityName; + + public CDORevisionProxyFactory() + { + } + + @SuppressWarnings("unchecked") + public void postInstantiate(String entityName, Class persistentClass, Set interfaces, Method getIdentifierMethod, + Method setIdentifierMethod, AbstractComponentType componentIdType) throws HibernateException + { + this.entityName = entityName; + } + + public HibernateProxy getProxy(Serializable id, SessionImplementor session) throws HibernateException + { + return new CDORevisionProxy(new CDORevisionLazyInitializer(entityName, id, session)); + } +} diff --git a/plugins/org.eclipse.emf.cdo.server.hibernate/src/org/eclipse/emf/cdo/server/internal/hibernate/tuplizer/CDORevisionTuplizer.java b/plugins/org.eclipse.emf.cdo.server.hibernate/src/org/eclipse/emf/cdo/server/internal/hibernate/tuplizer/CDORevisionTuplizer.java new file mode 100644 index 0000000000..423b357370 --- /dev/null +++ b/plugins/org.eclipse.emf.cdo.server.hibernate/src/org/eclipse/emf/cdo/server/internal/hibernate/tuplizer/CDORevisionTuplizer.java @@ -0,0 +1,283 @@ +/*************************************************************************** + * Copyright (c) 2004 - 2008 Eike Stepper, 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 - changed handling of propertygetters/setters + **************************************************************************/ +package org.eclipse.emf.cdo.server.internal.hibernate.tuplizer; + +import org.eclipse.emf.cdo.internal.protocol.revision.InternalCDORevision; +import org.eclipse.emf.cdo.protocol.model.CDOClass; +import org.eclipse.emf.cdo.protocol.model.CDOFeature; +import org.eclipse.emf.cdo.protocol.model.CDOPackage; +import org.eclipse.emf.cdo.protocol.model.resource.CDOResourcePackage; +import org.eclipse.emf.cdo.server.internal.hibernate.HibernateStore; +import org.eclipse.emf.cdo.server.internal.hibernate.bundle.OM; + +import org.eclipse.net4j.internal.util.om.trace.ContextTracer; + +import org.hibernate.EntityMode; +import org.hibernate.HibernateException; +import org.hibernate.mapping.PersistentClass; +import org.hibernate.mapping.Property; +import org.hibernate.property.Getter; +import org.hibernate.property.Setter; +import org.hibernate.proxy.ProxyFactory; +import org.hibernate.tuple.Instantiator; +import org.hibernate.tuple.entity.AbstractEntityTuplizer; +import org.hibernate.tuple.entity.EntityMetamodel; + +/** + * @author Eike Stepper + */ +public class CDORevisionTuplizer extends AbstractEntityTuplizer +{ + private static final ContextTracer TRACER = new ContextTracer(OM.DEBUG, CDORevisionTuplizer.class); + + private CDOClass cdoClass; + + public CDORevisionTuplizer(EntityMetamodel entityMetamodel, PersistentClass mappingInfo) + { + super(entityMetamodel, mappingInfo); + TRACER.trace("Created CDORevisionTuplizer for entity " + mappingInfo.getEntityName()); + initCDOClass(mappingInfo); + } + + private void initCDOClass(PersistentClass mappingInfo) + { + if (cdoClass != null) + { + return; + } + final HibernateStore hbStore = HibernateStore.getCurrentHibernateStore(); + + // find the CDOClass/Package + // TODO: error handling if meta attribute not present + // TODO: error handling if entityname not set + final String entityName = mappingInfo.getEntityName(); + final String ePackageURI = mappingInfo.getMetaAttribute("epackage").getValue(); + + TRACER.trace("EntityName/packageURI " + entityName + " " + ePackageURI); + + for (CDOPackage cdoPackage : hbStore.getPackageHandler().getCDOPackages()) + { + if (cdoPackage.getPackageURI().compareTo(ePackageURI) != 0) + { + continue; + } + for (CDOClass localCdoClass : cdoPackage.getClasses()) + { + if (localCdoClass.getName().compareTo(entityName) == 0) + { + cdoClass = localCdoClass; + break; + } + } + } + if (cdoClass == null && ePackageURI.compareTo(CDOResourcePackage.PACKAGE_URI) == 0) + { + for (CDOClass localCdoClass : hbStore.getRepository().getPackageManager().getCDOResourcePackage().getClasses()) + { + if (localCdoClass.getName().compareTo(entityName) == 0) + { + cdoClass = localCdoClass; + TRACER.trace("Class is CDOResource class"); + break; + } + } + } + + if (cdoClass == null) + { + throw new IllegalArgumentException("The mapped class " + mappingInfo.getEntityName()); + } + } + + // MT: probably not required as the property getter/setter do all the work + // /* + // * (non-Javadoc) + // * + // * @see org.hibernate.tuple.entity.AbstractEntityTuplizer#getVersion(java.lang.Object) + // */ + // @Override + // public Object getVersion(Object entity) throws HibernateException + // { + // if (entity instanceof CDORevision) + // { + // final CDORevision cdoRevision = (CDORevision)entity; + // return cdoRevision.getVersion(); + // } + // throw new IllegalArgumentException("Entity of type: " + entity.getClass().getName() + // + " not supported by this tuplizer"); + // } + // + // @Override + // public Serializable getIdentifier(Object entity) throws HibernateException + // { + // if (entity instanceof CDORevision) + // { + // final CDOID cdoID = ((CDORevision)entity).getID(); + // if (cdoID instanceof CDOIDHibernate) + // { + // return ((CDOIDHibernate)cdoID).getId(); + // } + // } + // throw new IllegalArgumentException("Entity of type: " + entity.getClass().getName() + // + " not supported by this tuplizer"); + // } + // + // @Override + // public void setIdentifier(Object entity, Serializable id) throws HibernateException + // { + // if (entity instanceof InternalCDORevision) + // { + // final InternalCDORevision cdoRevision = (InternalCDORevision)entity; + // final CDOID cdoID = cdoRevision.getID(); + // if (cdoID == null) + // { + // CDOIDHibernate hid = (CDOIDHibernate)HibernateStore.CDOID_OBJECT_FACTORY.createCDOIDObject(null); + // hid.setId(id); + // cdoRevision.setID(hid); + // return; + // } + // else if (cdoID instanceof CDOIDHibernate) + // { + // ((CDOIDHibernate)cdoID).setId(id); + // return; + // } + // } + // throw new IllegalArgumentException("Entity of type: " + entity.getClass().getName() + // + " not supported by this tuplizer"); + // } + + @Override + public EntityMode getEntityMode() + { + return EntityMode.MAP; + } + + public CDOClass getCDOClass() + { + return cdoClass; + } + + @Override + protected Getter buildPropertyGetter(Property mappedProperty, PersistentClass mappedEntity) + { + initCDOClass(mappedEntity); + + TRACER.trace("Building property getter for " + cdoClass.getName() + "." + mappedProperty.getName()); + + if (mappedProperty.isBackRef()) + { + return mappedProperty.getGetter(mappedEntity.getMappedClass()); + } + else if (mappedProperty == mappedEntity.getIdentifierProperty()) + { + return new CDOIDPropertyGetter(this, mappedProperty.getName()); + } + else if (mappedProperty == mappedEntity.getVersion()) + { + return new CDOVersionPropertyGetter(this, mappedProperty.getName()); + } + else + { + final CDOFeature cdoFeature = getCDOClass().lookupFeature(mappedProperty.getName()); + if (cdoFeature.isReference() && cdoFeature.isMany()) + { + return new CDOManyReferenceGetter(this, mappedProperty.getName()); + } + else if (cdoFeature.isReference()) + { + return new CDOReferenceGetter(this, mappedProperty.getName()); + } + else + { + return new CDOPropertyGetter(this, mappedProperty.getName()); + } + } + } + + @Override + protected Setter buildPropertySetter(Property mappedProperty, PersistentClass mappedEntity) + { + initCDOClass(mappedEntity); + + TRACER.trace("Building property setter for " + cdoClass.getName() + "." + mappedProperty.getName()); + + if (mappedProperty.isBackRef()) + { + return mappedProperty.getSetter(mappedEntity.getMappedClass()); + } + else if (mappedProperty == mappedEntity.getIdentifierProperty()) + { + return new CDOIDPropertySetter(this, mappedProperty.getName()); + } + else if (mappedProperty == mappedEntity.getVersion()) + { + return new CDOVersionPropertySetter(this, mappedProperty.getName()); + } + else + { + final CDOFeature cdoFeature = getCDOClass().lookupFeature(mappedProperty.getName()); + if (cdoFeature.isReference() && cdoFeature.isMany()) + { + return new CDOManyReferenceSetter(this, mappedProperty.getName()); + } + else if (cdoFeature.isReference()) + { + return new CDOReferenceSetter(this, mappedProperty.getName()); + } + else + { + return new CDOPropertySetter(this, mappedProperty.getName()); + } + } + } + + @Override + protected Instantiator buildInstantiator(PersistentClass mappingInfo) + { + return new CDORevisionInstantiator(this, mappingInfo); + } + + @Override + protected ProxyFactory buildProxyFactory(PersistentClass mappingInfo, Getter idGetter, Setter idSetter) + { + ProxyFactory pf = new CDORevisionProxyFactory(); + + try + { + pf.postInstantiate(getEntityName(), null, null, null, null, null); + } + catch (HibernateException ex) + { + OM.LOG.error("Could not create proxy factory for " + getEntityName(), ex); + pf = null; + } + + return pf; + } + + @SuppressWarnings("unchecked") + public Class getMappedClass() + { + return InternalCDORevision.class; + } + + @SuppressWarnings("unchecked") + public Class getConcreteProxyClass() + { + return InternalCDORevision.class; + } + + public boolean isInstrumented() + { + return false; + } +} diff --git a/plugins/org.eclipse.emf.cdo.server.hibernate/src/org/eclipse/emf/cdo/server/internal/hibernate/tuplizer/CDOTypeUserType.java b/plugins/org.eclipse.emf.cdo.server.hibernate/src/org/eclipse/emf/cdo/server/internal/hibernate/tuplizer/CDOTypeUserType.java new file mode 100644 index 0000000000..979f17b4cb --- /dev/null +++ b/plugins/org.eclipse.emf.cdo.server.hibernate/src/org/eclipse/emf/cdo/server/internal/hibernate/tuplizer/CDOTypeUserType.java @@ -0,0 +1,115 @@ +/*************************************************************************** + * Copyright (c) 2008 - 2008 Martin Taal 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 - initial api + **************************************************************************/ +package org.eclipse.emf.cdo.server.internal.hibernate.tuplizer; + +import org.eclipse.emf.cdo.internal.protocol.model.CDOTypeImpl; +import org.eclipse.emf.cdo.protocol.model.CDOType; + +import org.hibernate.Hibernate; +import org.hibernate.usertype.UserType; + +import java.io.Serializable; +import java.sql.PreparedStatement; +import java.sql.ResultSet; +import java.sql.SQLException; +import java.sql.Types; + +/** + * @author Martin Taal + */ +public class CDOTypeUserType implements UserType +{ + + private static final int[] SQL_TYPES = { Types.INTEGER }; + + public int[] sqlTypes() + { + return SQL_TYPES; + } + + public Class<?> returnedClass() + { + return CDOType.class; + } + + public boolean isMutable() + { + return false; + } + + public CDOTypeUserType() + { + } + + public Object deepCopy(Object value) + { + return value; + } + + public boolean equals(Object x, Object y) + { + if (x == y) + { + return true; + } + if (x == null || y == null) + { + return false; + } + return x.equals(y); + } + + public Object nullSafeGet(ResultSet rs, String[] names, Object owner) throws SQLException + { + final Integer value = (Integer)Hibernate.INTEGER.nullSafeGet(rs, names[0]); + if (rs.wasNull()) + { + return null; + } + if (value == null) + { + return null; + } + return CDOTypeImpl.index.get(value); + } + + public void nullSafeSet(PreparedStatement statement, Object value, int index) throws SQLException + { + if (value != null) + { + statement.setInt(index, ((CDOType)value).getTypeID()); + } + else + { + statement.setNull(index, Types.INTEGER); + } + } + + public Serializable disassemble(Object value) + { + return (Serializable)value; + } + + public Object assemble(Serializable cachedValue, Object owner) + { + return cachedValue; + } + + public Object replace(Object original, Object target, Object owner) + { + return original; + } + + public int hashCode(Object x) + { + return x.hashCode(); + } +} diff --git a/plugins/org.eclipse.emf.cdo.server.hibernate/src/org/eclipse/emf/cdo/server/internal/hibernate/tuplizer/CDOVersionPropertyGetter.java b/plugins/org.eclipse.emf.cdo.server.hibernate/src/org/eclipse/emf/cdo/server/internal/hibernate/tuplizer/CDOVersionPropertyGetter.java new file mode 100644 index 0000000000..e928f551ff --- /dev/null +++ b/plugins/org.eclipse.emf.cdo.server.hibernate/src/org/eclipse/emf/cdo/server/internal/hibernate/tuplizer/CDOVersionPropertyGetter.java @@ -0,0 +1,51 @@ +/*************************************************************************** + * Copyright (c) 2004 - 2008 Martin Taal + * 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 - copied from CDORevisionPropertyHandler and adapted + **************************************************************************/ +package org.eclipse.emf.cdo.server.internal.hibernate.tuplizer; + +import org.eclipse.emf.cdo.internal.protocol.revision.InternalCDORevision; + +import org.hibernate.HibernateException; + +/** + * @author Martin Taal + */ +public class CDOVersionPropertyGetter extends CDOPropertyGetter +{ + private static final long serialVersionUID = 1L; + + public CDOVersionPropertyGetter(CDORevisionTuplizer tuplizer, String propertyName) + { + super(tuplizer, propertyName); + } + + @Override + public Object get(Object target) throws HibernateException + { + final InternalCDORevision revision = (InternalCDORevision)target; + if (isVirtualProperty()) + { + return revision.getVersion(); + } + else + { + final Object version = super.get(target); + // TODO: does this make sense? + // revision.setVersion(((Number)value).intValue()); + return version; + } + } + + @Override + protected boolean isVirtualPropertyAllowed() + { + return true; + } +} diff --git a/plugins/org.eclipse.emf.cdo.server.hibernate/src/org/eclipse/emf/cdo/server/internal/hibernate/tuplizer/CDOVersionPropertySetter.java b/plugins/org.eclipse.emf.cdo.server.hibernate/src/org/eclipse/emf/cdo/server/internal/hibernate/tuplizer/CDOVersionPropertySetter.java new file mode 100644 index 0000000000..4aa93a25ca --- /dev/null +++ b/plugins/org.eclipse.emf.cdo.server.hibernate/src/org/eclipse/emf/cdo/server/internal/hibernate/tuplizer/CDOVersionPropertySetter.java @@ -0,0 +1,46 @@ +/*************************************************************************** + * Copyright (c) 2004 - 2008 Martin Taal + * 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 - copied from CDORevisionPropertyHandler and adapted + **************************************************************************/ +package org.eclipse.emf.cdo.server.internal.hibernate.tuplizer; + +import org.eclipse.emf.cdo.internal.protocol.revision.InternalCDORevision; + +import org.hibernate.HibernateException; +import org.hibernate.engine.SessionFactoryImplementor; + +/** + * @author Martin Taal + */ +public class CDOVersionPropertySetter extends CDOPropertySetter +{ + private static final long serialVersionUID = 1L; + + public CDOVersionPropertySetter(CDORevisionTuplizer tuplizer, String propertyName) + { + super(tuplizer, propertyName); + } + + @Override + public void set(Object target, Object value, SessionFactoryImplementor factory) throws HibernateException + { + final InternalCDORevision revision = (InternalCDORevision)target; + revision.setVersion(((Number)value).intValue()); + if (!isVirtualProperty()) + { + super.set(target, value, factory); + } + } + + @Override + protected boolean isVirtualPropertyAllowed() + { + return true; + } +} diff --git a/plugins/org.eclipse.emf.cdo.server.hibernate/src/org/eclipse/emf/cdo/server/internal/hibernate/tuplizer/HibernateMoveableListWrapper.java b/plugins/org.eclipse.emf.cdo.server.hibernate/src/org/eclipse/emf/cdo/server/internal/hibernate/tuplizer/HibernateMoveableListWrapper.java new file mode 100644 index 0000000000..f21e67e45a --- /dev/null +++ b/plugins/org.eclipse.emf.cdo.server.hibernate/src/org/eclipse/emf/cdo/server/internal/hibernate/tuplizer/HibernateMoveableListWrapper.java @@ -0,0 +1,314 @@ +/*************************************************************************** + * Copyright (c) 2008 - 2008 Martin Taal 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 - initial api + **************************************************************************/ +package org.eclipse.emf.cdo.server.internal.hibernate.tuplizer; + +import org.eclipse.emf.cdo.protocol.id.CDOID; +import org.eclipse.emf.cdo.protocol.revision.CDORevision; +import org.eclipse.emf.cdo.server.internal.hibernate.CDOHibernateUtil; + +import org.eclipse.net4j.internal.util.collection.MoveableArrayList; + +import java.util.ArrayList; +import java.util.Collection; +import java.util.Iterator; +import java.util.List; +import java.util.ListIterator; + +/** + * Wraps a moveable list so that hibernate always sees an object view while cdo always sees a cdoid view. + * + * @author Martin Taal + */ +public class HibernateMoveableListWrapper implements List<Object> +{ + private MoveableArrayList<Object> delegate; + + /** + * @return the delegate + */ + public MoveableArrayList<Object> getDelegate() + { + return delegate; + } + + /** + * @param delegate + * the delegate to set + */ + public void setDelegate(MoveableArrayList<Object> delegate) + { + this.delegate = delegate; + } + + protected Object getObject(Object o) + { + if (o == null) + { + return null; + } + + // is already resolved + if (!(o instanceof CDOID)) + { + return o; + } + + return CDOHibernateUtil.getInstance().getCDORevision((CDOID)o); + } + + protected List<Object> getObjects(List<?> cdoIDs) + { + final List<Object> result = new ArrayList<Object>(); + for (Object o : cdoIDs) + { + result.add(getObject(o)); + } + return result; + } + + protected CDOID getCDOID(Object o) + { + final CDORevision cdoRevision = (CDORevision)o; + return cdoRevision.getID(); + } + + protected List<CDOID> getCDOIDs(Collection<?> c) + { + final List<CDOID> newC = new ArrayList<CDOID>(); + for (Object o : c) + { + newC.add(getCDOID(o)); + } + return newC; + } + + public void add(int index, Object element) + { + getDelegate().add(index, getCDOID(element)); + } + + public boolean add(Object o) + { + return getDelegate().add(getCDOID(o)); + } + + public boolean addAll(Collection<? extends Object> c) + { + return getDelegate().addAll(getCDOIDs(c)); + } + + public boolean addAll(int index, Collection<? extends Object> c) + { + return getDelegate().addAll(index, getCDOIDs(c)); + } + + public void clear() + { + getDelegate().clear(); + } + + public boolean contains(Object o) + { + return getDelegate().contains(getCDOID(o)); + } + + public boolean containsAll(Collection<?> c) + { + return getDelegate().containsAll(getCDOIDs(c)); + } + + public Object get(int index) + { + return getObject(getDelegate().get(index)); + } + + public int indexOf(Object o) + { + return getDelegate().indexOf(getCDOID(o)); + } + + public boolean isEmpty() + { + return getDelegate().isEmpty(); + } + + public Iterator<Object> iterator() + { + return new CDOHibernateIterator(getDelegate().iterator()); + } + + public int lastIndexOf(Object o) + { + return getDelegate().lastIndexOf(getCDOID(o)); + } + + public ListIterator<Object> listIterator() + { + return new CDOHibernateListIterator(getDelegate().listIterator()); + } + + public ListIterator<Object> listIterator(int index) + { + return new CDOHibernateListIterator(getDelegate().listIterator(index)); + } + + public Object remove(int index) + { + return getDelegate().remove(index); + } + + public boolean remove(Object o) + { + return getDelegate().remove(getCDOID(o)); + } + + public boolean removeAll(Collection<?> c) + { + return getDelegate().removeAll(getCDOIDs(c)); + } + + public boolean retainAll(Collection<?> c) + { + return getDelegate().retainAll(getCDOIDs(c)); + } + + public Object set(int index, Object element) + { + return getDelegate().set(index, getCDOID(element)); + } + + public int size() + { + return getDelegate().size(); + } + + public List<Object> subList(int fromIndex, int toIndex) + { + return getObjects(getDelegate().subList(fromIndex, toIndex)); + } + + public Object[] toArray() + { + final Object[] result = new Object[size()]; + int i = 0; + for (Object o : this) + { + result[i++] = o; + } + return result; + } + + @SuppressWarnings("unchecked") + public <T> T[] toArray(T[] a) + { + int i = 0; + for (Object o : this) + { + a[i++] = (T)o; + } + return a; + } + + private static class CDOHibernateIterator implements Iterator<Object> + { + final Iterator<?> delegate; + + CDOHibernateIterator(Iterator<?> delegate) + { + this.delegate = delegate; + } + + public boolean hasNext() + { + return delegate.hasNext(); + } + + public Object next() + { + final Object o = this.delegate.next(); + if (o instanceof CDOID) + { + return CDOHibernateUtil.getInstance().getCDORevision((CDOID)o); + } + return o; + } + + public void remove() + { + delegate.remove(); + } + } + + private class CDOHibernateListIterator implements ListIterator<Object> + { + final ListIterator<Object> delegate; + + CDOHibernateListIterator(ListIterator<Object> delegate) + { + this.delegate = delegate; + } + + public void add(Object o) + { + delegate.add(((CDORevision)o).getID()); + } + + public boolean hasNext() + { + return delegate.hasNext(); + } + + public boolean hasPrevious() + { + return delegate.hasPrevious(); + } + + public Object next() + { + final Object o = this.delegate.next(); + if (o instanceof CDOID) + { + return CDOHibernateUtil.getInstance().getCDORevision((CDOID)delegate.next()); + } + return o; + } + + public int nextIndex() + { + return delegate.nextIndex(); + } + + public Object previous() + { + final Object o = this.delegate.previous(); + if (o instanceof CDOID) + { + return CDOHibernateUtil.getInstance().getCDORevision((CDOID)delegate.next()); + } + return o; + } + + public int previousIndex() + { + return delegate.previousIndex(); + } + + public void remove() + { + delegate.remove(); + } + + public void set(Object o) + { + delegate.set(((CDORevision)o).getID()); + } + } +} diff --git a/plugins/org.eclipse.emf.cdo.server.hibernate/src/org/eclipse/emf/cdo/server/internal/hibernate/tuplizer/PersistableListHolder.java b/plugins/org.eclipse.emf.cdo.server.hibernate/src/org/eclipse/emf/cdo/server/internal/hibernate/tuplizer/PersistableListHolder.java new file mode 100644 index 0000000000..91962e873a --- /dev/null +++ b/plugins/org.eclipse.emf.cdo.server.hibernate/src/org/eclipse/emf/cdo/server/internal/hibernate/tuplizer/PersistableListHolder.java @@ -0,0 +1,103 @@ +/*************************************************************************** + * Copyright (c) 2004 - 2008 Martin Taal 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 - copied from CDORevisionPropertyHandler and adapted + **************************************************************************/ +package org.eclipse.emf.cdo.server.internal.hibernate.tuplizer; + +import org.eclipse.emf.cdo.protocol.model.CDOFeature; +import org.eclipse.emf.cdo.protocol.revision.CDORevision; +import org.eclipse.emf.cdo.server.internal.hibernate.bundle.OM; + +import org.eclipse.net4j.internal.util.om.trace.ContextTracer; + +import org.hibernate.collection.PersistentCollection; + +import java.util.HashMap; +import java.util.Map; + +/** + * Keeps mappings from object/feature combinations to a hibernate persistable list. This works because the write action + * is done in one thread. + * + * @author Martin Taal + */ + +public class PersistableListHolder +{ + private static final ContextTracer TRACER = new ContextTracer(OM.DEBUG, PersistableListHolder.class); + + private static PersistableListHolder instance = new PersistableListHolder(); + + public static PersistableListHolder getInstance() + { + return instance; + } + + public static void setInstance(PersistableListHolder instance) + { + PersistableListHolder.instance = instance; + } + + private ThreadLocal<Map<Key, PersistentCollection>> listMapping = new ThreadLocal<Map<Key, PersistentCollection>>(); + + public void putListMapping(Object target, CDOFeature cdoFeature, PersistentCollection collection) + { + final Key key = new Key(target, cdoFeature); + getListMapping().put(key, collection); + TRACER.trace("Stored hb list in threadlocal: " + ((CDORevision)target).getCDOClass().getName() + "." + + cdoFeature.getName()); + } + + public PersistentCollection getListMapping(Object target, CDOFeature cdoFeature) + { + final Key key = new Key(target, cdoFeature); + return getListMapping().get(key); + } + + private Map<Key, PersistentCollection> getListMapping() + { + if (listMapping.get() == null) + { + listMapping.set(new HashMap<Key, PersistentCollection>()); + } + return listMapping.get(); + } + + private class Key + { + private Object owner; + + private CDOFeature cdoFeature; + + Key(Object owner, CDOFeature cdoFeature) + { + this.owner = owner; + this.cdoFeature = cdoFeature; + } + + @Override + public boolean equals(Object obj) + { + if (!(obj instanceof Key)) + { + return false; + } + final Key otherKey = (Key)obj; + // the owner is uniquely present in mem, the same applies for the cdoFeature + // therefore == is allowed + return owner == otherKey.owner && cdoFeature == otherKey.cdoFeature; + } + + @Override + public int hashCode() + { + return owner.hashCode() + cdoFeature.hashCode(); + } + } +} diff --git a/plugins/org.eclipse.emf.cdo.tests.hibernate/.classpath b/plugins/org.eclipse.emf.cdo.tests.hibernate/.classpath new file mode 100644 index 0000000000..304e86186a --- /dev/null +++ b/plugins/org.eclipse.emf.cdo.tests.hibernate/.classpath @@ -0,0 +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="output" path="bin"/> +</classpath> diff --git a/plugins/org.eclipse.emf.cdo.tests.hibernate/.cvsignore b/plugins/org.eclipse.emf.cdo.tests.hibernate/.cvsignore new file mode 100644 index 0000000000..ef2fbf6ec2 --- /dev/null +++ b/plugins/org.eclipse.emf.cdo.tests.hibernate/.cvsignore @@ -0,0 +1,5 @@ +bin +doc +model1X.ecore +state +*.log diff --git a/plugins/org.eclipse.emf.cdo.tests.hibernate/.project b/plugins/org.eclipse.emf.cdo.tests.hibernate/.project new file mode 100644 index 0000000000..d7664e5c81 --- /dev/null +++ b/plugins/org.eclipse.emf.cdo.tests.hibernate/.project @@ -0,0 +1,28 @@ +<?xml version="1.0" encoding="UTF-8"?> +<projectDescription> + <name>org.eclipse.emf.cdo.tests.hibernate</name> + <comment></comment> + <projects> + </projects> + <buildSpec> + <buildCommand> + <name>org.eclipse.jdt.core.javabuilder</name> + <arguments> + </arguments> + </buildCommand> + <buildCommand> + <name>org.eclipse.pde.ManifestBuilder</name> + <arguments> + </arguments> + </buildCommand> + <buildCommand> + <name>org.eclipse.pde.SchemaBuilder</name> + <arguments> + </arguments> + </buildCommand> + </buildSpec> + <natures> + <nature>org.eclipse.pde.PluginNature</nature> + <nature>org.eclipse.jdt.core.javanature</nature> + </natures> +</projectDescription> diff --git a/plugins/org.eclipse.emf.cdo.tests.hibernate/.settings/org.eclipse.jdt.core.prefs b/plugins/org.eclipse.emf.cdo.tests.hibernate/.settings/org.eclipse.jdt.core.prefs new file mode 100644 index 0000000000..85dc5b8c67 --- /dev/null +++ b/plugins/org.eclipse.emf.cdo.tests.hibernate/.settings/org.eclipse.jdt.core.prefs @@ -0,0 +1,7 @@ +#Sun Jan 07 14:27:04 CET 2007 +eclipse.preferences.version=1 +org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5 +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 diff --git a/plugins/org.eclipse.emf.cdo.tests.hibernate/CDO AllTests.launch b/plugins/org.eclipse.emf.cdo.tests.hibernate/CDO AllTests.launch new file mode 100644 index 0000000000..8c875b2d3c --- /dev/null +++ b/plugins/org.eclipse.emf.cdo.tests.hibernate/CDO AllTests.launch @@ -0,0 +1,19 @@ +<?xml version="1.0" encoding="UTF-8" standalone="no"?> +<launchConfiguration type="org.eclipse.jdt.junit.launchconfig"> +<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_PATHS"> +<listEntry value="/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/AllTests.java"/> +</listAttribute> +<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_TYPES"> +<listEntry value="1"/> +</listAttribute> +<booleanAttribute key="org.eclipse.debug.core.appendEnvironmentVariables" value="true"/> +<stringAttribute key="org.eclipse.debug.core.source_locator_id" value="org.eclipse.jdt.launching.sourceLocator.JavaSourceLookupDirector"/> +<stringAttribute key="org.eclipse.debug.core.source_locator_memento" value="<?xml version="1.0" encoding="UTF-8" standalone="no"?> <sourceLookupDirector> <sourceContainers duplicates="false"> <container memento="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?&gt;&#13;&#10;&lt;javaProject name=&quot;org.eclipse.emf.cdo&quot;/&gt;&#13;&#10;" typeId="org.eclipse.jdt.launching.sourceContainer.javaProject"/> <container memento="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?&gt;&#13;&#10;&lt;default/&gt;&#13;&#10;" typeId="org.eclipse.debug.core.containerType.default"/> </sourceContainers> </sourceLookupDirector> "/> +<stringAttribute key="org.eclipse.jdt.junit.CONTAINER" value=""/> +<booleanAttribute key="org.eclipse.jdt.junit.KEEPRUNNING_ATTR" value="false"/> +<stringAttribute key="org.eclipse.jdt.junit.TESTNAME" value=""/> +<stringAttribute key="org.eclipse.jdt.junit.TEST_KIND" value="org.eclipse.jdt.junit.loader.junit3"/> +<stringAttribute key="org.eclipse.jdt.launching.MAIN_TYPE" value="org.eclipse.emf.cdo.tests.AllTests"/> +<stringAttribute key="org.eclipse.jdt.launching.PROJECT_ATTR" value="org.eclipse.emf.cdo.tests"/> +<stringAttribute key="org.eclipse.jdt.launching.VM_ARGUMENTS" value="-Ddebug=true -Dvista.cache.selector"/> +</launchConfiguration> diff --git a/plugins/org.eclipse.emf.cdo.tests.hibernate/CDO2 TDD.launch b/plugins/org.eclipse.emf.cdo.tests.hibernate/CDO2 TDD.launch new file mode 100644 index 0000000000..d7e8b31981 --- /dev/null +++ b/plugins/org.eclipse.emf.cdo.tests.hibernate/CDO2 TDD.launch @@ -0,0 +1,15 @@ +<?xml version="1.0" encoding="UTF-8" standalone="no"?> +<launchConfiguration type="org.eclipse.jdt.launching.localJavaApplication"> +<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_PATHS"> +<listEntry value="/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/TDD.java"/> +</listAttribute> +<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_TYPES"> +<listEntry value="1"/> +</listAttribute> +<booleanAttribute key="org.eclipse.debug.core.appendEnvironmentVariables" value="true"/> +<stringAttribute key="org.eclipse.debug.core.source_locator_id" value="org.eclipse.jdt.launching.sourceLocator.JavaSourceLookupDirector"/> +<stringAttribute key="org.eclipse.debug.core.source_locator_memento" value="<?xml version="1.0" encoding="UTF-8" standalone="no"?> <sourceLookupDirector> <sourceContainers duplicates="false"> <container memento="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?&gt;&#13;&#10;&lt;folder nest=&quot;false&quot; path=&quot;/org.eclipse.emf.cdo.weaver.ajdt/ecore&quot;/&gt;&#13;&#10;" typeId="org.eclipse.debug.core.containerType.folder"/> <container memento="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?&gt;&#13;&#10;&lt;default/&gt;&#13;&#10;" typeId="org.eclipse.debug.core.containerType.default"/> </sourceContainers> </sourceLookupDirector> "/> +<stringAttribute key="org.eclipse.jdt.launching.MAIN_TYPE" value="org.eclipse.emf.cdo.tests.TDD"/> +<stringAttribute key="org.eclipse.jdt.launching.PROJECT_ATTR" value="org.eclipse.emf.cdo.tests"/> +<stringAttribute key="org.eclipse.jdt.launching.VM_ARGUMENTS" value="-Ddebug=true -Xms256m -Xmx1024m"/> +</launchConfiguration> 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 new file mode 100644 index 0000000000..2a151524d4 --- /dev/null +++ b/plugins/org.eclipse.emf.cdo.tests.hibernate/META-INF/MANIFEST.MF @@ -0,0 +1,15 @@ +Manifest-Version: 1.0 +Bundle-ManifestVersion: 2 +Bundle-Name: %pluginName +Bundle-SymbolicName: org.eclipse.emf.cdo.tests.hibernate +Bundle-Version: 0.8.0.qualifier +Bundle-Activator: org.eclipse.emf.cdo.tests.hibernate.Activator +Bundle-Vendor: %providerName +Bundle-ClassPath: . +Bundle-Localization: plugin +Bundle-RequiredExecutionEnvironment: J2SE-1.5 +Require-Bundle: org.eclipse.core.runtime;bundle-version="[3.3.0,4.0.0)", + org.eclipse.emf.cdo.tests;bundle-version="[0.8.0,0.9.0)";visibility:=reexport, + org.eclipse.emf.cdo.server.hibernate;bundle-version="[0.8.0,0.9.0)";visibility:=reexport +Eclipse-LazyStart: true +Export-Package: org.eclipse.emf.cdo.tests.hibernate diff --git a/plugins/org.eclipse.emf.cdo.tests.hibernate/about.html b/plugins/org.eclipse.emf.cdo.tests.hibernate/about.html new file mode 100644 index 0000000000..d35d5aed64 --- /dev/null +++ b/plugins/org.eclipse.emf.cdo.tests.hibernate/about.html @@ -0,0 +1,28 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" + "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml"> +<head> +<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"/> +<title>About</title> +</head> +<body lang="EN-US"> +<h2>About This Content</h2> + +<p>June 5, 2007</p> +<h3>License</h3> + +<p>The Eclipse Foundation makes available all content in this plug-in ("Content"). Unless otherwise +indicated below, the Content is provided to you under the terms and conditions of the +Eclipse Public License Version 1.0 ("EPL"). A copy of the EPL is available +at <a href="http://www.eclipse.org/legal/epl-v10.html">http://www.eclipse.org/legal/epl-v10.html</a>. +For purposes of the EPL, "Program" will mean the Content.</p> + +<p>If you did not receive this Content directly from the Eclipse Foundation, the Content is +being redistributed by another party ("Redistributor") and different terms and conditions may +apply to your use of any object code in the Content. Check the Redistributor's license that was +provided with the Content. If no such license exists, contact the Redistributor. Unless otherwise +indicated below, the terms and conditions of the EPL still apply to any source code in the Content +and such source code may be obtained at <a href="http://www.eclipse.org/">http://www.eclipse.org</a>.</p> + +</body> +</html> diff --git a/plugins/org.eclipse.emf.cdo.tests.hibernate/about.ini b/plugins/org.eclipse.emf.cdo.tests.hibernate/about.ini new file mode 100644 index 0000000000..b7e87ca285 --- /dev/null +++ b/plugins/org.eclipse.emf.cdo.tests.hibernate/about.ini @@ -0,0 +1,15 @@ +# about.ini +# contains information about a feature +# java.io.Properties file (ISO 8859-1 with "\" escapes) +# "%key" are externalized strings defined in about.properties +# This file does not need to be translated. + +# Property "aboutText" contains blurb for "About" dialog (translated) +aboutText=%featureText + +# Property "featureImage" contains path to feature image (32x32) +featureImage=modeling32.png + +# Property "appName" contains name of the application (translated) +appName=%featureName + diff --git a/plugins/org.eclipse.emf.cdo.tests.hibernate/about.mappings b/plugins/org.eclipse.emf.cdo.tests.hibernate/about.mappings new file mode 100644 index 0000000000..bddaab4310 --- /dev/null +++ b/plugins/org.eclipse.emf.cdo.tests.hibernate/about.mappings @@ -0,0 +1,6 @@ +# about.mappings +# contains fill-ins for about.properties +# java.io.Properties file (ISO 8859-1 with "\" escapes) +# This file does not need to be translated. + +0=@build@
\ No newline at end of file diff --git a/plugins/org.eclipse.emf.cdo.tests.hibernate/about.properties b/plugins/org.eclipse.emf.cdo.tests.hibernate/about.properties new file mode 100644 index 0000000000..3d3cf521d2 --- /dev/null +++ b/plugins/org.eclipse.emf.cdo.tests.hibernate/about.properties @@ -0,0 +1,31 @@ +# Copyright (c) 2004 - 2008 Eike Stepper, Germany. +# 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 + +# NLS_MESSAGEFORMAT_VAR + +# ============================================================================== +# Do not change the properties between this line and the last line containing: +# %%% END OF TRANSLATED PROPERTIES %%% +# Instead, either redefine an existing property, or create a new property, +# append it to the end of the file, and change the code to use the new name. +# ============================================================================== + +featureName = CDO Tests (Incubation) +featureText = CDO Tests\n\ +Version: {featureVersion}\n\ +Build id: {0}\n\ +\n\ +Copyright (c) 2004 - 2008 Eike Stepper, Germany. All rights reserved.\n\ +\n\ +Visit http://wiki.eclipse.org/CDO + +# ============================================================================== +# %%% END OF TRANSLATED PROPERTIES %%% +# The above properties have been shipped for translation. +# ============================================================================== diff --git a/plugins/org.eclipse.emf.cdo.tests.hibernate/build.properties b/plugins/org.eclipse.emf.cdo.tests.hibernate/build.properties new file mode 100644 index 0000000000..4319a4d9ae --- /dev/null +++ b/plugins/org.eclipse.emf.cdo.tests.hibernate/build.properties @@ -0,0 +1,30 @@ +# Copyright (c) 2004 - 2008 Eike Stepper, Germany. +# 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 + +# NLS_MESSAGEFORMAT_VAR + +source.. = src/ +output.. = bin/ +bin.includes = META-INF/,\ + .,\ + about.html,\ + copyright.txt,\ + epl-v10.html,\ + license.html,\ + plugin.properties,\ + test.xml,\ + about.ini,\ + about.mappings,\ + about.properties,\ + modeling32.png +jars.extra.classpath = platform:/plugin/org.eclipse.emf.cdo.server.hibernate/lib/asm.jar,\ + platform:/plugin/org.eclipse.emf.cdo.server.hibernate/lib/cglib-2.1.3.jar,\ + platform:/plugin/org.eclipse.emf.cdo.server.hibernate/lib/commons-collections-2.1.1.jar,\ + platform:/plugin/org.eclipse.emf.cdo.server.hibernate/lib/jta.jar,\ + platform:/plugin/org.eclipse.net4j.db.mysql/lib/mysql-connector-java-5.1.5-bin.jar diff --git a/plugins/org.eclipse.emf.cdo.tests.hibernate/copyright.txt b/plugins/org.eclipse.emf.cdo.tests.hibernate/copyright.txt new file mode 100644 index 0000000000..529118d99e --- /dev/null +++ b/plugins/org.eclipse.emf.cdo.tests.hibernate/copyright.txt @@ -0,0 +1,8 @@ +Copyright (c) 2004 - 2008 Eike Stepper, Germany. +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
\ No newline at end of file diff --git a/plugins/org.eclipse.emf.cdo.tests.hibernate/epl-v10.html b/plugins/org.eclipse.emf.cdo.tests.hibernate/epl-v10.html new file mode 100644 index 0000000000..d7b88e9416 --- /dev/null +++ b/plugins/org.eclipse.emf.cdo.tests.hibernate/epl-v10.html @@ -0,0 +1,319 @@ +<html xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns="http://www.w3.org/TR/REC-html40"><head> +<meta http-equiv="Content-Type" content="text/html; charset=windows-1252"> +<meta name="ProgId" content="Word.Document"> +<meta name="Generator" content="Microsoft Word 9"> +<meta name="Originator" content="Microsoft Word 9"> +<link rel="File-List" href="http://www.eclipse.org/org/documents/Eclipse%20EPL%202003_11_10%20Final_files/filelist.xml"><title>Eclipse Public License - Version 1.0</title><!--[if gte mso 9]><xml> + <o:DocumentProperties> + <o:Revision>2</o:Revision> + <o:TotalTime>3</o:TotalTime> + <o:Created>2004-03-05T23:03:00Z</o:Created> + <o:LastSaved>2004-03-05T23:03:00Z</o:LastSaved> + <o:Pages>4</o:Pages> + <o:Words>1626</o:Words> + <o:Characters>9270</o:Characters> + <o:Lines>77</o:Lines> + <o:Paragraphs>18</o:Paragraphs> + <o:CharactersWithSpaces>11384</o:CharactersWithSpaces> + <o:Version>9.4402</o:Version> + </o:DocumentProperties> +</xml><![endif]--><!--[if gte mso 9]><xml> + <w:WordDocument> + <w:TrackRevisions/> + </w:WordDocument> +</xml><![endif]--> + + +<style> +<!-- + /* Font Definitions */ +@font-face + {font-family:Tahoma; + panose-1:2 11 6 4 3 5 4 4 2 4; + mso-font-charset:0; + mso-generic-font-family:swiss; + mso-font-pitch:variable; + mso-font-signature:553679495 -2147483648 8 0 66047 0;} + /* Style Definitions */ +p.MsoNormal, li.MsoNormal, div.MsoNormal + {mso-style-parent:""; + margin:0in; + margin-bottom:.0001pt; + mso-pagination:widow-orphan; + font-size:12.0pt; + font-family:"Times New Roman"; + mso-fareast-font-family:"Times New Roman";} +p + {margin-right:0in; + mso-margin-top-alt:auto; + mso-margin-bottom-alt:auto; + margin-left:0in; + mso-pagination:widow-orphan; + font-size:12.0pt; + font-family:"Times New Roman"; + mso-fareast-font-family:"Times New Roman";} +p.BalloonText, li.BalloonText, div.BalloonText + {mso-style-name:"Balloon Text"; + margin:0in; + margin-bottom:.0001pt; + mso-pagination:widow-orphan; + font-size:8.0pt; + font-family:Tahoma; + mso-fareast-font-family:"Times New Roman";} +@page Section1 + {size:8.5in 11.0in; + margin:1.0in 1.25in 1.0in 1.25in; + mso-header-margin:.5in; + mso-footer-margin:.5in; + mso-paper-source:0;} +div.Section1 + {page:Section1;} +--> +</style></head> + +<body style="" lang="EN-US"> + +<div class="Section1"> + +<p style="text-align: center;" align="center"><b>Eclipse Public License - v 1.0</b> +</p> + +<p><span style="font-size: 10pt;">THE ACCOMPANYING PROGRAM IS PROVIDED UNDER +THE TERMS OF THIS ECLIPSE PUBLIC LICENSE ("AGREEMENT"). ANY USE, +REPRODUCTION OR DISTRIBUTION OF THE PROGRAM CONSTITUTES RECIPIENT'S ACCEPTANCE +OF THIS AGREEMENT.</span> </p> + +<p><b><span style="font-size: 10pt;">1. DEFINITIONS</span></b> </p> + +<p><span style="font-size: 10pt;">"Contribution" means:</span> </p> + +<p class="MsoNormal" style="margin-left: 0.5in;"><span style="font-size: 10pt;">a) +in the case of the initial Contributor, the initial code and documentation +distributed under this Agreement, and<br clear="left"> +b) in the case of each subsequent Contributor:</span></p> + +<p class="MsoNormal" style="margin-left: 0.5in;"><span style="font-size: 10pt;">i) +changes to the Program, and</span></p> + +<p class="MsoNormal" style="margin-left: 0.5in;"><span style="font-size: 10pt;">ii) +additions to the Program;</span></p> + +<p class="MsoNormal" style="margin-left: 0.5in;"><span style="font-size: 10pt;">where +such changes and/or additions to the Program originate from and are distributed +by that particular Contributor. A Contribution 'originates' from a Contributor +if it was added to the Program by such Contributor itself or anyone acting on +such Contributor's behalf. Contributions do not include additions to the +Program which: (i) are separate modules of software distributed in conjunction +with the Program under their own license agreement, and (ii) are not derivative +works of the Program. </span></p> + +<p><span style="font-size: 10pt;">"Contributor" means any person or +entity that distributes the Program.</span> </p> + +<p><span style="font-size: 10pt;">"Licensed Patents " mean patent +claims licensable by a Contributor which are necessarily infringed by the use +or sale of its Contribution alone or when combined with the Program. </span></p> + +<p><span style="font-size: 10pt;">"Program" means the Contributions +distributed in accordance with this Agreement.</span> </p> + +<p><span style="font-size: 10pt;">"Recipient" means anyone who +receives the Program under this Agreement, including all Contributors.</span> </p> + +<p><b><span style="font-size: 10pt;">2. GRANT OF RIGHTS</span></b> </p> + +<p class="MsoNormal" style="margin-left: 0.5in;"><span style="font-size: 10pt;">a) +Subject to the terms of this Agreement, each Contributor hereby grants Recipient +a non-exclusive, worldwide, royalty-free copyright license to<span style="color: red;"> </span>reproduce, prepare derivative works of, publicly +display, publicly perform, distribute and sublicense the Contribution of such +Contributor, if any, and such derivative works, in source code and object code +form.</span></p> + +<p class="MsoNormal" style="margin-left: 0.5in;"><span style="font-size: 10pt;">b) +Subject to the terms of this Agreement, each Contributor hereby grants +Recipient a non-exclusive, worldwide,<span style="color: green;"> </span>royalty-free +patent license under Licensed Patents to make, use, sell, offer to sell, import +and otherwise transfer the Contribution of such Contributor, if any, in source +code and object code form. This patent license shall apply to the combination +of the Contribution and the Program if, at the time the Contribution is added +by the Contributor, such addition of the Contribution causes such combination +to be covered by the Licensed Patents. The patent license shall not apply to +any other combinations which include the Contribution. No hardware per se is +licensed hereunder. </span></p> + +<p class="MsoNormal" style="margin-left: 0.5in;"><span style="font-size: 10pt;">c) +Recipient understands that although each Contributor grants the licenses to its +Contributions set forth herein, no assurances are provided by any Contributor +that the Program does not infringe the patent or other intellectual property +rights of any other entity. Each Contributor disclaims any liability to Recipient +for claims brought by any other entity based on infringement of intellectual +property rights or otherwise. As a condition to exercising the rights and +licenses granted hereunder, each Recipient hereby assumes sole responsibility +to secure any other intellectual property rights needed, if any. For example, +if a third party patent license is required to allow Recipient to distribute +the Program, it is Recipient's responsibility to acquire that license before +distributing the Program.</span></p> + +<p class="MsoNormal" style="margin-left: 0.5in;"><span style="font-size: 10pt;">d) +Each Contributor represents that to its knowledge it has sufficient copyright +rights in its Contribution, if any, to grant the copyright license set forth in +this Agreement. </span></p> + +<p><b><span style="font-size: 10pt;">3. REQUIREMENTS</span></b> </p> + +<p><span style="font-size: 10pt;">A Contributor may choose to distribute the +Program in object code form under its own license agreement, provided that:</span> +</p> + +<p class="MsoNormal" style="margin-left: 0.5in;"><span style="font-size: 10pt;">a) +it complies with the terms and conditions of this Agreement; and</span></p> + +<p class="MsoNormal" style="margin-left: 0.5in;"><span style="font-size: 10pt;">b) +its license agreement:</span></p> + +<p class="MsoNormal" style="margin-left: 0.5in;"><span style="font-size: 10pt;">i) +effectively disclaims on behalf of all Contributors all warranties and +conditions, express and implied, including warranties or conditions of title +and non-infringement, and implied warranties or conditions of merchantability +and fitness for a particular purpose; </span></p> + +<p class="MsoNormal" style="margin-left: 0.5in;"><span style="font-size: 10pt;">ii) +effectively excludes on behalf of all Contributors all liability for damages, +including direct, indirect, special, incidental and consequential damages, such +as lost profits; </span></p> + +<p class="MsoNormal" style="margin-left: 0.5in;"><span style="font-size: 10pt;">iii) +states that any provisions which differ from this Agreement are offered by that +Contributor alone and not by any other party; and</span></p> + +<p class="MsoNormal" style="margin-left: 0.5in;"><span style="font-size: 10pt;">iv) +states that source code for the Program is available from such Contributor, and +informs licensees how to obtain it in a reasonable manner on or through a +medium customarily used for software exchange.<span style="color: blue;"> </span></span></p> + +<p><span style="font-size: 10pt;">When the Program is made available in source +code form:</span> </p> + +<p class="MsoNormal" style="margin-left: 0.5in;"><span style="font-size: 10pt;">a) +it must be made available under this Agreement; and </span></p> + +<p class="MsoNormal" style="margin-left: 0.5in;"><span style="font-size: 10pt;">b) a +copy of this Agreement must be included with each copy of the Program. </span></p> + +<p><span style="font-size: 10pt;">Contributors may not remove or alter any +copyright notices contained within the Program. </span></p> + +<p><span style="font-size: 10pt;">Each Contributor must identify itself as the +originator of its Contribution, if any, in a manner that reasonably allows +subsequent Recipients to identify the originator of the Contribution. </span></p> + +<p><b><span style="font-size: 10pt;">4. COMMERCIAL DISTRIBUTION</span></b> </p> + +<p><span style="font-size: 10pt;">Commercial distributors of software may +accept certain responsibilities with respect to end users, business partners +and the like. While this license is intended to facilitate the commercial use +of the Program, the Contributor who includes the Program in a commercial +product offering should do so in a manner which does not create potential +liability for other Contributors. Therefore, if a Contributor includes the +Program in a commercial product offering, such Contributor ("Commercial +Contributor") hereby agrees to defend and indemnify every other +Contributor ("Indemnified Contributor") against any losses, damages and +costs (collectively "Losses") arising from claims, lawsuits and other +legal actions brought by a third party against the Indemnified Contributor to +the extent caused by the acts or omissions of such Commercial Contributor in +connection with its distribution of the Program in a commercial product +offering. The obligations in this section do not apply to any claims or Losses +relating to any actual or alleged intellectual property infringement. In order +to qualify, an Indemnified Contributor must: a) promptly notify the Commercial +Contributor in writing of such claim, and b) allow the Commercial Contributor +to control, and cooperate with the Commercial Contributor in, the defense and +any related settlement negotiations. The Indemnified Contributor may participate +in any such claim at its own expense.</span> </p> + +<p><span style="font-size: 10pt;">For example, a Contributor might include the +Program in a commercial product offering, Product X. That Contributor is then a +Commercial Contributor. If that Commercial Contributor then makes performance +claims, or offers warranties related to Product X, those performance claims and +warranties are such Commercial Contributor's responsibility alone. Under this +section, the Commercial Contributor would have to defend claims against the +other Contributors related to those performance claims and warranties, and if a +court requires any other Contributor to pay any damages as a result, the +Commercial Contributor must pay those damages.</span> </p> + +<p><b><span style="font-size: 10pt;">5. NO WARRANTY</span></b> </p> + +<p><span style="font-size: 10pt;">EXCEPT AS EXPRESSLY SET FORTH IN THIS +AGREEMENT, THE PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT +WARRANTIES OR CONDITIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED INCLUDING, +WITHOUT LIMITATION, ANY WARRANTIES OR CONDITIONS OF TITLE, NON-INFRINGEMENT, +MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. Each Recipient is solely +responsible for determining the appropriateness of using and distributing the +Program and assumes all risks associated with its exercise of rights under this +Agreement , including but not limited to the risks and costs of program errors, +compliance with applicable laws, damage to or loss of data, programs or +equipment, and unavailability or interruption of operations. </span></p> + +<p><b><span style="font-size: 10pt;">6. DISCLAIMER OF LIABILITY</span></b> </p> + +<p><span style="font-size: 10pt;">EXCEPT AS EXPRESSLY SET FORTH IN THIS +AGREEMENT, NEITHER RECIPIENT NOR ANY CONTRIBUTORS SHALL HAVE ANY LIABILITY FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING WITHOUT LIMITATION LOST PROFITS), HOWEVER CAUSED AND ON ANY THEORY +OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING +NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OR DISTRIBUTION OF +THE PROGRAM OR THE EXERCISE OF ANY RIGHTS GRANTED HEREUNDER, EVEN IF ADVISED OF +THE POSSIBILITY OF SUCH DAMAGES.</span> </p> + +<p><b><span style="font-size: 10pt;">7. GENERAL</span></b> </p> + +<p><span style="font-size: 10pt;">If any provision of this Agreement is invalid +or unenforceable under applicable law, it shall not affect the validity or +enforceability of the remainder of the terms of this Agreement, and without +further action by the parties hereto, such provision shall be reformed to the +minimum extent necessary to make such provision valid and enforceable.</span> </p> + +<p><span style="font-size: 10pt;">If Recipient institutes patent litigation +against any entity (including a cross-claim or counterclaim in a lawsuit) +alleging that the Program itself (excluding combinations of the Program with +other software or hardware) infringes such Recipient's patent(s), then such +Recipient's rights granted under Section 2(b) shall terminate as of the date +such litigation is filed. </span></p> + +<p><span style="font-size: 10pt;">All Recipient's rights under this Agreement +shall terminate if it fails to comply with any of the material terms or +conditions of this Agreement and does not cure such failure in a reasonable +period of time after becoming aware of such noncompliance. If all Recipient's +rights under this Agreement terminate, Recipient agrees to cease use and +distribution of the Program as soon as reasonably practicable. However, +Recipient's obligations under this Agreement and any licenses granted by +Recipient relating to the Program shall continue and survive. </span></p> + +<p><span style="font-size: 10pt;">Everyone is permitted to copy and distribute +copies of this Agreement, but in order to avoid inconsistency the Agreement is +copyrighted and may only be modified in the following manner. The Agreement +Steward reserves the right to publish new versions (including revisions) of +this Agreement from time to time. No one other than the Agreement Steward has +the right to modify this Agreement. The Eclipse Foundation is the initial +Agreement Steward. The Eclipse Foundation may assign the responsibility to +serve as the Agreement Steward to a suitable separate entity. Each new version +of the Agreement will be given a distinguishing version number. The Program +(including Contributions) may always be distributed subject to the version of +the Agreement under which it was received. In addition, after a new version of +the Agreement is published, Contributor may elect to distribute the Program +(including its Contributions) under the new version. Except as expressly stated +in Sections 2(a) and 2(b) above, Recipient receives no rights or licenses to +the intellectual property of any Contributor under this Agreement, whether +expressly, by implication, estoppel or otherwise. All rights in the Program not +expressly granted under this Agreement are reserved.</span> </p> + +<p><span style="font-size: 10pt;">This Agreement is governed by the laws of the +State of New York and the intellectual property laws of the United States of +America. No party to this Agreement will bring a legal action under this +Agreement more than one year after the cause of action arose. Each party waives +its rights to a jury trial in any resulting litigation.</span> </p> + +<p class="MsoNormal"><!--[if !supportEmptyParas]--> <!--[endif]--><o:p></o:p></p> + +</div> + +</body></html>
\ No newline at end of file diff --git a/plugins/org.eclipse.emf.cdo.tests.hibernate/license.html b/plugins/org.eclipse.emf.cdo.tests.hibernate/license.html new file mode 100644 index 0000000000..d7b88e9416 --- /dev/null +++ b/plugins/org.eclipse.emf.cdo.tests.hibernate/license.html @@ -0,0 +1,319 @@ +<html xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns="http://www.w3.org/TR/REC-html40"><head> +<meta http-equiv="Content-Type" content="text/html; charset=windows-1252"> +<meta name="ProgId" content="Word.Document"> +<meta name="Generator" content="Microsoft Word 9"> +<meta name="Originator" content="Microsoft Word 9"> +<link rel="File-List" href="http://www.eclipse.org/org/documents/Eclipse%20EPL%202003_11_10%20Final_files/filelist.xml"><title>Eclipse Public License - Version 1.0</title><!--[if gte mso 9]><xml> + <o:DocumentProperties> + <o:Revision>2</o:Revision> + <o:TotalTime>3</o:TotalTime> + <o:Created>2004-03-05T23:03:00Z</o:Created> + <o:LastSaved>2004-03-05T23:03:00Z</o:LastSaved> + <o:Pages>4</o:Pages> + <o:Words>1626</o:Words> + <o:Characters>9270</o:Characters> + <o:Lines>77</o:Lines> + <o:Paragraphs>18</o:Paragraphs> + <o:CharactersWithSpaces>11384</o:CharactersWithSpaces> + <o:Version>9.4402</o:Version> + </o:DocumentProperties> +</xml><![endif]--><!--[if gte mso 9]><xml> + <w:WordDocument> + <w:TrackRevisions/> + </w:WordDocument> +</xml><![endif]--> + + +<style> +<!-- + /* Font Definitions */ +@font-face + {font-family:Tahoma; + panose-1:2 11 6 4 3 5 4 4 2 4; + mso-font-charset:0; + mso-generic-font-family:swiss; + mso-font-pitch:variable; + mso-font-signature:553679495 -2147483648 8 0 66047 0;} + /* Style Definitions */ +p.MsoNormal, li.MsoNormal, div.MsoNormal + {mso-style-parent:""; + margin:0in; + margin-bottom:.0001pt; + mso-pagination:widow-orphan; + font-size:12.0pt; + font-family:"Times New Roman"; + mso-fareast-font-family:"Times New Roman";} +p + {margin-right:0in; + mso-margin-top-alt:auto; + mso-margin-bottom-alt:auto; + margin-left:0in; + mso-pagination:widow-orphan; + font-size:12.0pt; + font-family:"Times New Roman"; + mso-fareast-font-family:"Times New Roman";} +p.BalloonText, li.BalloonText, div.BalloonText + {mso-style-name:"Balloon Text"; + margin:0in; + margin-bottom:.0001pt; + mso-pagination:widow-orphan; + font-size:8.0pt; + font-family:Tahoma; + mso-fareast-font-family:"Times New Roman";} +@page Section1 + {size:8.5in 11.0in; + margin:1.0in 1.25in 1.0in 1.25in; + mso-header-margin:.5in; + mso-footer-margin:.5in; + mso-paper-source:0;} +div.Section1 + {page:Section1;} +--> +</style></head> + +<body style="" lang="EN-US"> + +<div class="Section1"> + +<p style="text-align: center;" align="center"><b>Eclipse Public License - v 1.0</b> +</p> + +<p><span style="font-size: 10pt;">THE ACCOMPANYING PROGRAM IS PROVIDED UNDER +THE TERMS OF THIS ECLIPSE PUBLIC LICENSE ("AGREEMENT"). ANY USE, +REPRODUCTION OR DISTRIBUTION OF THE PROGRAM CONSTITUTES RECIPIENT'S ACCEPTANCE +OF THIS AGREEMENT.</span> </p> + +<p><b><span style="font-size: 10pt;">1. DEFINITIONS</span></b> </p> + +<p><span style="font-size: 10pt;">"Contribution" means:</span> </p> + +<p class="MsoNormal" style="margin-left: 0.5in;"><span style="font-size: 10pt;">a) +in the case of the initial Contributor, the initial code and documentation +distributed under this Agreement, and<br clear="left"> +b) in the case of each subsequent Contributor:</span></p> + +<p class="MsoNormal" style="margin-left: 0.5in;"><span style="font-size: 10pt;">i) +changes to the Program, and</span></p> + +<p class="MsoNormal" style="margin-left: 0.5in;"><span style="font-size: 10pt;">ii) +additions to the Program;</span></p> + +<p class="MsoNormal" style="margin-left: 0.5in;"><span style="font-size: 10pt;">where +such changes and/or additions to the Program originate from and are distributed +by that particular Contributor. A Contribution 'originates' from a Contributor +if it was added to the Program by such Contributor itself or anyone acting on +such Contributor's behalf. Contributions do not include additions to the +Program which: (i) are separate modules of software distributed in conjunction +with the Program under their own license agreement, and (ii) are not derivative +works of the Program. </span></p> + +<p><span style="font-size: 10pt;">"Contributor" means any person or +entity that distributes the Program.</span> </p> + +<p><span style="font-size: 10pt;">"Licensed Patents " mean patent +claims licensable by a Contributor which are necessarily infringed by the use +or sale of its Contribution alone or when combined with the Program. </span></p> + +<p><span style="font-size: 10pt;">"Program" means the Contributions +distributed in accordance with this Agreement.</span> </p> + +<p><span style="font-size: 10pt;">"Recipient" means anyone who +receives the Program under this Agreement, including all Contributors.</span> </p> + +<p><b><span style="font-size: 10pt;">2. GRANT OF RIGHTS</span></b> </p> + +<p class="MsoNormal" style="margin-left: 0.5in;"><span style="font-size: 10pt;">a) +Subject to the terms of this Agreement, each Contributor hereby grants Recipient +a non-exclusive, worldwide, royalty-free copyright license to<span style="color: red;"> </span>reproduce, prepare derivative works of, publicly +display, publicly perform, distribute and sublicense the Contribution of such +Contributor, if any, and such derivative works, in source code and object code +form.</span></p> + +<p class="MsoNormal" style="margin-left: 0.5in;"><span style="font-size: 10pt;">b) +Subject to the terms of this Agreement, each Contributor hereby grants +Recipient a non-exclusive, worldwide,<span style="color: green;"> </span>royalty-free +patent license under Licensed Patents to make, use, sell, offer to sell, import +and otherwise transfer the Contribution of such Contributor, if any, in source +code and object code form. This patent license shall apply to the combination +of the Contribution and the Program if, at the time the Contribution is added +by the Contributor, such addition of the Contribution causes such combination +to be covered by the Licensed Patents. The patent license shall not apply to +any other combinations which include the Contribution. No hardware per se is +licensed hereunder. </span></p> + +<p class="MsoNormal" style="margin-left: 0.5in;"><span style="font-size: 10pt;">c) +Recipient understands that although each Contributor grants the licenses to its +Contributions set forth herein, no assurances are provided by any Contributor +that the Program does not infringe the patent or other intellectual property +rights of any other entity. Each Contributor disclaims any liability to Recipient +for claims brought by any other entity based on infringement of intellectual +property rights or otherwise. As a condition to exercising the rights and +licenses granted hereunder, each Recipient hereby assumes sole responsibility +to secure any other intellectual property rights needed, if any. For example, +if a third party patent license is required to allow Recipient to distribute +the Program, it is Recipient's responsibility to acquire that license before +distributing the Program.</span></p> + +<p class="MsoNormal" style="margin-left: 0.5in;"><span style="font-size: 10pt;">d) +Each Contributor represents that to its knowledge it has sufficient copyright +rights in its Contribution, if any, to grant the copyright license set forth in +this Agreement. </span></p> + +<p><b><span style="font-size: 10pt;">3. REQUIREMENTS</span></b> </p> + +<p><span style="font-size: 10pt;">A Contributor may choose to distribute the +Program in object code form under its own license agreement, provided that:</span> +</p> + +<p class="MsoNormal" style="margin-left: 0.5in;"><span style="font-size: 10pt;">a) +it complies with the terms and conditions of this Agreement; and</span></p> + +<p class="MsoNormal" style="margin-left: 0.5in;"><span style="font-size: 10pt;">b) +its license agreement:</span></p> + +<p class="MsoNormal" style="margin-left: 0.5in;"><span style="font-size: 10pt;">i) +effectively disclaims on behalf of all Contributors all warranties and +conditions, express and implied, including warranties or conditions of title +and non-infringement, and implied warranties or conditions of merchantability +and fitness for a particular purpose; </span></p> + +<p class="MsoNormal" style="margin-left: 0.5in;"><span style="font-size: 10pt;">ii) +effectively excludes on behalf of all Contributors all liability for damages, +including direct, indirect, special, incidental and consequential damages, such +as lost profits; </span></p> + +<p class="MsoNormal" style="margin-left: 0.5in;"><span style="font-size: 10pt;">iii) +states that any provisions which differ from this Agreement are offered by that +Contributor alone and not by any other party; and</span></p> + +<p class="MsoNormal" style="margin-left: 0.5in;"><span style="font-size: 10pt;">iv) +states that source code for the Program is available from such Contributor, and +informs licensees how to obtain it in a reasonable manner on or through a +medium customarily used for software exchange.<span style="color: blue;"> </span></span></p> + +<p><span style="font-size: 10pt;">When the Program is made available in source +code form:</span> </p> + +<p class="MsoNormal" style="margin-left: 0.5in;"><span style="font-size: 10pt;">a) +it must be made available under this Agreement; and </span></p> + +<p class="MsoNormal" style="margin-left: 0.5in;"><span style="font-size: 10pt;">b) a +copy of this Agreement must be included with each copy of the Program. </span></p> + +<p><span style="font-size: 10pt;">Contributors may not remove or alter any +copyright notices contained within the Program. </span></p> + +<p><span style="font-size: 10pt;">Each Contributor must identify itself as the +originator of its Contribution, if any, in a manner that reasonably allows +subsequent Recipients to identify the originator of the Contribution. </span></p> + +<p><b><span style="font-size: 10pt;">4. COMMERCIAL DISTRIBUTION</span></b> </p> + +<p><span style="font-size: 10pt;">Commercial distributors of software may +accept certain responsibilities with respect to end users, business partners +and the like. While this license is intended to facilitate the commercial use +of the Program, the Contributor who includes the Program in a commercial +product offering should do so in a manner which does not create potential +liability for other Contributors. Therefore, if a Contributor includes the +Program in a commercial product offering, such Contributor ("Commercial +Contributor") hereby agrees to defend and indemnify every other +Contributor ("Indemnified Contributor") against any losses, damages and +costs (collectively "Losses") arising from claims, lawsuits and other +legal actions brought by a third party against the Indemnified Contributor to +the extent caused by the acts or omissions of such Commercial Contributor in +connection with its distribution of the Program in a commercial product +offering. The obligations in this section do not apply to any claims or Losses +relating to any actual or alleged intellectual property infringement. In order +to qualify, an Indemnified Contributor must: a) promptly notify the Commercial +Contributor in writing of such claim, and b) allow the Commercial Contributor +to control, and cooperate with the Commercial Contributor in, the defense and +any related settlement negotiations. The Indemnified Contributor may participate +in any such claim at its own expense.</span> </p> + +<p><span style="font-size: 10pt;">For example, a Contributor might include the +Program in a commercial product offering, Product X. That Contributor is then a +Commercial Contributor. If that Commercial Contributor then makes performance +claims, or offers warranties related to Product X, those performance claims and +warranties are such Commercial Contributor's responsibility alone. Under this +section, the Commercial Contributor would have to defend claims against the +other Contributors related to those performance claims and warranties, and if a +court requires any other Contributor to pay any damages as a result, the +Commercial Contributor must pay those damages.</span> </p> + +<p><b><span style="font-size: 10pt;">5. NO WARRANTY</span></b> </p> + +<p><span style="font-size: 10pt;">EXCEPT AS EXPRESSLY SET FORTH IN THIS +AGREEMENT, THE PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT +WARRANTIES OR CONDITIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED INCLUDING, +WITHOUT LIMITATION, ANY WARRANTIES OR CONDITIONS OF TITLE, NON-INFRINGEMENT, +MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. Each Recipient is solely +responsible for determining the appropriateness of using and distributing the +Program and assumes all risks associated with its exercise of rights under this +Agreement , including but not limited to the risks and costs of program errors, +compliance with applicable laws, damage to or loss of data, programs or +equipment, and unavailability or interruption of operations. </span></p> + +<p><b><span style="font-size: 10pt;">6. DISCLAIMER OF LIABILITY</span></b> </p> + +<p><span style="font-size: 10pt;">EXCEPT AS EXPRESSLY SET FORTH IN THIS +AGREEMENT, NEITHER RECIPIENT NOR ANY CONTRIBUTORS SHALL HAVE ANY LIABILITY FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING WITHOUT LIMITATION LOST PROFITS), HOWEVER CAUSED AND ON ANY THEORY +OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING +NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OR DISTRIBUTION OF +THE PROGRAM OR THE EXERCISE OF ANY RIGHTS GRANTED HEREUNDER, EVEN IF ADVISED OF +THE POSSIBILITY OF SUCH DAMAGES.</span> </p> + +<p><b><span style="font-size: 10pt;">7. GENERAL</span></b> </p> + +<p><span style="font-size: 10pt;">If any provision of this Agreement is invalid +or unenforceable under applicable law, it shall not affect the validity or +enforceability of the remainder of the terms of this Agreement, and without +further action by the parties hereto, such provision shall be reformed to the +minimum extent necessary to make such provision valid and enforceable.</span> </p> + +<p><span style="font-size: 10pt;">If Recipient institutes patent litigation +against any entity (including a cross-claim or counterclaim in a lawsuit) +alleging that the Program itself (excluding combinations of the Program with +other software or hardware) infringes such Recipient's patent(s), then such +Recipient's rights granted under Section 2(b) shall terminate as of the date +such litigation is filed. </span></p> + +<p><span style="font-size: 10pt;">All Recipient's rights under this Agreement +shall terminate if it fails to comply with any of the material terms or +conditions of this Agreement and does not cure such failure in a reasonable +period of time after becoming aware of such noncompliance. If all Recipient's +rights under this Agreement terminate, Recipient agrees to cease use and +distribution of the Program as soon as reasonably practicable. However, +Recipient's obligations under this Agreement and any licenses granted by +Recipient relating to the Program shall continue and survive. </span></p> + +<p><span style="font-size: 10pt;">Everyone is permitted to copy and distribute +copies of this Agreement, but in order to avoid inconsistency the Agreement is +copyrighted and may only be modified in the following manner. The Agreement +Steward reserves the right to publish new versions (including revisions) of +this Agreement from time to time. No one other than the Agreement Steward has +the right to modify this Agreement. The Eclipse Foundation is the initial +Agreement Steward. The Eclipse Foundation may assign the responsibility to +serve as the Agreement Steward to a suitable separate entity. Each new version +of the Agreement will be given a distinguishing version number. The Program +(including Contributions) may always be distributed subject to the version of +the Agreement under which it was received. In addition, after a new version of +the Agreement is published, Contributor may elect to distribute the Program +(including its Contributions) under the new version. Except as expressly stated +in Sections 2(a) and 2(b) above, Recipient receives no rights or licenses to +the intellectual property of any Contributor under this Agreement, whether +expressly, by implication, estoppel or otherwise. All rights in the Program not +expressly granted under this Agreement are reserved.</span> </p> + +<p><span style="font-size: 10pt;">This Agreement is governed by the laws of the +State of New York and the intellectual property laws of the United States of +America. No party to this Agreement will bring a legal action under this +Agreement more than one year after the cause of action arose. Each party waives +its rights to a jury trial in any resulting litigation.</span> </p> + +<p class="MsoNormal"><!--[if !supportEmptyParas]--> <!--[endif]--><o:p></o:p></p> + +</div> + +</body></html>
\ No newline at end of file diff --git a/plugins/org.eclipse.emf.cdo.tests.hibernate/modeling32.png b/plugins/org.eclipse.emf.cdo.tests.hibernate/modeling32.png Binary files differnew file mode 100644 index 0000000000..6b08de2ada --- /dev/null +++ b/plugins/org.eclipse.emf.cdo.tests.hibernate/modeling32.png diff --git a/plugins/org.eclipse.emf.cdo.tests.hibernate/plugin.properties b/plugins/org.eclipse.emf.cdo.tests.hibernate/plugin.properties new file mode 100644 index 0000000000..d4280961f2 --- /dev/null +++ b/plugins/org.eclipse.emf.cdo.tests.hibernate/plugin.properties @@ -0,0 +1,25 @@ +# Copyright (c) 2004 - 2008 Eike Stepper, Germany. +# 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 + +# NLS_MESSAGEFORMAT_VAR + +# ============================================================================== +# Do not change the properties between this line and the last line containing: +# %%% END OF TRANSLATED PROPERTIES %%% +# Instead, either redefine an existing property, or create a new property, +# append it to the end of the file, and change the code to use the new name. +# ============================================================================== + +pluginName = CDO Tests Hibernate (Incubation) +providerName = Eclipse.org + +# ============================================================================== +# %%% END OF TRANSLATED PROPERTIES %%% +# The above properties have been shipped for translation. +# ============================================================================== diff --git a/plugins/org.eclipse.emf.cdo.tests.hibernate/src/org/eclipse/emf/cdo/tests/hibernate/Activator.java b/plugins/org.eclipse.emf.cdo.tests.hibernate/src/org/eclipse/emf/cdo/tests/hibernate/Activator.java new file mode 100644 index 0000000000..d8c7c569aa --- /dev/null +++ b/plugins/org.eclipse.emf.cdo.tests.hibernate/src/org/eclipse/emf/cdo/tests/hibernate/Activator.java @@ -0,0 +1,48 @@ +/*************************************************************************** + * Copyright (c) 2004 - 2008 Eike Stepper, Germany. + * 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.core.runtime.Plugin; + +import org.osgi.framework.BundleContext; + +/** + * @author Eike Stepper + */ +public class Activator extends Plugin +{ + public static final String PLUGIN_ID = "org.eclipse.emf.cdo.tests.hibernate"; + + private static Activator plugin; + + public Activator() + { + } + + @Override + public void start(BundleContext context) throws Exception + { + super.start(context); + plugin = this; + } + + @Override + public void stop(BundleContext context) throws Exception + { + plugin = null; + super.stop(context); + } + + public static Activator getDefault() + { + return plugin; + } +} diff --git a/plugins/org.eclipse.emf.cdo.tests.hibernate/src/org/eclipse/emf/cdo/tests/hibernate/AllTests.java b/plugins/org.eclipse.emf.cdo.tests.hibernate/src/org/eclipse/emf/cdo/tests/hibernate/AllTests.java new file mode 100644 index 0000000000..3369358a13 --- /dev/null +++ b/plugins/org.eclipse.emf.cdo.tests.hibernate/src/org/eclipse/emf/cdo/tests/hibernate/AllTests.java @@ -0,0 +1,31 @@ +/*************************************************************************** + * Copyright (c) 2004 - 2008 Eike Stepper, Germany. + * 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 junit.framework.Test; +import junit.framework.TestSuite; + +/** + * @author Eike Stepper + */ +public class AllTests +{ + public static Test suite() + { + TestSuite suite = new TestSuite("Tests for CDO Hibernate"); + + // $JUnit-BEGIN$ + suite.addTestSuite(HibernateTest.class); + // $JUnit-END$ + + return suite; + } +} diff --git a/plugins/org.eclipse.emf.cdo.tests.hibernate/src/org/eclipse/emf/cdo/tests/hibernate/HibernateTest.java b/plugins/org.eclipse.emf.cdo.tests.hibernate/src/org/eclipse/emf/cdo/tests/hibernate/HibernateTest.java new file mode 100644 index 0000000000..f833893e99 --- /dev/null +++ b/plugins/org.eclipse.emf.cdo.tests.hibernate/src/org/eclipse/emf/cdo/tests/hibernate/HibernateTest.java @@ -0,0 +1,139 @@ +/*************************************************************************** + * Copyright (c) 2004 - 2008 Eike Stepper, Germany. + * 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 java.io.PrintWriter; +import java.sql.Driver; +import java.sql.DriverManager; +import java.util.HashMap; +import java.util.Map; +import java.util.Properties; + +import org.eclipse.emf.cdo.CDOSession; +import org.eclipse.emf.cdo.CDOTransaction; +import org.eclipse.emf.cdo.server.CDOServerUtil; +import org.eclipse.emf.cdo.server.IRepository; +import org.eclipse.emf.cdo.server.IStore; +import org.eclipse.emf.cdo.server.IRepository.Props; +import org.eclipse.emf.cdo.server.internal.hibernate.HibernateStore; +import org.eclipse.emf.cdo.tests.model1.Category; +import org.eclipse.emf.cdo.tests.model1.Model1Factory; +import org.eclipse.emf.cdo.tests.model1.Model1Package; +import org.eclipse.emf.cdo.tests.model1.Product; +import org.eclipse.emf.cdo.util.CDOUtil; +import org.eclipse.emf.ecore.EObject; +import org.eclipse.emf.ecore.resource.Resource; +import org.eclipse.net4j.Net4jUtil; +import org.eclipse.net4j.connector.IConnector; +import org.eclipse.net4j.internal.util.om.log.PrintLogHandler; +import org.eclipse.net4j.internal.util.om.trace.PrintTraceHandler; +import org.eclipse.net4j.jvm.JVMUtil; +import org.eclipse.net4j.util.container.ContainerUtil; +import org.eclipse.net4j.util.container.IManagedContainer; +import org.eclipse.net4j.util.om.OMPlatform; +import org.hibernate.cfg.Environment; +import org.hibernate.dialect.MySQLInnoDBDialect; + +/** + * @author Eike Stepper + */ +public class HibernateTest { + private static final String REPOSITORY_NAME = "repo1"; + + public static void main(String[] args) throws Exception { + IManagedContainer container = initContainer(); + + // Start the transport and create a repository + JVMUtil.getAcceptor(container, "default"); // Start the JVM transport + CDOServerUtil.addRepository(container, createRepository()); // Start a CDO respository + + // Establish a communications connection and open a session with the repository + IConnector connector = JVMUtil.getConnector(container, "default"); // Open a JVM connection + CDOSession session = CDOUtil.openSession(connector, REPOSITORY_NAME, true);// Open a CDO + // session + session.getPackageRegistry().putEPackage(Model1Package.eINSTANCE);// Not needed after + // first + // commit!!! + + // Open a transaction, and create a new resource + CDOTransaction transaction = session.openTransaction(); + Resource resource = transaction.createResource("/my/big/resource"); + resource.getContents().add(getInputModel()); + transaction.commit(); + + // Cleanup + session.close(); + connector.disconnect(); + } + + private static IManagedContainer initContainer() { + // Turn on tracing + OMPlatform.INSTANCE.setDebugging(true); + OMPlatform.INSTANCE.addTraceHandler(PrintTraceHandler.CONSOLE); + OMPlatform.INSTANCE.addLogHandler(PrintLogHandler.CONSOLE); + + // Prepare the standalone infra structure (not needed when running inside Eclipse) + IManagedContainer container = ContainerUtil.createContainer(); // Create a wiring container + Net4jUtil.prepareContainer(container); // Prepare the Net4j kernel + JVMUtil.prepareContainer(container); // Prepare the JVM transport + CDOServerUtil.prepareContainer(container); // Prepare the CDO server + CDOUtil.prepareContainer(container, false); // Prepare the CDO client + return container; + } + + private static IRepository createRepository() throws Exception { + Map<String, String> props = new HashMap<String, String>(); + props.put(Props.PROP_SUPPORTING_AUDITS, "false"); + props.put(Props.PROP_SUPPORTING_REVISION_DELTAS, "false"); + props.put(Props.PROP_VERIFYING_REVISIONS, "false"); + props.put(Props.PROP_CURRENT_LRU_CAPACITY, "10000"); + props.put(Props.PROP_REVISED_LRU_CAPACITY, "10000"); + return CDOServerUtil.createRepository(REPOSITORY_NAME, createStore(), props); + } + + private static IStore createStore() throws Exception { + DriverManager.setLogWriter(new PrintWriter(System.out)); + Driver driver = new com.mysql.jdbc.Driver(); + DriverManager.registerDriver(driver); + String driverName = driver.getClass().getName(); + String dialectName = MySQLInnoDBDialect.class.getName(); + + Properties props = new Properties(); + props.setProperty(Environment.DRIVER, driverName); + props.setProperty(Environment.URL, "jdbc:mysql://localhost/cdohibernate"); + props.setProperty(Environment.USER, "root"); + props.setProperty(Environment.PASS, "root"); + props.setProperty(Environment.DIALECT, dialectName); + props.setProperty(Environment.SHOW_SQL, "true"); + props.setProperty("hibernate.hbm2ddl.auto", "create-drop"); +// IHibernateMappingProvider mappingProvider = new TeneoHibernateMappingProvider(); +// return new HibernateStore(props, mappingProvider); + return new HibernateStore(props, null); + } + + private static EObject getInputModel() { + Category cat1 = Model1Factory.eINSTANCE.createCategory(); + cat1.setName("CAT1"); + Category cat2 = Model1Factory.eINSTANCE.createCategory(); + cat2.setName("CAT2"); + cat1.getCategories().add(cat2); + Product p1 = Model1Factory.eINSTANCE.createProduct(); + p1.setName("P1"); + cat1.getProducts().add(p1); + Product p2 = Model1Factory.eINSTANCE.createProduct(); + p2.setName("P2"); + cat1.getProducts().add(p2); + Product p3 = Model1Factory.eINSTANCE.createProduct(); + p3.setName("P3"); + cat2.getProducts().add(p3); + return cat1; + } +} diff --git a/plugins/org.eclipse.emf.cdo.tests.hibernate/test.xml b/plugins/org.eclipse.emf.cdo.tests.hibernate/test.xml new file mode 100644 index 0000000000..43b07a3b25 --- /dev/null +++ b/plugins/org.eclipse.emf.cdo.tests.hibernate/test.xml @@ -0,0 +1,47 @@ +<?xml version="1.0"?> + +<project name="testsuite" default="run" basedir="."> + <!-- The property ${eclipse-home} should be passed into this script --> + <!-- Set a meaningful default value for when it is not. --> + <property name="eclipse-home" value="${basedir}\..\.."/> + + <!-- sets the properties plugin-name, and library-file --> + <property name="plugin-name" value="org.eclipse.emf.cdo.tests"/> + <property name="library-file" value="${eclipse-home}/plugins/org.eclipse.test/library.xml"/> + + <!-- This target holds all initialization code that needs to be done for --> + <!-- all tests that are to be run. Initialization for individual tests --> + <!-- should be done within the body of the suite target. --> + <target name="init"> + <tstamp/> + <delete> + <fileset dir="${eclipse-home}" includes="org*.xml"/> + </delete> + </target> + + <!-- This target defines the tests that need to be run. --> + <target name="suite"> + <property name="emf-folder" value="${eclipse-home}/emf_folder"/> + <delete dir="${emf-folder}" quiet="true"/> + <ant target="core-test" antfile="${library-file}" dir="${eclipse-home}"> + <property name="data-dir" value="${emf-folder}"/> + <property name="plugin-name" value="${plugin-name}"/> + <property name="classname" value="org.eclipse.emf.cdo.tests.AllTests"/> + </ant> + </target> + + <!-- This target holds code to cleanup the testing environment after --> + <!-- after all of the tests have been run. You can use this target to --> + <!-- delete temporary files that have been created. --> + <target name="cleanup"> + </target> + + <!-- This target runs the test suite. Any actions that need to happen --> + <!-- after all the tests have been run should go here. --> + <target name="run" depends="init,suite,cleanup"> + <ant target="collect" antfile="${library-file}" dir="${eclipse-home}"> + <property name="includes" value="org*.xml"/> + <property name="output-file" value="${plugin-name}.xml"/> + </ant> + </target> +</project>
\ No newline at end of file |