Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF » CDO MappingStrategy example and CDO Questions.
CDO MappingStrategy example and CDO Questions. [message #428087] Mon, 09 March 2009 21:43 Go to next message
Brian Michaud is currently offline Brian Michaud
Messages: 1
Registered: July 2009
Junior Member
I'm trying to find out if CDO will work for what I'm doing. Essentially, I
have a database already built, and it has data that maps to an EMF model.
Via CDO, using a class that implements IMappingStrategy, will I be able to
specify how the model maps to the various fields/tables in the db (MySQL)?

If so, does anyone have any examples/documentation of how to use
IMappingStrategy properly for a custom mapping?

Finally, if all of this works, I'm primarily using the mapping to read
data from the db into the model, and would like to be able to perform a
variety of filtering to filter which data actually gets into the model. Is
this possible?

Thanks.
Re: CDO MappingStrategy example and CDO Questions. [message #428089 is a reply to message #428087] Tue, 10 March 2009 05:16 Go to previous messageGo to next message
Eike Stepper is currently offline Eike Stepper
Messages: 5545
Registered: July 2009
Senior Member
Brian,

There are several kinds of backend integrations available for CDO. For
the integration of relational database systems we offer the proprietary
DBStore (which delegates most of the actaul mapping job to
IMappingStrategy, IClassMapping and IFeatureMapping) and a
HibernateStore (which uses Teneo to generate Hibernate mappings). Have
you already looked at the HibernateStore?

If you really plan to implement a custom IMappingStrategy for the
DBStore, that should be possible although there is no documentation
available. The shipped HorizontalMappingStrategy is probably the only
example we can offer. If possible I recommend to subclass
MappingStrategy and ClassMapping. If it turns out that they are
generally useful we can make them public as SPI.

Cheers
/Eike

----
http://thegordian.blogspot.com



Brian Michaud schrieb:
> I'm trying to find out if CDO will work for what I'm doing.
> Essentially, I have a database already built, and it has data that
> maps to an EMF model. Via CDO, using a class that implements
> IMappingStrategy, will I be able to specify how the model maps to the
> various fields/tables in the db (MySQL)?
> If so, does anyone have any examples/documentation of how to use
> IMappingStrategy properly for a custom mapping?
>
> Finally, if all of this works, I'm primarily using the mapping to read
> data from the db into the model, and would like to be able to perform
> a variety of filtering to filter which data actually gets into the
> model. Is this possible?
>
> Thanks.
>
Re: CDO MappingStrategy example and CDO Questions. [message #1035072 is a reply to message #428089] Sat, 06 April 2013 09:12 Go to previous messageGo to next message
Christophe MOINE is currently offline Christophe MOINE
Messages: 34
Registered: February 2012
Member
Hello everybody,

I was just wondering if there was any update on that lately ? Did somebody worked on a custom mapping ?

I wonder if this mapping is efficient with [0..*] relation, since for each add (for exemple to a relation from A to B), it modifies the container A table to modify the cardinality, then it adds a A_B_list entry, and finally an entry in the B table: wouldn't be simpler to put all this logic in B table ?

I actually don't know very well about DB optimization (I'm not a DB admin Smile ), but I was just wondering if somebody believes that there would be a mapping "much" more efficient than the default one, and maybe alreay start working on it ?

Thanks in advance,

Cheers,

Christophe.

Re: CDO MappingStrategy example and CDO Questions. [message #1035106 is a reply to message #1035072] Sat, 06 April 2013 10:26 Go to previous messageGo to next message
Martin Taal is currently offline Martin Taal
Messages: 5339
Registered: July 2009
Senior Member
Hi Christophe,
The cdo hibernate store provides this type of mapping flexibility where you can choose to use join tables or foreign
keys columns directly in the 'child' table. This can be set globally using options or by annotations in the model. But
the hibernate store does not support all cdo features (as the dbstore which does support all features). Noteably,
branching is not supported nor is chunked reading of large collections. This last topic will be solved if someone needs
it though.

gr. Martin

On 04/06/2013 11:12 AM, Christophe MOINE wrote:
> Hello everybody,
>
> I was just wondering if there was any update on that lately ? Did somebody worked on a custom mapping ?
>
> I wonder if this mapping is efficient with [0..*] relation, since for each add (for exemple to a relation from A to B),
> it modifies the container A table to modify the cardinality, then it adds a A_B_list entry, and finally an entry in the
> B table: wouldn't be simpler to put all this logic in B table ?
>
> I actually don't know very well about DB optimization (I'm not a DB admin :) ), but I was just wondering if somebody
> believes that there would be a mapping "much" more efficient than the default one, and maybe alreay start working on it ?
>
> Thanks in advance,
>
> Cheers,
>
> Christophe.
>
>


--

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@xxxxxxxx - mtaal@xxxxxxxx
Web: www.springsite.com - www.elver.org
Re: CDO MappingStrategy example and CDO Questions. [message #1035140 is a reply to message #1035072] Sat, 06 April 2013 11:27 Go to previous message
Eike Stepper is currently offline Eike Stepper
Messages: 5545
Registered: July 2009
Senior Member
Am 06.04.2013 11:12, schrieb Christophe MOINE:
> Hello everybody,
>
> I was just wondering if there was any update on that lately ? Did somebody worked on a custom mapping ?
I don't know.

> I wonder if this mapping is efficient with [0..*] relation, since for each add (for exemple to a relation from A to
> B), it modifies the container A table to modify the cardinality, then it adds a A_B_list entry, and finally an entry
> in the B table: wouldn't be simpler to put all this logic in B table ?
Simpler yes, but how would you maintain the cdo_version column in the container table?

> I actually don't know very well about DB optimization (I'm not a DB admin :) ), but I was just wondering if somebody
> believes that there would be a mapping "much" more efficient than the default one, and maybe alreay start working on it ?
Not that I know of.

Cheers
/Eike

----
http://www.esc-net.de
http://thegordian.blogspot.com
http://twitter.com/eikestepper
Previous Topic:[CDO] CDO server throws exception after migrating to M6 (MySQL)
Next Topic:How to set duplicates at EList
Goto Forum:
  


Current Time: Sat Oct 25 04:32:38 GMT 2014

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

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