Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF » [Teneo] Not all referers computed when using idbag
[Teneo] Not all referers computed when using idbag [message #422007] Wed, 20 August 2008 09:54 Go to next message
Eclipse UserFriend
Originally posted by: bsu.bergauer.ch

Hi Martin,



I'm not sure if this is an intended effect, but if I set the option
PersistenceOptions.MAP_ALL_LISTS_AS_IDBAG =true I get an incomplete mapping
of referrers for objects with many-to-many relations.



A comparison in the mapping file shows the difference:



1) PersistenceOptions.MAP_ALL_LISTS_AS_IDBAG =false

....

<list name="predefinedAttributeValues"
table="`datapointattributeholder_predefinedattributevalues` " lazy="true">

<key update="true">

<column name="`datapointattributeholder_e_id`"
not-null="true" unique="false"
index="DatapointAttributeHolder_predefinedAttributeValues"/ >

</key>

<list-index
column="`datapointattributeholder_predefinedattributevalues_idx` "/>

<many-to-many entity-name="AttributeValueDefinition"
unique="false"
foreign-key="datapointattributeholder_predefinedattributevalues ">

<column name="`attributevaluedefinition_id`"
not-null="true" unique="false"
index="DatapointAttributeHolder_predefinedAttributeValues"/ >

</many-to-many>

</list>

....



2) PersistenceOptions.MAP_ALL_LISTS_AS_IDBAG =true

....

<idbag name="predefinedAttributeValues"
table="`datapointattributeholder_predefinedattributevalues` " lazy="true">

<collection-id column="ID" type="long">

<generator class="increment"/>

</collection-id>

<key update="true">

<column name="`datapointattributeholder_e_id`"
not-null="true" unique="false"
index="DatapointAttributeHolder_predefinedAttributeValues"/ >

</key>

<many-to-many entity-name="AttributeValueDefinition"
unique="false"
foreign-key="datapointattributeholder_predefinedattributevalues ">

<column name="`attributevaluedefinition_id`"
not-null="true" unique="false"
index="DatapointAttributeHolder_predefinedAttributeValues"/ >

</many-to-many>

</idbag>

...



In the HbDataStore.computeReferers() method prop.getValue() returns a List
in 1) above and an IdentifierBag in 2). For the case of an IdentifierBag the
clause

"else if (prop.getValue() instanceof List || prop.getValue() instanceof
Bag)" is returning false as the IdentifierBag isn't an instance of either a
List nor a Bag.



The IdentifierBag is extending the IdentifierCollection which extends the
org.hibernate.mapping.Collection, the Bag is also extending the
org.hibernate.mapping.Collection but isn't extended by the IdentifierBag.



Is this a bug or a feature? ;-)



Greetings

Bj
Re: [Teneo] Not all referers computed when using idbag [message #422009 is a reply to message #422007] Wed, 20 August 2008 10:07 Go to previous messageGo to next message
Martin Taal is currently offline Martin TaalFriend
Messages: 5468
Registered: July 2009
Senior Member
A bug :-(. Can you enter a bugzilla for this?

gr. Martin

Björn Sundin wrote:
> Hi Martin,
>
>
>
> I'm not sure if this is an intended effect, but if I set the option
> PersistenceOptions.MAP_ALL_LISTS_AS_IDBAG =true I get an incomplete mapping
> of referrers for objects with many-to-many relations.
>
>
>
> A comparison in the mapping file shows the difference:
>
>
>
> 1) PersistenceOptions.MAP_ALL_LISTS_AS_IDBAG =false
>
> ....
>
> <list name="predefinedAttributeValues"
> table="`datapointattributeholder_predefinedattributevalues` " lazy="true">
>
> <key update="true">
>
> <column name="`datapointattributeholder_e_id`"
> not-null="true" unique="false"
> index="DatapointAttributeHolder_predefinedAttributeValues"/ >
>
> </key>
>
> <list-index
> column="`datapointattributeholder_predefinedattributevalues_idx` "/>
>
> <many-to-many entity-name="AttributeValueDefinition"
> unique="false"
> foreign-key="datapointattributeholder_predefinedattributevalues ">
>
> <column name="`attributevaluedefinition_id`"
> not-null="true" unique="false"
> index="DatapointAttributeHolder_predefinedAttributeValues"/ >
>
> </many-to-many>
>
> </list>
>
> ....
>
>
>
> 2) PersistenceOptions.MAP_ALL_LISTS_AS_IDBAG =true
>
> ....
>
> <idbag name="predefinedAttributeValues"
> table="`datapointattributeholder_predefinedattributevalues` " lazy="true">
>
> <collection-id column="ID" type="long">
>
> <generator class="increment"/>
>
> </collection-id>
>
> <key update="true">
>
> <column name="`datapointattributeholder_e_id`"
> not-null="true" unique="false"
> index="DatapointAttributeHolder_predefinedAttributeValues"/ >
>
> </key>
>
> <many-to-many entity-name="AttributeValueDefinition"
> unique="false"
> foreign-key="datapointattributeholder_predefinedattributevalues ">
>
> <column name="`attributevaluedefinition_id`"
> not-null="true" unique="false"
> index="DatapointAttributeHolder_predefinedAttributeValues"/ >
>
> </many-to-many>
>
> </idbag>
>
> ...
>
>
>
> In the HbDataStore.computeReferers() method prop.getValue() returns a List
> in 1) above and an IdentifierBag in 2). For the case of an IdentifierBag the
> clause
>
> "else if (prop.getValue() instanceof List || prop.getValue() instanceof
> Bag)" is returning false as the IdentifierBag isn't an instance of either a
> List nor a Bag.
>
>
>
> The IdentifierBag is extending the IdentifierCollection which extends the
> org.hibernate.mapping.Collection, the Bag is also extending the
> org.hibernate.mapping.Collection but isn't extended by the IdentifierBag.
>
>
>
> Is this a bug or a feature? ;-)
>
>
>
> Greetings
>
> Björn
>
>


