My csv contains primary key and I want to retain this after uploading
to datastore; I used approach suggested in:
http://code.google.com/appengine/docs/python/tools/uploadingdata.html

However, when i try to retrieve the uploaded entities, i get

Uncaught exception from servlet
The primary key for model.Stock is an unencoded string but the key of
the corresponding entity in the datastore does not have a name.  You
may want to either change the primary key to be an encoded string (add
the "gae.encoded-pk" extension), change the primary key to be of type
com.google.appengine.api.datastore.Key, or, if you're certain that
this class will never have a parent, change the primary key to be of
type Long.
org.datanucleus.store.appengine.FatalNucleusUserException: The primary
key for model.DiagnosisGroup4 is an unencoded string but the key of
the corresponding entity in the datastore does not have a name.  You
may want to either change the primary key to be an encoded string (add
the "gae.encoded-pk" extension), change the primary key to be of type
com.google.appengine.api.datastore.Key, or, if you're certain that
this class will never have a parent, change the primary key to be of
type Long.

My transformer code snippet is:
transformers:

- kind: Stock
  connector: csv

  property_map:

    - property: stockId
      external_name: STOCK_ID

    - property: stockName
      external_name: STOCK_NAME

    - property: desc
      external_name: DESC

My CSV file looks like
STOCK_ID,STOCK_NAME,DESC
001,Test company, test desc
002,Alpha company, test desc
003,Beta company, test desc

Corresponding class looks like:

@Entity
public class Stock {
    @Id
    String stockId;

    String stockName;

    String desc;
}

Please suggest how can I solve this problem.

Thank you

-- 
You received this message because you are subscribed to the Google Groups 
"Google App Engine" 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?hl=en.

Reply via email to