You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cayenne.apache.org by "Andrus Adamchik (JIRA)" <ji...@apache.org> on 2011/03/24 15:50:06 UTC

[jira] [Created] (CAY-1553) cayenne-lifecycle: @SortWeight annotation

cayenne-lifecycle: @SortWeight annotation 
------------------------------------------

                 Key: CAY-1553
                 URL: https://issues.apache.org/jira/browse/CAY-1553
             Project: Cayenne
          Issue Type: Task
          Components: Lifecycle Extensions
    Affects Versions: 3.1M2
            Reporter: Andrus Adamchik
            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 correct ordering. So we may want to override default ordering for entities annotated 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 of a generic AshwoodEntitySorter. It is somewhat of a hack. So it will be placed 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/jira

Re: @SortWeight annotation

Posted by Michael Gentry <mg...@masslight.net>.
Looks like I was right.  One of my co-workers just IM'ed me about
another "Can't extract a master key." error.  I'm going to start
another thread about Ashwood ...

Thanks,

mrg


On Fri, Jul 22, 2011 at 7:57 AM, Michael Gentry <mg...@masslight.net> wrote:
> Hi Andrus,
>
> The @SortWeight seems to be working, at least in my limited tests.
> I'm concerned that it is too easy to weight it into the wrong place
> and introduce another incompatibility.  It almost seems like an
> @DependsUpon(XYZ.class) would be a better approach.  Then move the
> sort weight of the class that depends upon XYZ to be higher than XYZ.
> Thoughts?
>
> Thanks,
>
> mrg
>
>
> On Wed, Jul 20, 2011 at 9:36 AM, Andrus Adamchik <an...@objectstyle.org> wrote:
>> Hi Michael,
>>
>> This is pretty straightforward. Here is an example:
>>
>> // create custom module:
>> class CayenneExtrasModule implements Module {
>>
>>        @Override
>>        public void configure(Binder binder) {
>>                binder.bind(EntitySorter.class).to(WeightedAshwoodEntitySorter.class);
>>        }
>> }
>>
>> // use it when creating Cayenne runtime:
>> ServerRuntime runtime = new ServerRuntime("cayenne-xyz.xml", new CayenneExtrasModule());
>>
>>
>> Andrus
>>
>>
>>
>> On Jul 20, 2011, at 4:26 PM, Michael Gentry wrote:
>>
>>> Hi Andrus,
>>>
>>> Since I'm completely new to the DI stuff in 3.1, how do I install the
>>> WeightedAshwoodEntitySorter in the DI container?
>>>
>>> Thanks,
>>>
>>> mrg
>>>
>>>
>>> On Wed, Jul 13, 2011 at 12:19 PM, Andrus Adamchik
>>> <an...@objectstyle.org> wrote:
>>>> @SortWeight may help (unless the cycle is between the objects of the same type). You will need to install WeightedAshwoodEntitySorter in the DI container to take advantage of it.
>>>>
>>>
>>
>>
>

Re: @SortWeight annotation

Posted by Michael Gentry <mg...@masslight.net>.
Hi Andrus,

The @SortWeight seems to be working, at least in my limited tests.
I'm concerned that it is too easy to weight it into the wrong place
and introduce another incompatibility.  It almost seems like an
@DependsUpon(XYZ.class) would be a better approach.  Then move the
sort weight of the class that depends upon XYZ to be higher than XYZ.
Thoughts?

Thanks,

mrg


On Wed, Jul 20, 2011 at 9:36 AM, Andrus Adamchik <an...@objectstyle.org> wrote:
> Hi Michael,
>
> This is pretty straightforward. Here is an example:
>
> // create custom module:
> class CayenneExtrasModule implements Module {
>
>        @Override
>        public void configure(Binder binder) {
>                binder.bind(EntitySorter.class).to(WeightedAshwoodEntitySorter.class);
>        }
> }
>
> // use it when creating Cayenne runtime:
> ServerRuntime runtime = new ServerRuntime("cayenne-xyz.xml", new CayenneExtrasModule());
>
>
> Andrus
>
>
>
> On Jul 20, 2011, at 4:26 PM, Michael Gentry wrote:
>
>> Hi Andrus,
>>
>> Since I'm completely new to the DI stuff in 3.1, how do I install the
>> WeightedAshwoodEntitySorter in the DI container?
>>
>> Thanks,
>>
>> mrg
>>
>>
>> On Wed, Jul 13, 2011 at 12:19 PM, Andrus Adamchik
>> <an...@objectstyle.org> wrote:
>>> @SortWeight may help (unless the cycle is between the objects of the same type). You will need to install WeightedAshwoodEntitySorter in the DI container to take advantage of it.
>>>
>>
>
>

