Return-Path: X-Original-To: apmail-cayenne-dev-archive@www.apache.org Delivered-To: apmail-cayenne-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id E23766BD9 for ; Wed, 13 Jul 2011 13:31:41 +0000 (UTC) Received: (qmail 66086 invoked by uid 500); 13 Jul 2011 13:31:41 -0000 Delivered-To: apmail-cayenne-dev-archive@cayenne.apache.org Received: (qmail 66073 invoked by uid 500); 13 Jul 2011 13:31:40 -0000 Mailing-List: contact dev-help@cayenne.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@cayenne.apache.org Delivered-To: mailing list dev@cayenne.apache.org Received: (qmail 66064 invoked by uid 99); 13 Jul 2011 13:31:40 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 13 Jul 2011 13:31:40 +0000 X-ASF-Spam-Status: No, hits=-0.0 required=5.0 tests=RCVD_IN_DNSWL_LOW,SPF_NEUTRAL X-Spam-Check-By: apache.org Received-SPF: neutral (athena.apache.org: local policy) Received: from [209.85.214.43] (HELO mail-bw0-f43.google.com) (209.85.214.43) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 13 Jul 2011 13:31:35 +0000 Received: by bwd7 with SMTP id 7so8030558bwd.16 for ; Wed, 13 Jul 2011 06:31:13 -0700 (PDT) Received: by 10.204.181.10 with SMTP id bw10mr330151bkb.157.1310563873174; Wed, 13 Jul 2011 06:31:13 -0700 (PDT) MIME-Version: 1.0 Received: by 10.204.121.205 with HTTP; Wed, 13 Jul 2011 06:30:53 -0700 (PDT) In-Reply-To: References: <2022763318.8457.1300978206864.JavaMail.tomcat@hel.zones.apache.org> <4D8BCDB4.80507@maniatis.org> From: Michael Gentry Date: Wed, 13 Jul 2011 09:30:53 -0400 Message-ID: Subject: Re: @SortWeight annotation To: dev@cayenne.apache.org Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Hi Andrus, We sometimes get this exception: Sorting objects for [entity] failed. Cycles found. This is obviously coming out of AshwoodEntitySorter.java. Do you think the annotation would help in that circumstance? I'm just now starting to investigate this and another graph issue we are having. Thanks, mrg On Fri, Mar 25, 2011 at 3:48 AM, Andrus Adamchik w= rote: > You can already override the sorter via DI (and create a chain yourself, = decorated as EntitySorter interface). The sorter has the same scope as Caye= nne stack, although I guess internal implementation can be done as dynamic = strategy based on contextual parameters. > > Suggested annotation is a way to attach a per-entity piece of configurati= on that can be used by the sorter. Due to the nature of the annotations it = will also have a stack lifetime scope. > > Andrus > > > On Mar 25, 2011, at 1:03 AM, Aristedes Maniatis wrote: > >> How pluggable is the sorter? Could a user specify a different sorter for= one particular commit? Or for a whole context? Or chain the sorters so tha= t Ashwood is used first and then another sorter is used to adjust the resul= ts under particular circumstances? >> >> >> Ari >> >> On 25/03/11 5:00 AM, Andrus Adamchik wrote: >>> Here is an algorithm analysis task for graph-theory-minded folks. I cam= e up with the @SortWeight solution below for a very specific problem when c= ommit operation ordering can not be derived from the cross-entity relations= hips in the DataMap. Now I wondering how many other cases raised on this li= st that are not addressed by the default AshwoodEntitySorter can be solved = by manually overriding entities ordering "weight"? >>> >>> Andrus >>> >>> >>> On Mar 24, 2011, at 4:50 PM, Andrus Adamchik (JIRA) wrote: >>> >>>> cayenne-lifecycle: @SortWeight annotation >>>> ------------------------------------------ >>>> >>>> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0Key: CAY-1553 >>>> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0URL: https://issues.apache.org/jira/bro= wse/CAY-1553 >>>> =A0 =A0 =A0 =A0 =A0 =A0Project: Cayenne >>>> =A0 =A0 =A0 =A0 Issue Type: Task >>>> =A0 =A0 =A0 =A0 Components: Lifecycle Extensions >>>> =A0 Affects Versions: 3.1M2 >>>> =A0 =A0 =A0 =A0 =A0 Reporter: Andrus Adamchik >>>> =A0 =A0 =A0 =A0 =A0 Assignee: Andrus Adamchik >>>> >>>> >>>> Sometimes it is useful to manually override the operation ordering for= some entities. E.g. per CAY-1547 we support UuidRelationships, but saving = an object with a UuidRelationship to another object does not generate corre= ct ordering. So we may want to override default ordering for entities annot= ated with @UuidRelationship. E.g.: >>>> >>>> @SortWeight(1.1) >>>> @UuidRelationship("UUID") >>>> class My extends _My {} >>>> >>>> Note that this approach will not be able to address all shortcomings o= f a generic AshwoodEntitySorter. It is somewhat of a hack. So it will be pl= aced in cayenne-lifecycle and treated as an "extension". >>>> >>>> -- >>>> This message is automatically generated by JIRA. >>>> For more information on JIRA, see: http://www.atlassian.com/software/j= ira >>>> >>> >> >> -- >> --------------------------> >> Aristedes Maniatis >> GPG fingerprint CBFB 84B4 738D 4E87 5E5C =A05EFA EF6A 7D2E 3E49 102A >> > >