Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF "Technology" (Ecore Tools, EMFatic, etc)  » [Teneo] Help needed with inherance mapping
[Teneo] Help needed with inherance mapping [message #82105] Sat, 05 May 2007 14:59 Go to next message
Alain Picard is currently offline Alain PicardFriend
Messages: 266
Registered: July 2009
Senior Member
Hi,

I have a pretty complex ecore model implementing the KDM (Knowledge
Discovery MetaModel) OMG standard. This meta-model is built just like
MOF (ecore) in that every class is actually a subclass of the top class
called element. There are also a ton of relation, as it is based on
entity relation. There are also a number of abstract classes in the
model and deep classes hierarchies.

When I use the single_table (default), the database creation fails since
MySql doesn't support more than 64 indexes. The number of tables is
about 30 if I recall correctly.

When I use the joined strategy, I get a database with 269 tables and
many tables are essentially empty, being just there to perform join.
This looks like it will not perform well. Also another posting on the
forum mentioned a limit of 61 joined tables, which I am quite sure would
be exceeded here.

Then I tried the table_per_class strategy and this gave me the just
reported error with the FK name length. But it also ended up with still
230 tables in the db (a quick count a model impl classes gives me 168
classes).

The documentation also briefly talks about the MappedSuperClass strategy
that could be used.

What are you suggestions and what have been seen to be best suited to
the kind of model that I am dealing with.

Regards
Alain
Re: [Teneo] Help needed with inherance mapping [message #82205 is a reply to message #82105] Sun, 06 May 2007 13:49 Go to previous message
Martin Taal is currently offline Martin TaalFriend
Messages: 5468
Registered: July 2009
Senior Member
Hi Alain,
From a modeling perspective I like the joined-table strategy because it best reflects the
inheritance structure.
You can use the MappedSuperClass annotation for the topclass(es) but then references to the topclass
are not persisted correctly in the db. If there are no references to the topclass(es) then you can
try to flatten the inheritance structure by declaring part of the top as a mappedsuperclass and then
for the remaing parts choose the inheritance strategy which fits best. Different inheritance trees
can have different inheritance strategies.

With empty tables you mean join tables for the inheritance structure (which would mean that there
are empty eclasses) or join tables to persist references? Join tables for references are required
for many-to-many and non-unique one-to-many relations.

gr. Martin

Alain Picard wrote:
> Hi,
>
> I have a pretty complex ecore model implementing the KDM (Knowledge
> Discovery MetaModel) OMG standard. This meta-model is built just like
> MOF (ecore) in that every class is actually a subclass of the top class
> called element. There are also a ton of relation, as it is based on
> entity relation. There are also a number of abstract classes in the
> model and deep classes hierarchies.
>
> When I use the single_table (default), the database creation fails since
> MySql doesn't support more than 64 indexes. The number of tables is
> about 30 if I recall correctly.
>
> When I use the joined strategy, I get a database with 269 tables and
> many tables are essentially empty, being just there to perform join.
> This looks like it will not perform well. Also another posting on the
> forum mentioned a limit of 61 joined tables, which I am quite sure would
> be exceeded here.
>
> Then I tried the table_per_class strategy and this gave me the just
> reported error with the FK name length. But it also ended up with still
> 230 tables in the db (a quick count a model impl classes gives me 168
> classes).
>
> The documentation also briefly talks about the MappedSuperClass strategy
> that could be used.
>
> What are you suggestions and what have been seen to be best suited to
> the kind of model that I am dealing with.
>
> Regards
> Alain


--

With Regards, Martin Taal

Springsite/Elver.org
Office: Hardwareweg 4, 3821 BV Amersfoort
Postal: Nassaulaan 7, 3941 EC Doorn
The Netherlands
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] Help needed with inherance mapping [message #605313 is a reply to message #82105] Sun, 06 May 2007 13:49 Go to previous message
Martin Taal is currently offline Martin TaalFriend
Messages: 5468
Registered: July 2009
Senior Member
Hi Alain,
From a modeling perspective I like the joined-table strategy because it best reflects the
inheritance structure.
You can use the MappedSuperClass annotation for the topclass(es) but then references to the topclass
are not persisted correctly in the db. If there are no references to the topclass(es) then you can
try to flatten the inheritance structure by declaring part of the top as a mappedsuperclass and then
for the remaing parts choose the inheritance strategy which fits best. Different inheritance trees
can have different inheritance strategies.

With empty tables you mean join tables for the inheritance structure (which would mean that there
are empty eclasses) or join tables to persist references? Join tables for references are required
for many-to-many and non-unique one-to-many relations.

gr. Martin

Alain Picard wrote:
> Hi,
>
> I have a pretty complex ecore model implementing the KDM (Knowledge
> Discovery MetaModel) OMG standard. This meta-model is built just like
> MOF (ecore) in that every class is actually a subclass of the top class
> called element. There are also a ton of relation, as it is based on
> entity relation. There are also a number of abstract classes in the
> model and deep classes hierarchies.
>
> When I use the single_table (default), the database creation fails since
> MySql doesn't support more than 64 indexes. The number of tables is
> about 30 if I recall correctly.
>
> When I use the joined strategy, I get a database with 269 tables and
> many tables are essentially empty, being just there to perform join.
> This looks like it will not perform well. Also another posting on the
> forum mentioned a limit of 61 joined tables, which I am quite sure would
> be exceeded here.
>
> Then I tried the table_per_class strategy and this gave me the just
> reported error with the FK name length. But it also ended up with still
> 230 tables in the db (a quick count a model impl classes gives me 168
> classes).
>
> The documentation also briefly talks about the MappedSuperClass strategy
> that could be used.
>
> What are you suggestions and what have been seen to be best suited to
> the kind of model that I am dealing with.
>
> Regards
> Alain


--

With Regards, Martin Taal

Springsite/Elver.org
Office: Hardwareweg 4, 3821 BV Amersfoort
Postal: Nassaulaan 7, 3941 EC Doorn
The Netherlands
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
Previous Topic:[Teneo] Error with generated FK name, name too long
Next Topic:Using "external" library in JET template
Goto Forum:
  


Current Time: Tue Apr 16 11:44:57 GMT 2024

Powered by FUDForum. Page generated in 0.10237 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top