--

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
Re: [Teneo] Not all referers computed when using idbag [message #422013 is a reply to message #422009] Wed, 20 August 2008 11:47 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: bsu.bergauer.ch

NP. Bug-Id: 244683

Can you already say if you rather check instanceof for
org.hibernate.mapping.Collection instead of org.hibernate.mapping.Bag, or
add a check for org.hibernate.mapping.IdentifierBag? Just that I can fix it
locally until the update comes. :-)

Greetings
Bj
Re: [Teneo] Not all referers computed when using idbag [message #422057 is a reply to message #422013] Thu, 21 August 2008 05:26 Go to previous message
Martin Taal is currently offline Martin TaalFriend
Messages: 5468
Registered: July 2009
Senior Member
Hi Björn,
Thanks for the bugzilla.

It will probably be org.hibernate.mapping.Collection.

gr. Martin

Björn Sundin wrote:
> NP. Bug-Id: 244683
>
> Can you already say if you rather check instanceof for
> org.hibernate.mapping.Collection instead of org.hibernate.mapping.Bag, or
> add a check for org.hibernate.mapping.IdentifierBag? Just that I can fix it
> locally until the update comes. :-)
>
> Greetings
> Björn
>
>
> "Martin Taal" <mtaal@elver.org> schrieb im Newsbeitrag
> news:g8gqcg$iuf$1@build.eclipse.org...
>> A bug :-(. Can you enter a bugzilla for this?
>>
>> gr. Martin
>>
>> Björn Sundin wrote:
>>> Hi Martin,
>>>
>>>
>>>
>>> I'm not sure if this is an intended effect, but if I set the option
>>> PersistenceOptions.MAP_ALL_LISTS_AS_IDBAG =true I get an incomplete
> mapping
>>> of referrers for objects with many-to-many relations.
>>>
>>>
>>>
>>> A comparison in the mapping file shows the difference:
>>>
>>>
>>>
>>> 1) PersistenceOptions.MAP_ALL_LISTS_AS_IDBAG =false
>>>
>>> ....
>>>
>>> <list name="predefinedAttributeValues"
>>> table="`datapointattributeholder_predefinedattributevalues` "
> lazy="true">
>>> <key update="true">
>>>
>>> <column name="`datapointattributeholder_e_id`"
>>> not-null="true" unique="false"
>>> index="DatapointAttributeHolder_predefinedAttributeValues"/ >
>>>
>>> </key>
>>>
>>> <list-index
>>> column="`datapointattributeholder_predefinedattributevalues_idx` "/>
>>>
>>> <many-to-many entity-name="AttributeValueDefinition"
>>> unique="false"
>>> foreign-key="datapointattributeholder_predefinedattributevalues ">
>>>
>>> <column name="`attributevaluedefinition_id`"
>>> not-null="true" unique="false"
>>> index="DatapointAttributeHolder_predefinedAttributeValues"/ >
>>>
>>> </many-to-many>
>>>
>>> </list>
>>>
>>> ....
>>>
>>>
>>>
>>> 2) PersistenceOptions.MAP_ALL_LISTS_AS_IDBAG =true
>>>
>>> ....
>>>
>>> <idbag name="predefinedAttributeValues"
>>> table="`datapointattributeholder_predefinedattributevalues` "
> lazy="true">
>>> <collection-id column="ID" type="long">
>>>
>>> <generator class="increment"/>
>>>
>>> </collection-id>
>>>
>>> <key update="true">
>>>
>>> <column name="`datapointattributeholder_e_id`"
>>> not-null="true" unique="false"
>>> index="DatapointAttributeHolder_predefinedAttributeValues"/ >
>>>
>>> </key>
>>>
>>> <many-to-many entity-name="AttributeValueDefinition"
>>> unique="false"
>>> foreign-key="datapointattributeholder_predefinedattributevalues ">
>>>
>>> <column name="`attributevaluedefinition_id`"
>>> not-null="true" unique="false"
>>> index="DatapointAttributeHolder_predefinedAttributeValues"/ >
>>>
>>> </many-to-many>
>>>
>>> </idbag>
>>>
>>> ...
>>>
>>>
>>>
>>> In the HbDataStore.computeReferers() method prop.getValue() returns a
> List
>>> in 1) above and an IdentifierBag in 2). For the case of an IdentifierBag
> the
>>> clause
>>>
>>> "else if (prop.getValue() instanceof List || prop.getValue() instanceof
>>> Bag)" is returning false as the IdentifierBag isn't an instance of
> either a
>>> List nor a Bag.
>>>
>>>
>>>
>>> The IdentifierBag is extending the IdentifierCollection which extends
> the
>>> org.hibernate.mapping.Collection, the Bag is also extending the
>>> org.hibernate.mapping.Collection but isn't extended by the
> IdentifierBag.
>>>
>>>
>>> Is this a bug or a feature? ;-)
>>>
>>>
>>>
>>> Greetings
>>>
>>> Björn
>>>
>>>
>>
>> --
>>
>> 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
>
>


--

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:Teneo gmf: adding obj with containment relationship causes constraint violation
Next Topic:xsd export
Goto Forum:
  


Current Time: Fri Apr 26 15:02:22 GMT 2024

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

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

Back to the top