Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF » Object identity - Hibernate Entity Manager - Teneo
Object identity - Hibernate Entity Manager - Teneo [message #420679] Mon, 07 July 2008 14:56 Go to next message
Balazs Molnar is currently offline Balazs MolnarFriend
Messages: 28
Registered: July 2009
Junior Member
Hello,

If I have multiple (search) views which search into the database (with
createQuery()), the result objects from the queries are different EMF
objects even when the returned database entity/record is the same.

Therefore if an editor that is opened on any of the views, changes the EMF
object, the result will not be reflected in the other views even though
the objects (from a user perspective) are the same.

How can I achieve to have any given database record be represented on the
EMF entity layer as the same object ?

Would the use of Hibernate Entity manager solve this ? "It says the
following: A persistence context is a set of entity instances in which
for any persistent entity identity there is a unique entity instance".

Thanks,
Balázs
Re: Object identity - Hibernate Entity Manager - Teneo [message #420688 is a reply to message #420679] Mon, 07 July 2008 20:37 Go to previous message
Martin Taal is currently offline Martin TaalFriend
Messages: 5468
Registered: July 2009
Senior Member
Hi Balázs,
I think that your views should share the same resource. You can load additional data in a resource
by calling the method: listByQuery(query, cache), cache is the query cache boolean. So then you
don't need to open a new resource for new queries. The listbyQuery returns the found objects as an
array so you can use the result directly in your search results while the resource serves as a kind
of first-level cache.

gr. Martin

Balázs Molnár wrote:
> Hello,
>
> If I have multiple (search) views which search into the database (with
> createQuery()), the result objects from the queries are different EMF
> objects even when the returned database entity/record is the same.
> Therefore if an editor that is opened on any of the views, changes the
> EMF object, the result will not be reflected in the other views even
> though the objects (from a user perspective) are the same.
>
> How can I achieve to have any given database record be represented on
> the EMF entity layer as the same object ?
>
> Would the use of Hibernate Entity manager solve this ? "It says the
> following: A persistence context is a set of entity instances in which
> for any persistent entity identity there is a unique entity instance".
>
> Thanks,
> Balázs
>


--

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:Re: [CDO] Loss of connectivity hosing the client
Next Topic:EAnnotation and Cross document reference
Goto Forum:
  


Current Time: Fri Apr 26 14:58:48 GMT 2024

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

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

Back to the top