Thanks Ikai for the explanation.

That makes a lot of sense. But in this case, the entity is seen by the
datastore viewer, and I can see all other columns EXCEPT the
@Serialized column, even though that column has entities with data in
that column.

Let me put this in other words: As long as you have persisted only
entities with the @Serialized field set to something other than null,
then the datastore viewer does not display the @Serialized field even
though all the records have data in that field's column. And then as
soon as you persist an entity that has that @Serialized field set to
null, the datastore viewer begins to show the @Serialized field's
column, in which all the previous records have something like <Blob:
462 bytes> in the the column that was previsously unseen.


On Feb 27, 8:33 pm, "Ikai L (Google)" <[email protected]> wrote:
> 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 <[email protected]> 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 <[email protected]> wrote:
> > > how about defaultFetchGroup = "true" ?
>
> > > On Feb 25, 9:18 pm, Arnold <[email protected]> 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
> > [email protected].
> > To unsubscribe from this group, send email to
> > [email protected]<google-appengine-java%2B 
> > [email protected]>
> > .
> > For more options, visit this group at
> >http://groups.google.com/group/google-appengine-java?hl=en.
>
> --
> Ikai Lan
> Developer Programs Engineer, Google App 
> Enginehttp://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 [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/google-appengine-java?hl=en.

Reply via email to