Package com.google.code.morphia

Examples of com.google.code.morphia.Datastore.save()


    public static void crud() throws Exception {
        Datastore ds = getDatastore();
        // create
        PureMorphiaUser user = new PureMorphiaUser("John", "Smith");
        ds.save(user);
        // read
        PureMorphiaUser user2 = ds.get(PureMorphiaUser.class, user.id);
        // update
        user2.fName = "Tom";
        ds.save(user2);
View Full Code Here


        ds.save(user);
        // read
        PureMorphiaUser user2 = ds.get(PureMorphiaUser.class, user.id);
        // update
        user2.fName = "Tom";
        ds.save(user2);
        // delete
        ds.delete(user2);
    }
   
    public static void query() throws Exception {
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.