Re: @SortWeight annotation

Posted by Andrus Adamchik <an...@objectstyle.org>.
Hi Michael,

This is pretty straightforward. Here is an example:

// create custom module:
class CayenneExtrasModule implements Module {

	@Override
	public void configure(Binder binder) {
		binder.bind(EntitySorter.class).to(WeightedAshwoodEntitySorter.class);
	}
}

// use it when creating Cayenne runtime:
ServerRuntime runtime = new ServerRuntime("cayenne-xyz.xml", new CayenneExtrasModule());


Andrus



On Jul 20, 2011, at 4:26 PM, Michael Gentry wrote:

> Hi Andrus,
> 
> Since I'm completely new to the DI stuff in 3.1, how do I install the
> WeightedAshwoodEntitySorter in the DI container?
> 
> Thanks,
> 
> mrg
> 
> 
> On Wed, Jul 13, 2011 at 12:19 PM, Andrus Adamchik
> <an...@objectstyle.org> wrote:
>> @SortWeight may help (unless the cycle is between the objects of the same type). You will need to install WeightedAshwoodEntitySorter in the DI container to take advantage of it.
>> 
> 


Re: @SortWeight annotation

Posted by Michael Gentry <mg...@masslight.net>.
Hi Andrus,

Since I'm completely new to the DI stuff in 3.1, how do I install the
WeightedAshwoodEntitySorter in the DI container?

Thanks,

mrg


On Wed, Jul 13, 2011 at 12:19 PM, Andrus Adamchik
<an...@objectstyle.org> wrote:
> @SortWeight may help (unless the cycle is between the objects of the same type). You will need to install WeightedAshwoodEntitySorter in the DI container to take advantage of it.
>

Re: @SortWeight annotation

Posted by Michael Gentry <mg...@masslight.net>.
Well, right now we are on 3.0.2, but I might play with 3.1 and try it
out soon.  My first order of business is to try to create a smaller
debuggable test case (that I can reproduce -- the graph issues have
not been easily reproducible).

On inserts we sometimes get:

Can't extract a master key. Missing key (cem_ID), master ID
(<ObjectId:Manufacturer, TEMP:0000CFC6F638DD35>)

On deletes we sometimes get the cycles found exception.

I think part of the problem is using auto-generated keys in MySQL (at
least on insert), but I have more exploring to do.

Thanks,

mrg


On Wed, Jul 13, 2011 at 12:19 PM, Andrus Adamchik
<an...@objectstyle.org> wrote:
> I am not that well familiar with the AshwoodEntitySorter code, but I guess we'll need to look at the specific mapping and objects participating in commit to see what condition triggers it and to take further action.
>
> @SortWeight may help (unless the cycle is between the objects of the same type). You will need to install WeightedAshwoodEntitySorter in the DI container to take advantage of it.
>
> Andrus
>
> On Jul 13, 2011, at 4:30 PM, Michael Gentry wrote:
>
>> 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 <an...@objectstyle.org> wrote:
>>> You can already override the sorter via DI (and create a chain yourself, decorated as EntitySorter interface). The sorter has the same scope as Cayenne 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 configuration 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 that Ashwood is used first and then another sorter is used to adjust the results 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 came up with the @SortWeight solution below for a very specific problem when commit operation ordering can not be derived from the cross-entity relationships in the DataMap. Now I wondering how many other cases raised on this list 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
>>>>>> ------------------------------------------
>>>>>>
>>>>>>               Key: CAY-1553
>>>>>>               URL: https://issues.apache.org/jira/browse/CAY-1553
>>>>>>           Project: Cayenne
>>>>>>        Issue Type: Task
>>>>>>        Components: Lifecycle Extensions
>>>>>>  Affects Versions: 3.1M2
>>>>>>          Reporter: Andrus Adamchik
>>>>>>          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 correct ordering. So we may want to override default ordering for entities annotated 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 of a generic AshwoodEntitySorter. It is somewhat of a hack. So it will be placed 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/jira
>>>>>>
>>>>>
>>>>
>>>> --
>>>> -------------------------->
>>>> Aristedes Maniatis
>>>> GPG fingerprint CBFB 84B4 738D 4E87 5E5C  5EFA EF6A 7D2E 3E49 102A
>>>>
>>>
>>>
>>
>
>

