[Teneo] Lazy-loading one-to-many EList [message #621454] |
Mon, 12 October 2009 11:33 |
Frank Grimm 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"/>
</key>
<list-index column="`m_ns_idx`"/>
<one-to-many entity-name="N"/>
</list>
</subclass>
<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>
</subclass>
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
implementation.
Many thanks in advance,
Frank
|
|
|
Powered by
FUDForum. Page generated in 0.01839 seconds