|
Re: Extracting partial EMF objects from a database [message #524466 is a reply to message #524457] |
Thu, 01 April 2010 00:48 |
|
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
>
Cheers
/Eike
----
http://www.esc-net.de
http://thegordian.blogspot.com
http://twitter.com/eikestepper
|
|
|
Re: Extracting partial EMF objects from a database [message #524514 is a reply to message #524457] |
Thu, 01 April 2010 08:28 |
Martin Taal 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
|
|
|
Powered by
FUDForum. Page generated in 0.04116 seconds