[Teneo] How to set identity generator strategy for "TABLE_PER_CLASS" inheritance m [message #751941] |
Wed, 26 October 2011 04:01  |
Eclipse User |
|
|
|
Hello,
I'd like to use "TABLE_PER_CLASS" as inheritance mapping strategy.
Howerver, when I try to initialize the data base for my EPackage I get
the follwoing error:
"Exception in thread "main" org.hibernate.MappingException: Cannot use
identity column key generation with <union-subclass> mapping for: Thing"
My model contains an abstract class an one concrete sub-class. The
Hibernate documentation is telling me that "the identity generator
strategy is not allowed in unionsubclass inheritance". Ok... but I
didn't figure out how to set another generator strategy???
I suspect that I have to use the annotation GeneratedValue and
MappedSuperclass on my ecore model... somehow... (I would like to avoid
annotations)
So, how to set another identity generator strategy that is valid for
"TABLE_PER_CLASS"?
Many thanks and best regards,
Bernd
|
|
|
Re: [Teneo] How to set identity generator strategy for "TABLE_PER_CLASS" inheritan [message #752350 is a reply to message #751941] |
Wed, 26 October 2011 07:09   |
Eclipse User |
|
|
|
Hi,
You can prevent the generated value to be set on the id, but I am not sure that you want to do that:
see the set_generated_value_on_id_feature option here
http://wiki.eclipse.org/Teneo/Hibernate/Configuration_Options
the only other solution is to annotate the model. You can also annotate using xml so that you don't change the ecore/xsd
model itself.
gr. Martin
On 10/26/2011 10:01 AM, Bernd Vogt wrote:
> Hello,
>
> I'd like to use "TABLE_PER_CLASS" as inheritance mapping strategy.
>
> Howerver, when I try to initialize the data base for my EPackage I get the follwoing error:
>
> "Exception in thread "main" org.hibernate.MappingException: Cannot use identity column key generation with
> <union-subclass> mapping for: Thing"
>
> My model contains an abstract class an one concrete sub-class. The Hibernate documentation is telling me that "the
> identity generator strategy is not allowed in unionsubclass inheritance". Ok... but I didn't figure out how to set
> another generator strategy???
>
> I suspect that I have to use the annotation GeneratedValue and MappedSuperclass on my ecore model... somehow... (I would
> like to avoid annotations)
>
> So, how to set another identity generator strategy that is valid for "TABLE_PER_CLASS"?
>
> Many thanks and best regards,
> Bernd
--
With Regards, Martin Taal
Springsite/Elver.org
Office: Hardwareweg 4, 3821 BV Amersfoort
Postal: Nassaulaan 7, 3941 EC Doorn
The Netherlands
Cell: +31 (0)6 288 48 943
Tel: +31 (0)84 420 2397
Fax: +31 (0)84 225 9307
Mail: mtaal@springsite.com - mtaal@elver.org
Web: www.springsite.com - www.elver.org
|
|
|
|
Re: [Teneo] How to set identity generator strategy for "TABLE_PER_CLASS" inheritan [message #753101 is a reply to message #752686] |
Wed, 26 October 2011 12:27  |
Eclipse User |
|
|
|
Hi Bernd,
I guess that you have ereferences pointing to the type you are assigning as a mappedsuperclass, this is not supported
with hbm.
Strange that the option does not work... it is there and the code to handle it is also there. But again in this
Can you send me the model? My private email is mtaal@elver.org.
gr. Martin
On 10/26/2011 03:32 PM, Bernd Vogt wrote:
> Hi
>
>> see the set_generated_value_on_id_feature option here
>
> I set this option to "false" wit no effect.
>
>> the only other solution is to annotate the model
>
> I played around wit annotations and added @MappedSuperclass to my abstract super types. But the I got another error
> telling me that he is not ablte to establish references to that "unmapped" super types:
>
> "org.hibernate.MappingException: An association from the table annotation refers to an unmapped class: Annotatable"
>
> Is it even possible to use the inheritance mapping "TABLE_PER_CLASS" along with Teneo?
>
> You maybe mentioned that I'm not realy into Hibernate and Teneo ;-) Please, tell me what I have to consider with
> "TABLE_PER_CLASS" or point me to ab example...
>
> Thanks,
> Bernd
--
With Regards, Martin Taal
Springsite/Elver.org
Office: Hardwareweg 4, 3821 BV Amersfoort
Postal: Nassaulaan 7, 3941 EC Doorn
The Netherlands
Cell: +31 (0)6 288 48 943
Tel: +31 (0)84 420 2397
Fax: +31 (0)84 225 9307
Mail: mtaal@springsite.com - mtaal@elver.org
Web: www.springsite.com - www.elver.org
|
|
|
Powered by
FUDForum. Page generated in 0.04148 seconds