Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF "Technology" (Ecore Tools, EMFatic, etc)  » [Teneo] Is there a way to stop initialize a collection when I only want to add or remove an element?
[Teneo] Is there a way to stop initialize a collection when I only want to add or remove an element? [message #606655] Thu, 10 May 2007 10:54
Anthony Lee is currently offline Anthony LeeFriend
Messages: 114
Registered: July 2009
Senior Member
Hi,

When I want to add an element to a lazy collection, the collection is
initilized.

According to below Q&A,I set my collection's inverse attribute as "true",
But the collection still be initialized.

Has this issue something to do with Teneo's persistableEList?

How can I prevent this loading?

============================================================ =============
Q:Why does Hibernate always initialize a collection when I only want to add
or remove an element?

A:Unfortunately the collections API defines method return values that may
only be computed by hitting the database. There are three exceptions to
this: Hibernate can add to a <bag>, <idbag> or <list> declared with
inverse="true" without initializing the collection; the return value must
always be true.

If you want to avoid extra database traffic (ie. in performance critical
code), refactor your model to use only many-to-one associations. This is
almost always possible. Then use queries in place of collection access.
============================================================ ==============
Previous Topic:[Teneo] Integrating Teneo-Struts-Tomcat
Next Topic:[Teneo] Is there a way to stop initialize a collection when I only want to add or remove an element?
Goto Forum:
  


Current Time: Thu Apr 25 16:43:39 GMT 2024

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

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

Back to the top