If you use the RemoteDatastore you have complete control in Java of
what you key is.
http://code.google.com/p/remote-datastore/
e.g. this code puts an entity with the id set in your remote datastore
from your local machine:
RemoteDatastore.install();
RemoteDatastore.divert("http://myVersion.latest.myApp.appspot.com/remote-datastore
", "myApp", "myVersion");
DatastoreService service =
DatastoreServiceFactory.getDatastoreService();
Key key = KeyFactory.createKey("MyKindName, 35);
Entity entity1 = new Entity(key);
entity1.setProperty("property1", "hello");
datastore.put(Arrays.asList(entity1, entity2);
On 30 Jun 2010, at 14:12, MANISH DHIMAN wrote:
Hi All
When I upload data using CSV file on G A E. Primary key is stored
there as a name instead of id.
Example.
Format of .yaml is Given below
transformers:
- kind: City
connector: csv
connector_options:
encoding: utf-8
columns: from_header
property_map:
- property: __key__
external_name: CityId
export_transform: datastore.Key.id
- property: Name
external_name: Name
Primary key stored there is:
ID/Name Name
name=1 Delhi
name=2 London
Due to uploaded data with name=<keyvalue>, when I am try to get Key
from any Fetched Entities, then Key contains only name value but id
value is 0 and also name contains long value as a String instance.
Is it possible to store primary key(Using CSV while uploading data) in
a format given below :
ID/Name Name
id=1 Delhi
id=2 London
When data is stored with id=<keyvalue>, then Key contains id value is
<keyvalue> as long instance.
--
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-java@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
.
--
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.