You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cayenne.apache.org by "Andrey Razumovsky (JIRA)" <ji...@apache.org> on 2009/08/18 13:58:14 UTC

[jira] Closed: (CAY-1261) Auto-inject values in NEW objects with declared qualifiers

     [ https://issues.apache.org/jira/browse/CAY-1261?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Andrey Razumovsky closed CAY-1261.
----------------------------------

    Resolution: Fixed

Finished; any advanced inject abilities will go through separate JIRAs. The most common case, ASTObjPath=ASTScalar [ AND ASTObjPath=ASTScalar]* is covered

> Auto-inject values in NEW objects with declared qualifiers
> ----------------------------------------------------------
>
>                 Key: CAY-1261
>                 URL: https://issues.apache.org/jira/browse/CAY-1261
>             Project: Cayenne
>          Issue Type: Improvement
>          Components: Cayenne Core Library
>    Affects Versions: 3.0M6
>            Reporter: Andrey Razumovsky
>            Assignee: Andrey Razumovsky
>             Fix For: 3.0 beta 1
>
>
> Auto-inject values in NEW objects with declared qualifiers. 
> E.g. if entity Employee has a qualifier personType="EE" then context.newObject(Employee.class).getPersonType() should be "EE"
> At first step I plan to inject only AND expressions and those Equal, where one operand is a path (Db or Obj) and other is scalar

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


Re: [jira] Closed: (CAY-1261) Auto-inject values in NEW objects with declared qualifiers

Posted by Andrus Adamchik <an...@objectstyle.org>.
True... The implementation of the client callbacks would require  
considering various scenarios. At the minimum we will need a way to  
specify callbacks/listeners separately on the client and the server  
(e.g. it probably wouldn't make sense to init the same default values  
in pre-persist first on the client, and later on the server; or if the  
server does some audit recordings on commit, the same processing is  
meaningless on the client). Another elephant in the room is callbacks  
in locally nested contexts... So some food for thought.

Andrus


On Aug 18, 2009, at 3:41 PM, Andrey Razumovsky wrote:

> I think we sould first then do something with lifecycles on ROP  
> client..
> There are none yet, and e.g. injection works on client
>
> 2009/8/18 Andrus Adamchik <an...@objectstyle.org>
>
>> BTW, wonder if we could introduce our own internal lifecycle  
>> listeners for
>> processing of objects similar to this case (a pre-persist listener on
>> CayenneDataObject). Seems like a rather flexible approach. Just an  
>> idea
>> anyways...
>>
>> Andrus
>>
>>
>>
>> On Aug 18, 2009, at 3:28 PM, Andrus Adamchik wrote:
>>
>>
>>> On Aug 18, 2009, at 3:20 PM, Aristedes Maniatis wrote:
>>>
>>> This is a very interesting feature.
>>>>
>>>
>>> Yeah, big +1 from me as well. It was one of the top items on my  
>>> list of
>>> things I want to see in Cayenne. Kudos to Andrey for making it a  
>>> reality.
>>>
>>> Andrus
>>>
>>>
>>>
>>


Re: [jira] Closed: (CAY-1261) Auto-inject values in NEW objects with declared qualifiers

Posted by Andrey Razumovsky <ra...@gmail.com>.
I think we sould first then do something with lifecycles on ROP client..
There are none yet, and e.g. injection works on client

2009/8/18 Andrus Adamchik <an...@objectstyle.org>

> BTW, wonder if we could introduce our own internal lifecycle listeners for
> processing of objects similar to this case (a pre-persist listener on
> CayenneDataObject). Seems like a rather flexible approach. Just an idea
> anyways...
>
> Andrus
>
>
>
> On Aug 18, 2009, at 3:28 PM, Andrus Adamchik wrote:
>
>
>> On Aug 18, 2009, at 3:20 PM, Aristedes Maniatis wrote:
>>
>>  This is a very interesting feature.
>>>
>>
>> Yeah, big +1 from me as well. It was one of the top items on my list of
>> things I want to see in Cayenne. Kudos to Andrey for making it a reality.
>>
>> Andrus
>>
>>
>>
>

Re: [jira] Closed: (CAY-1261) Auto-inject values in NEW objects with declared qualifiers

Posted by Andrus Adamchik <an...@objectstyle.org>.
BTW, wonder if we could introduce our own internal lifecycle listeners  
for processing of objects similar to this case (a pre-persist listener  
on CayenneDataObject). Seems like a rather flexible approach. Just an  
idea anyways...

Andrus


On Aug 18, 2009, at 3:28 PM, Andrus Adamchik wrote:

>
> On Aug 18, 2009, at 3:20 PM, Aristedes Maniatis wrote:
>
>> This is a very interesting feature.
>
> Yeah, big +1 from me as well. It was one of the top items on my list  
> of things I want to see in Cayenne. Kudos to Andrey for making it a  
> reality.
>
> Andrus
>
>


Re: [jira] Closed: (CAY-1261) Auto-inject values in NEW objects with declared qualifiers

Posted by Andrus Adamchik <an...@objectstyle.org>.
On Aug 18, 2009, at 3:20 PM, Aristedes Maniatis wrote:

> This is a very interesting feature.

Yeah, big +1 from me as well. It was one of the top items on my list  
of things I want to see in Cayenne. Kudos to Andrey for making it a  
reality.

Andrus


Re: [jira] Closed: (CAY-1261) Auto-inject values in NEW objects with declared qualifiers

Posted by Andrey Razumovsky <ra...@gmail.com>.
But yes, injections will be enabled if you use qualifiers like
isDeleted=false, then the value will be injected when creating an object

2009/8/18 Andrey Razumovsky <ra...@gmail.com>

> Hi Ari,
>
> I can't think of the situation when the feature should be disabled. I think
> it just spares time and lines of code when working with entities with
> qualifiers. Initial values will be injected only if that is trivial (in
> fact, only equality expressions - otherwise Cayenne just cannot decide what
> to inject).
> For "isDeleted" case I intentionally implemented CAY-1235 and CAY-1236 and
> use them in pair, more at [1]. I agree this should be mentioned in docs,
> though.
>
> And once again, currently the feature is quite trivial, e.g. it does not
> support db paths, chained paths and so on.. If needed, we can discuss an
> improvement
>
> [1] http://cayenne.apache.org/doc/custom-batchquerybuilder-factory.html
>
> 2009/8/18 Aristedes Maniatis <ar...@maniatis.org>
>
> On 18/08/09 9:58 PM, Andrey Razumovsky (JIRA) wrote:
>>
>>> Andrey Razumovsky closed CAY-1261.
>>> ----------------------------------
>>>
>>>     Resolution: Fixed
>>>
>>> Finished; any advanced inject abilities will go through separate JIRAs.
>>> The most common case, ASTObjPath=ASTScalar [ AND ASTObjPath=ASTScalar]* is
>>> covered
>>>
>>
>>
>> Hi Andrey
>>
>> This is a very interesting feature, and I think that before you close the
>> task we need some documentation on the web site for it. Is there a way to
>> enable or disable this feature? Is it designed to work in the vertical
>> inheritance situation as well as the common isDeleted use-case?
>>
>> Ari Maniatis
>>
>>
>>
>> -------------------------->
>> Aristedes Maniatis
>> GPG fingerprint CBFB 84B4 738D 4E87 5E5C  5EFA EF6A 7D2E 3E49 102A
>>
>
>

Re: [jira] Closed: (CAY-1261) Auto-inject values in NEW objects with declared qualifiers

Posted by Andrey Razumovsky <ra...@gmail.com>.
Hi Ari,

I can't think of the situation when the feature should be disabled. I think
it just spares time and lines of code when working with entities with
qualifiers. Initial values will be injected only if that is trivial (in
fact, only equality expressions - otherwise Cayenne just cannot decide what
to inject).
For "isDeleted" case I intentionally implemented CAY-1235 and CAY-1236 and
use them in pair, more at [1]. I agree this should be mentioned in docs,
though.

And once again, currently the feature is quite trivial, e.g. it does not
support db paths, chained paths and so on.. If needed, we can discuss an
improvement

[1] http://cayenne.apache.org/doc/custom-batchquerybuilder-factory.html

2009/8/18 Aristedes Maniatis <ar...@maniatis.org>

> On 18/08/09 9:58 PM, Andrey Razumovsky (JIRA) wrote:
>
>> Andrey Razumovsky closed CAY-1261.
>> ----------------------------------
>>
>>     Resolution: Fixed
>>
>> Finished; any advanced inject abilities will go through separate JIRAs.
>> The most common case, ASTObjPath=ASTScalar [ AND ASTObjPath=ASTScalar]* is
>> covered
>>
>
>
> Hi Andrey
>
> This is a very interesting feature, and I think that before you close the
> task we need some documentation on the web site for it. Is there a way to
> enable or disable this feature? Is it designed to work in the vertical
> inheritance situation as well as the common isDeleted use-case?
>
> Ari Maniatis
>
>
>
> -------------------------->
> Aristedes Maniatis
> GPG fingerprint CBFB 84B4 738D 4E87 5E5C  5EFA EF6A 7D2E 3E49 102A
>

Re: [jira] Closed: (CAY-1261) Auto-inject values in NEW objects with declared qualifiers

Posted by Aristedes Maniatis <ar...@maniatis.org>.
On 18/08/09 9:58 PM, Andrey Razumovsky (JIRA) wrote:
> Andrey Razumovsky closed CAY-1261.
> ----------------------------------
>
>      Resolution: Fixed
>
> Finished; any advanced inject abilities will go through separate JIRAs. The most common case, ASTObjPath=ASTScalar [ AND ASTObjPath=ASTScalar]* is covered


Hi Andrey

This is a very interesting feature, and I think that before you close the task we need some documentation on the web site for it. Is there a way to enable or disable this feature? Is it designed to work in the vertical inheritance situation as well as the common isDeleted use-case?

Ari Maniatis



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