Re: Validation and @PrePersist

2017-05-04 Thread Musall, Maik
;>>> scope though. Perhaps past 4.0 we'll come up with some universal callback >>>> mechanism, free of JPA heritage. >>>> >>>> Andrus >>>> >>>>> On Mar 3, 2017, at 5:13 PM, do...@xsinet.co.za wrote: >>>>>

Re: Validation and @PrePersist

2017-05-04 Thread Nikita Timofeev
A heritage. >>> >>> Andrus >>> >>>> On Mar 3, 2017, at 5:13 PM, do...@xsinet.co.za wrote: >>>> >>>> Created JIRA CAY-2254 >>>> >>>> >>>> -Original Message- >>>> From: Musall, Maik >&

Re: Validation and @PrePersist

2017-04-06 Thread Nikita Timofeev
gt;> >>> Created JIRA CAY-2254 >>> >>> >>> -Original Message- >>> From: Musall, Maik >>> Sent: Thursday, March 2, 2017 10:49 AM >>> To: user@cayenne.apache.org >>> Subject: Re: Validation and @PrePersist >>>

Re: Validation and @PrePersist

2017-04-06 Thread Musall, Maik
Maik >> Sent: Thursday, March 2, 2017 10:49 AM >> To: user@cayenne.apache.org >> Subject: Re: Validation and @PrePersist >> >> Hi Jurgen, >> >>> Am 02.03.2017 um 09:33 schrieb do...@xsinet.co.za: >>> >>> I agree with your reasoning.

Re: Validation and @PrePersist

2017-03-03 Thread Andrus Adamchik
day, March 2, 2017 10:49 AM > To: user@cayenne.apache.org > Subject: Re: Validation and @PrePersist > > Hi Jurgen, > >> Am 02.03.2017 um 09:33 schrieb do...@xsinet.co.za: >> >> I agree with your reasoning. So then the original description of how &g

Re: Validation and @PrePersist

2017-03-03 Thread dollj
Created JIRA CAY-2254 -Original Message- From: Musall, Maik Sent: Thursday, March 2, 2017 10:49 AM To: user@cayenne.apache.org Subject: Re: Validation and @PrePersist Hi Jurgen, > Am 02.03.2017 um 09:33 schrieb do...@xsinet.co.za: > > I agree with your reasoning. So

Re: Validation and @PrePersist

2017-03-02 Thread Musall, Maik
ginal Message- From: Musall, Maik > Sent: Thursday, March 2, 2017 9:53 AM > To: user@cayenne.apache.org > Subject: Re: Validation and @PrePersist > > Hi Jurgen, > > PostAdd is fine for seting a createDate, but what about an updateDate or > something similar? If these a

Re: Validation and @PrePersist

2017-03-02 Thread dollj
less there's backward compatibility issues :-) Jurgen -Original Message- From: Musall, Maik Sent: Thursday, March 2, 2017 9:53 AM To: user@cayenne.apache.org Subject: Re: Validation and @PrePersist Hi Jurgen, PostAdd is fine for seting a createDate, but what about an upda

Re: Validation and @PrePersist

2017-03-01 Thread Musall, Maik
t the commit timestamp. This is where I would > have preferred the behaviour that Hugi is looking for where PrePersist is > called first, before validation. > > Cheers, > Jurgen > > > -Original Message- From: Michael Gentry > Sent: Wednesday, March 1, 2017

Re: Validation and @PrePersist

2017-03-01 Thread dollj
preferred the behaviour that Hugi is looking for where PrePersist is called first, before validation. Cheers, Jurgen -Original Message- From: Michael Gentry Sent: Wednesday, March 1, 2017 5:38 PM To: Cayenne Users Subject: Re: Validation and @PrePersist Hi Hugi, I was indeed look

Re: Validation and @PrePersist

2017-03-01 Thread Michael Gentry
t;> > >>> Hi Hugi > >>> > >>> For this kind of thing use @PostAdd instead. > >>> > >>> Regards > >>> Jurgen > >>> > >>> > >>> -Original Message- From: Hugi Thordarson > >>

Re: Validation and @PrePersist

2017-03-01 Thread Musall, Maik
s, >> - hugi >> >> >>> On 1. mar. 2017, at 13:14, wrote: >>> >>> Hi Hugi >>> >>> For this kind of thing use @PostAdd instead. >>> >>> Regards >>> Jurgen >>> >>> >>> -O

Re: Validation and @PrePersist

2017-03-01 Thread Matt Watson
tead. >> >> Regards >> Jurgen >> >> >> -Original Message- From: Hugi Thordarson >> Sent: Wednesday, March 1, 2017 1:18 PM >> To: user@cayenne.apache.org >> Subject: Validation and @PrePersist >> >> Hi all, >> I have som

Re: Validation and @PrePersist

2017-03-01 Thread Michael Gentry
Hi Hugi, I was indeed looking at < 4. No idea why the change was made. Perhaps someone else can answer that one... Thanks, mrg On Wed, Mar 1, 2017 at 10:03 AM, Hugi Thordarson wrote: > Hi Michael, > the documentation was apparently changed for 4.0 in 2015 to reflect the > current behaviour

Re: Validation and @PrePersist

2017-03-01 Thread Hugi Thordarson
Hi Michael, the documentation was apparently changed for 4.0 in 2015 to reflect the current behaviour: https://github.com/apache/cayenne/commit/5bb12cd36f0d87e3b217cdc20c22a0f6dc9613f3#diff-5b9a57288e30ef9855d80a63a812ec4f Cheers, - hugi > On 1. mar. 2017, at 14:59, Michael Gentry wrote: > >

Re: Validation and @PrePersist

2017-03-01 Thread Michael Gentry
Hi Hugi, If validateForInsert() is being called before PrePersist, we have a disconnect between the documentation and the behavior you are seeing: "PrePersist: right before a new object is committed, inside ObjectContext.commitChanges() and ObjectContext.commitChangesToParent() (and prior to vali

Re: Validation and @PrePersist

2017-03-01 Thread Adam Boyle
M To: user@cayenne.apache.org Subject: Re: Validation and @PrePersist Hi Jurgen, fine suggestion but unfortunately not the part of the lifecycle I need to catch—the action needs to be performed before committing, not after adding (so basically I need @PrePersist—but I need it before validati

Re: Validation and @PrePersist

2017-03-01 Thread Hugi Thordarson
ote: > > Hi Hugi > > For this kind of thing use @PostAdd instead. > > Regards > Jurgen > > > -Original Message- From: Hugi Thordarson > Sent: Wednesday, March 1, 2017 1:18 PM > To: user@cayenne.apache.org > Subject: Validation and @PrePersist > >

Re: Validation and @PrePersist

2017-03-01 Thread dollj
Hi Hugi For this kind of thing use @PostAdd instead. Regards Jurgen -Original Message- From: Hugi Thordarson Sent: Wednesday, March 1, 2017 1:18 PM To: user@cayenne.apache.org Subject: Validation and @PrePersist Hi all, I have some logic in a Listener that uses @PrePersist to

Validation and @PrePersist

2017-03-01 Thread Hugi Thordarson
Hi all, I have some logic in a Listener that uses @PrePersist to populate the value of a required attribute before committing changes. Turns out this doesn’t work, since Cayenne invokes validateForInsert() before running @PrePersist. Any suggestions for where I can invoke logic populates require