Re: @SortWeight annotation

Posted by Andrus Adamchik <an...@objectstyle.org>.
I am not that well familiar with the AshwoodEntitySorter code, but I guess we'll need to look at the specific mapping and objects participating in commit to see what condition triggers it and to take further action.

@SortWeight may help (unless the cycle is between the objects of the same type). You will need to install WeightedAshwoodEntitySorter in the DI container to take advantage of it.

Andrus

On Jul 13, 2011, at 4:30 PM, Michael Gentry wrote:

> 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 <an...@objectstyle.org> wrote:
>> You can already override the sorter via DI (and create a chain yourself, decorated as EntitySorter interface). The sorter has the same scope as Cayenne 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 configuration 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 that Ashwood is used first and then another sorter is used to adjust the results 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 came up with the @SortWeight solution below for a very specific problem when commit operation ordering can not be derived from the cross-entity relationships in the DataMap. Now I wondering how many other cases raised on this list 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
>>>>> ------------------------------------------
>>>>> 
>>>>>               Key: CAY-1553
>>>>>               URL: https://issues.apache.org/jira/browse/CAY-1553
>>>>>           Project: Cayenne
>>>>>        Issue Type: Task
>>>>>        Components: Lifecycle Extensions
>>>>>  Affects Versions: 3.1M2
>>>>>          Reporter: Andrus Adamchik
>>>>>          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 correct ordering. So we may want to override default ordering for entities annotated 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 of a generic AshwoodEntitySorter. It is somewhat of a hack. So it will be placed 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/jira
>>>>> 
>>>> 
>>> 
>>> --
>>> -------------------------->
>>> Aristedes Maniatis
>>> GPG fingerprint CBFB 84B4 738D 4E87 5E5C  5EFA EF6A 7D2E 3E49 102A
>>> 
>> 
>> 
> 


Re: @SortWeight annotation

Posted by Michael Gentry <mg...@masslight.net>.
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 <an...@objectstyle.org> wrote:
> You can already override the sorter via DI (and create a chain yourself, decorated as EntitySorter interface). The sorter has the same scope as Cayenne 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 configuration 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 that Ashwood is used first and then another sorter is used to adjust the results 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 came up with the @SortWeight solution below for a very specific problem when commit operation ordering can not be derived from the cross-entity relationships in the DataMap. Now I wondering how many other cases raised on this list 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
>>>> ------------------------------------------
>>>>
>>>>                Key: CAY-1553
>>>>                URL: https://issues.apache.org/jira/browse/CAY-1553
>>>>            Project: Cayenne
>>>>         Issue Type: Task
>>>>         Components: Lifecycle Extensions
>>>>   Affects Versions: 3.1M2
>>>>           Reporter: Andrus Adamchik
>>>>           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 correct ordering. So we may want to override default ordering for entities annotated 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 of a generic AshwoodEntitySorter. It is somewhat of a hack. So it will be placed 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/jira
>>>>
>>>
>>
>> --
>> -------------------------->
>> Aristedes Maniatis
>> GPG fingerprint CBFB 84B4 738D 4E87 5E5C  5EFA EF6A 7D2E 3E49 102A
>>
>
>

Re: @SortWeight annotation

Posted by Andrus Adamchik <an...@objectstyle.org>.
You can already override the sorter via DI (and create a chain yourself, decorated as EntitySorter interface). The sorter has the same scope as Cayenne 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 configuration 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 that Ashwood is used first and then another sorter is used to adjust the results 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 came up with the @SortWeight solution below for a very specific problem when commit operation ordering can not be derived from the cross-entity relationships in the DataMap. Now I wondering how many other cases raised on this list 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
>>> ------------------------------------------
>>> 
>>>                Key: CAY-1553
>>>                URL: https://issues.apache.org/jira/browse/CAY-1553
>>>            Project: Cayenne
>>>         Issue Type: Task
>>>         Components: Lifecycle Extensions
>>>   Affects Versions: 3.1M2
>>>           Reporter: Andrus Adamchik
>>>           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 correct ordering. So we may want to override default ordering for entities annotated 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 of a generic AshwoodEntitySorter. It is somewhat of a hack. So it will be placed 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/jira
>>> 
>> 
> 
> -- 
> -------------------------->
> Aristedes Maniatis
> GPG fingerprint CBFB 84B4 738D 4E87 5E5C  5EFA EF6A 7D2E 3E49 102A
> 


Re: @SortWeight annotation

