Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF » Teneo: Possibility to use Set-semantics(Teneo: Possibility to use Set-semantics)
Teneo: Possibility to use Set-semantics [message #546942] Wed, 14 July 2010 16:57 Go to next message
Markus Bohr is currently offline Markus BohrFriend
Messages: 2
Registered: July 2010
Location: Raunheim, Germany
Junior Member
Hello,

I currently use Teneo to bind non-unique EReferences together with Hibernate bag mappings.
What would actually fit better for me would be to introduce a set-semantics to avoid duplicates (giving "true" result for the equals() method) in my lists.

What would I have to do to make this work with Teneo inbetween?
Is it that simple to use the "IS_UNIQUE" constant on EMF side, and set-mapping on Hibernate mapping side, and Teneo makes it work, or is it more complicated?!

EMF side:

initEReference(getCardFormat_Remarks(),
theDomainclassesPackage_99.getRemark(), null, "remarks", null, 0,
-1, CardFormat.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE,
!IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE,
!IS_DERIVED, IS_ORDERED);

Hibernate side:

<set name="remarks" where="table_name='CARD_FORMAT'" outer-join="false" inverse="true" lazy="true" optimistic-lock="true" fetch="select" cascade="refresh">
<key on-delete="noaction" unique="false">
<column name="ref_id" sql-type="INTEGER" not-null="true"/>
</key>
<one-to-many class=" com.lhsystems.lido.common.domain.technical.domainclasses.imp l.RemarkImpl " entity-name="Remark"/>
</set>
Re: Teneo: Possibility to use Set-semantics [message #547066 is a reply to message #546942] Thu, 15 July 2010 10:48 Go to previous messageGo to next message
Martin Taal is currently offline Martin TaalFriend
Messages: 5468
Registered: July 2009
Senior Member
Hi Markus,
Yes the ereference should be set to unique==true. EMF will not generate a Set collection type so it is not possible to
use the Hibernate <set /> tag (as Hibernate will assume a Set to be used for the type in the generated java).

gr. Martin

On 07/14/2010 06:57 PM, Markus Bohr wrote:
> Hello,
>
> I currently use Teneo to bind non-unique EReferences together with
> Hibernate bag mappings.
> What would actually fit better for me would be to introduce a
> set-semantics to avoid duplicates (giving "true" result for the equals()
> method) in my lists.
>
> What would I have to do to make this work with Teneo inbetween?
> Is it that simple to use the "IS_UNIQUE" constant on EMF side, and
> set-mapping on Hibernate mapping side, and Teneo makes it work, or is it
> more complicated?!
>
> EMF side:
>
> initEReference(getCardFormat_Remarks(),
> theDomainclassesPackage_99.getRemark(), null, "remarks", null, 0,
> -1, CardFormat.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE,
> !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE,
> !IS_DERIVED, IS_ORDERED);
>
> Hibernate side:
>
> <set name="remarks" where="table_name='CARD_FORMAT'" outer-join="false"
> inverse="true" lazy="true" optimistic-lock="true" fetch="select"
> cascade="refresh">
> <key on-delete="noaction" unique="false">
> <column name="ref_id" sql-type="INTEGER" not-null="true"/>
> </key>
> <one-to-many class="
> com.lhsystems.lido.common.domain.technical.domainclasses.imp
> l.RemarkImpl " entity-name="Remark"/>
> </set>


--

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: Possibility to use Set-semantics [message #547277 is a reply to message #547066] Fri, 16 July 2010 07:57 Go to previous messageGo to next message
Markus Bohr is currently offline Markus BohrFriend
Messages: 2
Registered: July 2010
Location: Raunheim, Germany
Junior Member
Hmm, this a real pity, as <set> on our surrogate keys promises to be far more performant than <bag>...
Re: Teneo: Possibility to use Set-semantics [message #547336 is a reply to message #547277] Fri, 16 July 2010 10:44 Go to previous message
Martin Taal is currently offline Martin TaalFriend
Messages: 5468
Registered: July 2009
Senior Member
Hi Markus,
Yes, I am not sure how you use EMF, but if you mainly use it server-side (so without the RCP features) then the Texo
project maybe of interest to you. It supports the Set in the generated api (and supports automatic orm generation):
http://wiki.eclipse.org/Texo

gr. Martin

On 07/16/2010 09:57 AM, Markus Bohr wrote:
> Hmm, this a real pity, as <set> on our surrogate keys promises to be far
> more performant than <bag>...


--

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:Error generating test classes
Next Topic:[OCL/QVTO] Accessing a EFeatureMapEntry
Goto Forum:
  


Current Time: Wed Apr 24 15:01:50 GMT 2024

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

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

Back to the top