Hello, 

I'm brand new to coding, and even newer to using Google apps Engine and I'm 
confused about create my database and populating it.

I've gone through the documentation 
(http://code.google.com/appengine/docs/java/datastore/overview.html) and I 
think I get the idea, but when I went to try it out I got very lost.

I am attempting to use Java to create an entity using the sample code:

import java.util.Date;
import com.google.appengine.api.datastore.DatastoreService;
import com.google.appengine.api.datastore.DatastoreServiceFactory;
import com.google.appengine.api.datastore.Entity;

    // ...
    DatastoreService datastore = 
DatastoreServiceFactory.getDatastoreService();

    Entity employee = new Entity("Employee");
    employee.setProperty("firstName", "Antonio");
    employee.setProperty("lastName", "Salieri");
    Date hireDate = new Date();
    employee.setProperty("hireDate", hireDate);
    employee.setProperty("attendedHrTraining", true);

    datastore.put(employee);

It is my understanding I would also need an Employee class.  My questions 
are:

1.  Where should the Employee class live in my project?  (using Eclipse)
2.  Is the above code a new Java class?  Where would that sample code go to 
create said employee?

Thanks for any help, and your understanding while I learn!

-Caleb
 


-- 
You received this message because you are subscribed to the Google Groups 
"Google App Engine" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/google-appengine/-/wus_5fcl4s4J.
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