示例#1
0
  public Product createProduct() {
    ObjexObj newProduct = getInternalContainer().newObject(this, bean, "Product");

    ensureUpdateable(bean);
    List<String> prods = bean.getProducts();
    if (prods == null) prods = new ArrayList<String>();
    prods.add(newProduct.getId().toString());
    bean.setProducts(prods);

    return newProduct.getBehaviour(Product.class);
  }
示例#2
0
  public Category createCategory() {
    ObjexObj newCat = getInternalContainer().newObject(this, bean, "Category");

    ensureUpdateable(bean);
    List<String> cats = bean.getCategories();
    if (cats == null) cats = new ArrayList<String>();
    cats.add(newCat.getId().toString());
    bean.setCategories(cats);

    return newCat.getBehaviour(Category.class);
  }