javagoogle-app-enginesiena

Is there a way *not* to persist a field with Siena


I use siena with google engine. I have a model class with a field (named secret) that I don't want to be persisted. (I don't want the column to be created in the google datastore)

Something along the lines of

Class person {
   @Id 
   public Long id ; 

   public String name ; 

   @Ignore
   public String secret ;

}

The field secrethas to be public.

Do you have any idea to achieve that ?


Solution

  • You can use Java's transient keyword:

    public transient String secret;
    

    That should stop it from being persisted.