Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF » Extracting partial EMF objects from a database
Extracting partial EMF objects from a database [message #524457] Thu, 01 April 2010 03:22 Go to next message
Bryan Hunt is currently offline Bryan HuntFriend
Messages: 366
Registered: July 2009
Senior Member
I have a use-case where I have an EMF object mapped to a database table
with 35+ attributes. It is typical for users to construct queries that
extract 10,000 to 30,000 objects (rows) from the table, but only 10 or
so attributes (columns) are desired by the user. Transfering fully
populated EMF objects is not an acceptable solution. Right now, we
have custom code to create objects with only the desired attributes
populated, leaving the other attributes unset, which greatly reduces
the time on the network to transfer the data.

Does anyone know if Teneo or CDO can handle this specific use-case? I
might consider the use of dynamic EMF if Teneo or CDO could handle the
dynamic ORM, but not at the cost of performance.

Does anyone else have any experience with this type of use-case?

Bryan
Re: Extracting partial EMF objects from a database [message #524466 is a reply to message #524457] Thu, 01 April 2010 00:48 Go to previous messageGo to next message
Eike Stepper is currently offline Eike StepperFriend
Messages: 6682
Registered: July 2009
Senior Member
Hi Brian,

CDO does not support "fetch groups", as of now. We do support partially
loaded collections with the DBStore, the ObjectivityStore (AFAIK) and
the MEMStore, but not with the HibernateStore.

Cheers
/Eike

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



Am 01.04.2010 05:22, schrieb Bryan Hunt:
> I have a use-case where I have an EMF object mapped to a database
> table with 35+ attributes. It is typical for users to construct
> queries that extract 10,000 to 30,000 objects (rows) from the table,
> but only 10 or so attributes (columns) are desired by the user.
> Transfering fully populated EMF objects is not an acceptable
> solution. Right now, we have custom code to create objects with only
> the desired attributes populated, leaving the other attributes unset,
> which greatly reduces the time on the network to transfer the data.
>
> Does anyone know if Teneo or CDO can handle this specific use-case? I
> might consider the use of dynamic EMF if Teneo or CDO could handle the
> dynamic ORM, but not at the cost of performance.
>
> Does anyone else have any experience with this type of use-case?
>
> Bryan
>


Re: Extracting partial EMF objects from a database [message #524514 is a reply to message #524457] Thu, 01 April 2010 08:28 Go to previous message
Martin Taal is currently offline Martin TaalFriend
Messages: 5468
Registered: July 2009
Senior Member
Hi Bryan,
I am not sure how complex the queries are (if your users query for a list of flat objects or for object graphs). If you
need to return a set of more flat objects then you can use the hibernate resulttransformer concept in combination with
dynamically created HQL or Criteria (which then only queries the features you want to return).

It depends if reading from the database of the unnecessary columns should be prevented (it depends on your architecture
also). Often reading extra columns is not expensive, reading rows is. But this depends on the case and the chosen
architecture. If reading all columns is not a problem but sending them over the network is the issue then you could say
that his could be done in the layer which takes care of preparing the objects for network traffic (the
(de-)serialization logic).

Another option is to create a custom epackage and eclass with just the efeatures you want and initialize a datastore.
The objects returned by Hibernate will be DynamicEObjects (there is probably also a way to let hibernate use the
generated class also, let me know if you need more info here). Initializing session factories is normally an expensive
operation but if there is only a few classes to map it is maybe still practical.

Btw, the latest Teneo build supports extra-lazy collection handling and also supports lazy iterators which read
collection content in chunks:
http://wiki.eclipse.org/Teneo/Hibernate/Collection_Extra-Laz y_Loading
I will add the same feature to the hibernate store.

Hope this helps a bit.

gr. Martin

Bryan Hunt wrote:
> I have a use-case where I have an EMF object mapped to a database table
> with 35+ attributes. It is typical for users to construct queries that
> extract 10,000 to 30,000 objects (rows) from the table, but only 10 or
> so attributes (columns) are desired by the user. Transfering fully
> populated EMF objects is not an acceptable solution. Right now, we have
> custom code to create objects with only the desired attributes
> populated, leaving the other attributes unset, which greatly reduces the
> time on the network to transfer the data.
>
> Does anyone know if Teneo or CDO can handle this specific use-case? I
> might consider the use of dynamic EMF if Teneo or CDO could handle the
> dynamic ORM, but not at the cost of performance.
>
> Does anyone else have any experience with this type of use-case?
>
> Bryan
>


--

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
Previous Topic:Getting an EObject equivalent of a java object
Next Topic:[TENEO] How to use/configure a custom EMFTupelizer
Goto Forum:
  


Current Time: Fri Mar 29 10:55:43 GMT 2024

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

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

Back to the top