|
Re: [Teneo] Annotation required to stop cascade updates [message #427670 is a reply to message #427667] |
Wed, 25 February 2009 15:51 |
Martin Taal Messages: 5468 Registered: July 2009 |
Senior Member |
|
|
Hi David,
Is anything specific updated in the other futureprices (when you insert a new one)? I see that you have indexed on
false, so it is not the index field which is changed.
Teneo also supports most of the hibernate specific annotation set:
http://www.hibernate.org/hib_docs/annotations/reference/en/h tml_single/
One of them is the Cascade, so I think you should have something like this:
@Cascade( { DELETE_ORPHAN, REMOVE } )
you can keep the cascade in the OneToMany, the @Cascade annotation takes precedence.
gr. Martin
David Wynter wrote:
> Hi,
>
> I am using the following annotation for a one to many related entity.
>
> <xsd:element ecore:opposite="instrumentDomain" minOccurs="0"
> maxOccurs="unbounded" name="futurePrice" type="gensec:FuturePrice" >
> <xsd:annotation>
> <xsd:appinfo source="teneo.jpa">@OneToMany(fetch=LAZY
> cascade={REMOVE} indexed=false)</xsd:appinfo>
> </xsd:annotation>
> </xsd:element>
>
> Since I do not include PERSIST MERGE or REFRESH I expected the only
> action to occurs is have the related entities removed when I delete the
> parent.
>
> What I actually get is when I insert a new FuturePrice for a given
> instrumentDomain it generates a UPDATE statement for every one of the
> existing FuturePrice objects in the database, which can be over one
> thousand. I want these FuturePrice to remain untouched by any operation
> on InstrumentDomain or insertion or update to any other FuturePrice
> entity that happens to be related to the InstrumentDomain object concerned.
>
> I found no example of the Hibernate specific HbCascaseType of
> DELETE_ORPHAN. How is that expressed? Maybe that is what I need?
>
> Thx.
>
> David
--
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
|
|
|
Powered by
FUDForum. Page generated in 0.03024 seconds