Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF » EMF ecore and genmodel editors and documentation for them
EMF ecore and genmodel editors and documentation for them [message #1841520] Wed, 19 May 2021 22:16 Go to next message
Warwick Burrows is currently offline Warwick BurrowsFriend
Messages: 132
Registered: July 2009
Location: Austin, TX
Senior Member

Is there documentation for the existing sample ecore and genmodel editors that are included with eclipse EMF? For example, I'd like to know what some of the fields in the ecore editor mean. e.g. "unique" and "ID", and also how can I tell which properties control the creation of database tables and how do I use EAnnotations.

Also, are there any recommended alternatives to the sample ecore and genmodel editors that might have documentation or tips included.
Re: EMF ecore and genmodel editors and documentation for them [message #1841526 is a reply to message #1841520] Thu, 20 May 2021 06:34 Go to previous messageGo to next message
Ed Merks is currently offline Ed MerksFriend
Messages: 32985
Registered: July 2009
Senior Member
You probably overlooked that when you select a property in the Properties view, the status area (at the bottom left of the whole window) shows a semi-helpful description of each property. Of course there is the EMF book with detailed documentation as well.

As for annotations, those are just "markup" that some downstream thing can interpret to be something meaningful or useful. The annotation itself is identified by an "Source" which is an arbitrary String though typically a URI, and then a bunch of contained details, i.e., key/value pairs both Strings. It's even possible for annotations to contain other arbitrary objects and reference other arbitrary objects. For some of the annotation sources that are understood directly by the core framework, special support is provided for creating them (with their Source already set) and special support for populating the properties they control.

There is the graphical editor provided by Ecore Tools and the Xcore editor providing pretty textual syntax. Neither provide special additional documentation.


Ed Merks
Professional Support: https://www.macromodeling.com/
Re: EMF ecore and genmodel editors and documentation for them [message #1841561 is a reply to message #1841526] Thu, 20 May 2021 15:48 Go to previous messageGo to next message
Warwick Burrows is currently offline Warwick BurrowsFriend
Messages: 132
Registered: July 2009
Location: Austin, TX
Senior Member
Thanks, yes I didn't notice the description in the status area. Its kind of small and I didn't expect to see it there. Now I know its there then it does help and did resolve my question with the ID field. Do you have any recommendations as to how to control table creation by the CDO server for new model objects? e.g. if I want to automatically set up a primary key or unique key, or other constraints for columns for each table based on the EMF properties? I notice in my tables that there are "not null" checks but no unique constraints and table indexes. Is this possible to configure for CDO with either EMF properties or Eannotations?
Re: EMF ecore and genmodel editors and documentation for them [message #1841569 is a reply to message #1841561] Fri, 21 May 2021 05:04 Go to previous messageGo to next message
Eike Stepper is currently offline Eike StepperFriend
Messages: 6681
Registered: July 2009
Senior Member
In CDO you can influence the basic mapping properties of EPackages, EClasses, and EStructuralFeatures with org.eclipse.emf.cdo.server.internal.db.DBAnnotation, see https://bugs.eclipse.org/bugs/show_bug.cgi?id=282976 .

I think that all mapped tables have primaries keys already, or not? Additional indexes can be declared with org.eclipse.emf.cdo.server.internal.db.DBIndexAnnotation, see https://bugs.eclipse.org/bugs/show_bug.cgi?id=417741 .



Re: EMF ecore and genmodel editors and documentation for them [message #1841602 is a reply to message #1841569] Fri, 21 May 2021 15:49 Go to previous message
Warwick Burrows is currently offline Warwick BurrowsFriend
Messages: 132
Registered: July 2009
Location: Austin, TX
Senior Member
Thanks Eike, this helps a lot! I had started investigating the code and this helps narrow it down. There's one observation that you may be able to confirm for me. Looking at the server code that initializes/creates the tables and the "forceIndexes" mapping strategy property it seems that indexes aren't added to a table that already exists - only when creating new tables. And existing columns aren't updated if the model changes. Is that the case or have I just not found where indexes are added and column definitions updated for existing tables?

And to answer your question: I have only seen indexes for CDO tables, not the tables created for my model objects. I also don't see any constraints like primary keys. However if, as I suspect, table definitions aren't updated once created then these model object tables have been around since CDO 4.1 and I probably didn't set the right EMF ecore properties to have constraints and indexes created back then. The DBAnnotation class may be the key here.

[Updated on: Fri, 21 May 2021 15:54]

Report message to a moderator

Previous Topic:[CDO] Editing an existing model - do I need to again "prepare it for CDO" as per the docum
Next Topic:[SOLVED][CDO] - Migrating from 4.6 to 4.10 - IllegalStateException type mapping EFeatureMapEntry
Goto Forum:
  


Current Time: Sat Nov 11 09:26:24 GMT 2023

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

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

Back to the top