ECOModelRoot removed?
 
CapableObjects Forums
Home       Members    Calendar    Who's On
Welcome Guest ( Login | Register )
        



ECOModelRoot removed? Expand / Collapse
Author
Message
Posted 2010-02-14 13:46:59
Forum Guru

Forum GuruForum GuruForum GuruForum GuruForum GuruForum GuruForum GuruForum Guru

Group: Forum Members
Last Login: 2010-03-05 08:23:42
Posts: 69, Visits: 158
Hi

I recently generated code in a project after upgrading to the latest version.

I am getting "ECOModelRoot is not a type name" in an ocl query now, has it been removed?

John
Post #4869
Posted 2010-02-14 14:48:10
Forum Guru

Forum GuruForum GuruForum GuruForum GuruForum GuruForum GuruForum GuruForum Guru

Group: Forum Members
Last Login: 2010-07-15 11:02:52
Posts: 60, Visits: 151
Your UML model has evolved however some OCL expressions (contained in handles) not.
So check each OCL expression and then update it if it is wrong.

Post #4870
Posted 2010-02-15 09:14:48
Supreme Being

Supreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme Being

Group: Administrators
Last Login: 2010-08-23 23:54:43
Posts: 1 228, Visits: 1 374
ECOModelRoot is an implicit class that is added to the model if (and only if) the model doesn't already contain a root class from which all other classes descend. So, a model with only one class (Class1) will not have ECOModelRoot. If you add a new class (Class2) ECO will add ECOModelRoot and let the two classes descend from this class in the runtime model. If you add an inheritance between Class1 and Class2, ECOModelRoot will dissappear again since Class1 will be the root class of the model (or Class2 depending on which inherits from which ofcourse). Setting the property "DefaultSuperClass" in your model will have a similar effect since all classes will inherit from this class unless they inherit from somewhere else.

/Jonas Hogstrom [CapableObjects]
Post #4873
Posted 2010-03-31 09:32:08
Forum Member

Forum MemberForum MemberForum MemberForum MemberForum MemberForum MemberForum MemberForum Member

Group: Forum Members
Last Login: 2010-06-22 11:37:01
Posts: 32, Visits: 193
There is no this table ,If give one ID,How to know what type is this id fastly? look through all datas of all tables?
----------------------
for example:
many classes inherit from class1 ,and set the tablemapping=children of class1;
if class1 have association with classb;like this class1(0..1)------(0..*)classb, so classb will have one field class1id which is the id of those classes inherited from class1;How to know those id is which class?
Post #5085
Posted 2010-03-31 11:54:25
Supreme Being

Supreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme Being

Group: Administrators
Last Login: 2010-08-23 23:54:43
Posts: 1 228, Visits: 1 374
There is no easy way to know this. If you have a model like this, ECO will have to try to locate the ID in the child-tables to determine the exact type of the object. This is obviously very slow if you have many child-tables.

It would in theory be possible to add the type-column to the table that stores the id of the related object, but this would require some modifications of the persistencemapper...


/Jonas Hogstrom [CapableObjects]
Post #5088
Posted 2010-03-31 12:05:47
Forum Member

Forum MemberForum MemberForum MemberForum MemberForum MemberForum MemberForum MemberForum Member

Group: Forum Members
Last Login: 2010-06-22 11:37:01
Posts: 32, Visits: 193
oh,I know it,there are another compromised method to resovle this?
set tablemapping as own ,can help this?
-------------
At the same time,I find , if there ECOModelRoot is exist,in this table there ara all id and types for all classes. why store these datas in this table?


Post #5090
Posted 2010-03-31 15:29:20
Supreme Being

Supreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme Being

Group: Administrators
Last Login: 2010-08-23 23:54:43
Posts: 1 228, Visits: 1 374
If the rootclass (EcoModelRoot) has TableMapping=Own, it will have a table, but since it doesn't have any attributes, the only thing the table will contain will be the ID and Type column.

You can childmap the rootclass by setting a property on a DefaultORMappingBuilder component and hook it up as the NewMappingProvider and RuntimeMappingProvider for you PersistenceMapperSqlServer on your PMP.

Yes, I know there are an awful lot of classes that contain the word Mapping or Mapper...


/Jonas Hogstrom [CapableObjects]
Post #5093
Posted 2010-03-31 15:47:11
Forum Member

Forum MemberForum MemberForum MemberForum MemberForum MemberForum MemberForum MemberForum Member

Group: Forum Members
Last Login: 2010-06-22 11:37:01
Posts: 32, Visits: 193
It seems that it's difficult,I can't know if I can realize it. Can you have told me more ?

Another question ,
modal like this:
--------------
Many classes inherit from class1,for example class111,class112 are inherited from class1;
if class1 have association with classb;like this class1(0..1)------(0..*)classb, so classb will have one field class1id which is the id of those classes inherited from class1;
--------
I want to know.when I have one classb ,so I know the value classb.class1id, If I set the class1 tablemapping=own, the table class1 have all data(id and type), this table can help eco to fastly locate the ID to get the exact object.
Post #5096
Posted 2010-04-13 09:02:17
Supreme Being

Supreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme Being

Group: Administrators
Last Login: 2010-08-23 23:54:43
Posts: 1 228, Visits: 1 374
Yes, if you use tablemapping "Own" for Class1, any reference to this class can have its type easily determined with a lookup in table Class1. If you childmap Class1, ECO will have to look in the tables for the childclasses until it finds the right table (slow).

/Jonas Hogstrom [CapableObjects]
Post #5138
« Prev Topic | Next Topic »


Reading This Topic Expand / Collapse
Active Users: 0 (0 guests, 0 members, 0 anonymous members)
No members currently viewing this topic.
Forum Moderators: HansKarlsen, Jonas Hogstrom

Permissions Expand / Collapse

All times are GMT +1:00, Time now is 4:43

Powered By InstantForum.NET v4.1.4 © 2010
Execution: 0,234. 11 queries. Compression Disabled.