The datastore is schema-less, but the datastore requires a "schema" - this
is done by scanning the local datastore and trying to determine the schema
from the saved entities. This behavior seems to make sense to me, as we
generate the view from the actual data itself and not from the class
definitions. For instance, if you define an entity Profile, before you
actually persist a Profile instance, the datastore viewer won't even be
aware that Profile entities exist.

On Fri, Feb 26, 2010 at 11:29 PM, Arnold <arnold.mi...@gmail.com> wrote:

> Thanks Max, that solves it.
>
> The datastore viewer in development console kind of misled me to think
> the field is not persisted at all. I have noticed that after adding
> records with the serialized field set, the serialized field column is
> not shown in the datastore viewer. But, as soon as I add one record
> with the serialized field == null, the column is shown in the
> datastore viewer.
>
> Could this be a bug or there is something more that I am missing?
>
>
> On Feb 26, 12:28 pm, Max <thebb...@gmail.com> wrote:
> > how about defaultFetchGroup = "true" ?
> >
> > On Feb 25, 9:18 pm, Arnold <arnold.mi...@gmail.com> wrote:
> >
> >
> >
> > > Two classes are defined:
> > > ----------------------------------
> > > @PersistenceCapable(identityType=IdentityType.DATASTORE,
> > > detachable="true")
> > > public class TestSerialized {
> >
> > >         @Persistent
> > >         private String nonSerialized;
> > >         @PrimaryKey()
> @Persistent(valueStrategy=IdGeneratorStrategy.IDENTITY)
> > >         private Key primaryKey;
> >
> > >         @Persistent @Serialized
> > >         private SerializedObj serializedObj;
> >
> > > }
> >
> > > public class SerializedObj implements Serializable{
> > >         /**
> > >          *
> > >          */
> > >         private static final long serialVersionUID =
> 6258869487732411716L;
> > >         private String value;
> >
> > >         public SerializedObj() {
> > >         }
> > >         public SerializedObj(String value) {
> > >                 this.value = value;
> > >         }
> >
> > > }
> >
> > > ----------------------------------
> >
> > > When a TestSerialized  is persisted like below, the nonSerialized
> > > field works fine but the serializedObj field is not saved to the
> > > datastore, and looking into the development console, the field/column
> > > is not even created:
> >
> > >                 PersistenceManager pm =
> PMF.get().getPersistenceManager();
> > >                 try{
> > >                         pm.currentTransaction().begin();
> > >                         TestSerialized draft = new TestSerialized();
> > >                         draft.setSerializedObj(new
> SerializedObj("dd"));
> > >                         pm.makePersistent(draft);
> > >                         pm.currentTransaction().commit();
> > >                 }finally{
> > >                         if(pm.currentTransaction().isActive()){
> > >                                 pm.currentTransaction().rollback();
> > >                         }
> > >                         pm.close();
> > >                 }
> >
> > > @Persistent(serialized="true") didn't help either.
> >
> > > Am I missing something?
> >
> > > I am using SDK 1.3.1 .
> >
> > > Thanks.
>
> --
> You received this message because you are subscribed to the Google Groups
> "Google App Engine for Java" group.
> To post to this group, send email to
> google-appengine-j...@googlegroups.com.
> To unsubscribe from this group, send email to
> google-appengine-java+unsubscr...@googlegroups.com<google-appengine-java%2bunsubscr...@googlegroups.com>
> .
> For more options, visit this group at
> http://groups.google.com/group/google-appengine-java?hl=en.
>
>


-- 
Ikai Lan
Developer Programs Engineer, Google App Engine
http://googleappengine.blogspot.com | http://twitter.com/app_engine

-- 
You received this message because you are subscribed to the Google Groups 
"Google App Engine for Java" group.
To post to this group, send email to google-appengine-j...@googlegroups.com.
To unsubscribe from this group, send email to 
google-appengine-java+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-appengine-java?hl=en.

Reply via email to