cayenne-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Matt Kerr <mrmattk...@gmail.com>
Subject Re: default value from the modeler ?
Date Wed, 14 Apr 2010 17:06:04 GMT
I think callbacks/listeners is the way to go

I'm assuming you're using 3.x



On Apr 14, 2010, at 8:28, Arnaud Garcia <arnaud@imagemed-87.com> wrote:

> Hello,
> 
> Is it possible to add default values using the modeler ?
> 
> if not, the good way is to overide the setPersistenteState ?
> 
> thanks,
> 
> arnaud
> 
> public class SomeObjEntity extends _SomeObjEntity
> {
>  public void setPersistenceState(int state)
>  {
>    super.setPersistenceState(state);
> 
>    // if the object was just created, set initial values
>    if (state == PersistenceState.NEW)
>    {
>       // Set all initial values here
>    }
>  }
> }

Mime
View raw message