Posted by Aristedes Maniatis <ar...@maniatis.org>.
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 that Ashwood is used first and then another sorter is used to adjust the results 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 came up with the @SortWeight solution below for a very specific problem when commit operation ordering can not be derived from the cross-entity relationships in the DataMap. Now I wondering how many other cases raised on this list 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
>> ------------------------------------------
>>
>>                 Key: CAY-1553
>>                 URL: https://issues.apache.org/jira/browse/CAY-1553
>>             Project: Cayenne
>>          Issue Type: Task
>>          Components: Lifecycle Extensions
>>    Affects Versions: 3.1M2
>>            Reporter: Andrus Adamchik
>>            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 correct ordering. So we may want to override default ordering for entities annotated 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 of a generic AshwoodEntitySorter. It is somewhat of a hack. So it will be placed 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/jira
>>
>

-- 
-------------------------->
Aristedes Maniatis
GPG fingerprint CBFB 84B4 738D 4E87 5E5C  5EFA EF6A 7D2E 3E49 102A

@SortWeight annotation

Posted by Andrus Adamchik <an...@objectstyle.org>.
Here is an algorithm analysis task for graph-theory-minded folks. I came up with the @SortWeight solution below for a very specific problem when commit operation ordering can not be derived from the cross-entity relationships in the DataMap. Now I wondering how many other cases raised on this list 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 
> ------------------------------------------
> 
>                Key: CAY-1553
>                URL: https://issues.apache.org/jira/browse/CAY-1553
>            Project: Cayenne
>         Issue Type: Task
>         Components: Lifecycle Extensions
>   Affects Versions: 3.1M2
>           Reporter: Andrus Adamchik
>           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 correct ordering. So we may want to override default ordering for entities annotated 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 of a generic AshwoodEntitySorter. It is somewhat of a hack. So it will be placed 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/jira
> 


[jira] [Updated] (CAY-1553) cayenne-lifecycle: @SortWeight annotation

Posted by "Andrus Adamchik (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/CAY-1553?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Andrus Adamchik updated CAY-1553:
---------------------------------

    Description: 
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 correct ordering. So we may want to override default ordering for entities annotated with @UuidRelationship. E.g.:

@SortWeight(35)
@UuidRelationship("UUID")
class My extends _My {}

Note that this approach will not be able to address all shortcomings of a generic AshwoodEntitySorter. It is somewhat of a hack. So it will be placed in cayenne-lifecycle and treated as an "extension".

  was:
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 correct ordering. So we may want to override default ordering for entities annotated 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 of a generic AshwoodEntitySorter. It is somewhat of a hack. So it will be placed in cayenne-lifecycle and treated as an "extension".


> cayenne-lifecycle: @SortWeight annotation 
> ------------------------------------------
>
>                 Key: CAY-1553
>                 URL: https://issues.apache.org/jira/browse/CAY-1553
>             Project: Cayenne
>          Issue Type: Task
>          Components: Lifecycle Extensions
>    Affects Versions: 3.1M2
>            Reporter: Andrus Adamchik
>            Assignee: Andrus Adamchik
>             Fix For: 3.1M3
>
>
> 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 correct ordering. So we may want to override default ordering for entities annotated with @UuidRelationship. E.g.:
> @SortWeight(35)
> @UuidRelationship("UUID")
> class My extends _My {}
> Note that this approach will not be able to address all shortcomings of a generic AshwoodEntitySorter. It is somewhat of a hack. So it will be placed 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/jira

[jira] [Closed] (CAY-1553) cayenne-lifecycle: @SortWeight annotation

Posted by "Andrus Adamchik (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/CAY-1553?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Andrus Adamchik closed CAY-1553.
--------------------------------

       Resolution: Fixed
    Fix Version/s: 3.1M3

> cayenne-lifecycle: @SortWeight annotation 
> ------------------------------------------
>
>                 Key: CAY-1553
>                 URL: https://issues.apache.org/jira/browse/CAY-1553
>             Project: Cayenne
>          Issue Type: Task
>          Components: Lifecycle Extensions
>    Affects Versions: 3.1M2
>            Reporter: Andrus Adamchik
>            Assignee: Andrus Adamchik
>             Fix For: 3.1M3
>
>
> 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 correct ordering. So we may want to override default ordering for entities annotated with @UuidRelationship. E.g.:
> @SortWeight(35)
> @UuidRelationship("UUID")
> class My extends _My {}
> Note that this approach will not be able to address all shortcomings of a generic AshwoodEntitySorter. It is somewhat of a hack. So it will be placed 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/jira