Skip to main content

Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF "Technology" (Ecore Tools, EMFatic, etc)  » [Teneo] Lazy-loading one-to-many EList
[Teneo] Lazy-loading one-to-many EList [message #621454] Mon, 12 October 2009 11:33
Frank Grimm is currently offline Frank GrimmFriend
Messages: 22
Registered: July 2009
Junior Member
Dear newsgroup,

I've got a beginners question regarding Teneo (in combination wiht
Hibernate and H2 DB): I'm struggling with lazy-loading an EList. The
model looks like this:

[ EClass ] [ EClass ]
[ M ] <>---(0..*)-> [ N ]
[(extends Base)] [(extends Base)]

I.e. an instance of M owns many instances N.

Base is an abstract class with a property 'name' of type 'EString.'

Even though I set PersistenceOptions.SET_PROXY to true, I'm not able to
turn M's getter for Ns (EList<N> getNs()) into a lazy-loaded EList.

The Hibernate mapping generated by Teneo looks like this:

<subclass name="teneotests.test1_1toM.impl.MImpl"
entity-name="M" abstract="false" lazy="true" extends="Base"
discriminator-value="M" proxy="teneotests.test1_1toM.M">
<meta attribute="eclassName">M</meta>
<meta attribute="epackage">http://test1_1toM</meta>
<list name="ns" lazy="true" cascade="all,delete-orphan">
<key update="true" foreign-key="m_ns">
<column name="`m_ns_name`"
not-null="false" unique="false"/>
<list-index column="`m_ns_idx`"/>
<one-to-many entity-name="N"/>
<subclass name="teneotests.test1_1toM.impl.NImpl" entity-name="N"
abstract="false" lazy="true" extends="Base"
discriminator-value="N" proxy="teneotests.test1_1toM.N">
<meta attribute="eclassName">N</meta>
<meta attribute="epackage">http://test1_1toM</meta>

I'm not sure whether the problem has to do with M's one-to-many mapping
not having its lazy attribute set to true.?

Lazy loading works for one-to-one references; then a
JavassistLazyInitializer is created instead of a proper EList

Many thanks in advance,
Previous Topic:[EMF Index] Updatesite(s) for 0.8.0 corrupt?
Next Topic:How to get involve
Goto Forum:

Current Time: Tue Jun 28 10:21:33 GMT 2022

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

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

Back to the top