Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 345841

Summary: [Hibernate] CDO Tests: small change to let hibernate test case work
Product: [Modeling] EMF Reporter: Martin Taal <mtaal>
Component: cdo.coreAssignee: Martin Taal <mtaal>
Status: CLOSED FIXED QA Contact: Eike Stepper <stepper>
Severity: normal    
Priority: P3 Flags: stepper: review+
Version: 4.0   
Target Milestone: ---   
Hardware: PC   
OS: Linux   
Whiteboard:
Attachments:
Description Flags
Patch
none
Patch none

Description Martin Taal CLA 2011-05-15 08:21:56 EDT
Created attachment 195663 [details]
Patch

Some testscases use the Product1 eclass. The Hibernate Store assumes that the name of the Product1 is always set before it is persisted. The attached patch solves this some specific new testcases.
Comment 1 Martin Taal CLA 2011-05-15 08:57:03 EDT
Created attachment 195664 [details]
Patch
Comment 2 Eike Stepper CLA 2011-05-16 02:37:37 EDT
(In reply to comment #0)
> Some testscases use the Product1 eclass. The Hibernate Store assumes that the
> name of the Product1 is always set before it is persisted. 

That seems a little surprising, as Product1.name is not a required attribute in the ecore model. Can you please explain why the Hibernate Store makes this assumption? Does this assumption apply to all attributes, all EString attributes; what is the scope of this assumption?
Comment 3 Martin Taal CLA 2011-05-16 02:47:57 EDT
Hi Eike,
In this case the product name is used by Hibernate as the primary key. This is controlled by the teneo.jpa annotation on the product.name. It is to test non-generated primary keys.

So for the hibernate store this is a required efeature, but not for the other stores.
Would it make sense to make it required?

gr. Martin
Comment 4 Eike Stepper CLA 2011-05-16 03:28:37 EDT
(In reply to comment #3)
> In this case the product name is used by Hibernate as the primary key. This is
> controlled by the teneo.jpa annotation on the product.name. It is to test
> non-generated primary keys.

Ah, I see ;-)

> So for the hibernate store this is a required efeature, but not for the other
> stores.
> Would it make sense to make it required?

Hmm, I fear that this model is used by too many tests to make such a fundamental change. If you want to test that, can't you add a new EClass in one of the other models?

In the meantime you may commit this patch.
Comment 5 Martin Taal CLA 2011-05-16 03:32:44 EDT
Committed in revision 7731
Comment 6 Eike Stepper CLA 2011-06-23 03:37:34 EDT
Available in R20110608-1407