Hi Andrus,

I have just found out the problem. I wa trying to affect a cayenne-mandatory
table field with a calculated value during pre-persist. I think the problem is
that Cayenne mandatory validation is executed before the prepersist, not letting
me affect the field, which starts as null. Do you think validating after
pre-persist could lead to problems? I think it would help pre-persist to be more
useful, allowing us to calculate mandatory fields.

I made it work by removing the Mandatory check on Cayenne Modeler.

Regards
Bruno Santos

-----Mensagem original-----
De: Andrus Adamchik [mailto:[email protected]] 
Enviada: quarta-feira, 20 de Outubro de 2010 08:32
Para: [email protected]
Assunto: Re: OnPrePersist not working

Odd. Should be working. Do you actually see INSERT statement in the logs, but no
callback before that?

Andrus

On Oct 20, 2010, at 4:05 AM, Bruno René Santos wrote:

> Hello All,
> 
> I have created a pre-persist callback to set a property from my pojo. But when
I commit changes the callback is not executed... Any ideas? For instants, the
post-add callback works great.
> 
> Thank you
> 
> 


Reply via email to