Examples of Good


Examples of com.denisk.appengine.nl.server.data.Good

  }

  public ArrayList<Good> goodsFromEntities(Iterable<Entity> goodEntities) {
    ArrayList<Good> goods = new ArrayList<Good>();
    for(Entity goodEntity: goodEntities){
      Good good = new Good();
      setCommonJsonableProperties(goodEntity, good);
      //set parent
      good.setParentKeyStr(KeyFactory.keyToString(goodEntity.getParent()));
      goods.add(good);
    }
   
    return goods;
  }
View Full Code Here

Examples of com.denisk.appengine.nl.server.data.Good

  private Iterable<Entity> getAllGoodEntities(){
    return ds.prepare(new Query(Good.KIND)).asIterable();
  }
 
  public Key persistGood(String goodJson) {
    Good fromJson = new Good().getFromJson(goodJson);
    Key categoryKey = KeyFactory.stringToKey(fromJson.getParentKeyStr());
    return doPersistGood(ds, categoryKey, fromJson);
  }
View Full Code Here

Examples of com.denisk.appengine.nl.server.data.Good

    Category c = new Category();
    c.setName("hello");
    c.setDescription(new Text("desc"));

    Good g1 = new Good();
    Good g2 = new Good();

    g1.setName("g1_name");
    g2.setName("g2_name");

    g1.setName("g1_desc");
    g2.setDescription(new Text("g2_desc"));

    c.getGoods().add(g1);
    c.getGoods().add(g2);

    assertEquals(
View Full Code Here

Examples of com.denisk.appengine.nl.server.data.Good

    Category c1 = new Category();
    c1.setName("another");
    c1.setDescription(new Text("desc"));

    Good g1 = new Good();
    Good g2 = new Good();

    g1.setName("g1_name");
    g2.setName("g2_name");

    g1.setName("g1_desc");
    g2.setDescription(new Text("g2_desc"));

    c.getGoods().add(g1);
    c.getGoods().add(g2);

    dh.saveCategoryWithGoods(c);
View Full Code Here

Examples of com.denisk.appengine.nl.server.data.Good

    Category c1 = new Category();
    c1.setName("another");
    c1.setDescription(new Text("desc"));

    Good g1 = new Good();
    Good g2 = new Good();

    g1.setName("g1_name");
    g2.setName("g2_name");

    g1.setDescription(new Text("g1_desc"));
    g2.setDescription(new Text("g2_desc"));

    c.getGoods().add(g1);
    c.getGoods().add(g2);

    dh.saveCategoryWithGoods(c);
View Full Code Here

Examples of com.denisk.appengine.nl.server.data.Good

    Category c1 = new Category();
    c1.setName("another");
    c1.setDescription(new Text("desc"));

    Good g1 = new Good();
    Good g2 = new Good();
    Good g3 = new Good();

    g1.setName("g1_name");
    g2.setName("g2_name");
    g3.setName("g3_name");

    g1.setDescription(new Text("g1_desc"));
    g2.setDescription(new Text("g2_desc"));
    g3.setDescription(new Text("g3_desc"));

    c.getGoods().add(g1);
    c.getGoods().add(g2);

    c1.getGoods().add(g3);
View Full Code Here

Examples of com.denisk.appengine.nl.server.data.Good

    Category c1 = new Category();
    c1.setName("another");
    c1.setDescription(new Text("desc"));

    Good g1 = new Good();
    Good g2 = new Good();
    Good g3 = new Good();

    g1.setName("g1_name");
    g2.setName("g2_name");
    g3.setName("g3_name");

    g1.setDescription(new Text("g1_desc"));
    g2.setDescription(new Text("g2_desc"));
    g3.setDescription(new Text("g3_desc"));

    c.getGoods().add(g1);
    c.getGoods().add(g2);

    c1.getGoods().add(g3);
View Full Code Here

Examples of com.denisk.appengine.nl.server.data.Good

  @Test
  public void persistGood() {
    Category c = new Category();
    Key categoryKey = dh.saveCategoryWithGoods(c);

    Good g = new Good();
    String name = "hello";
    String descr = "descr";
    String imageKey = "otnuotenuh";

    g.setName(name);
    g.setDescription(new Text(descr));
    g.setImageBlobKey(imageKey);
    g.setParentKeyStr(KeyFactory.keyToString(categoryKey));

    dh.persistGood(g.toJson());

    assertEquals(1,
        ds.prepare(new Query(Good.KIND)).countEntities(withLimit(10)));

    List<Entity> list = ds.prepare(new Query(Good.KIND)).asList(
View Full Code Here

Examples of info.walnutstreet.vs.ps03v2.common.Good

        String name = result.getString(2);
        String description = result.getString(3);
        int available = result.getInt(4);
        double price = result.getDouble(5);
       
        Good good = new Good();
        good.setId(id);
        good.setName(name);
        good.setDescription(description);
        good.setAvailable(available);
        good.setPrice(price);
       
        ids.add(good);
      }
    } catch (SQLException e) {
      return null;
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.