コード例 #1
0
ファイル: CategoryImpl.java プロジェクト: thegaffer/tal-objex
  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
ファイル: CategoryImpl.java プロジェクト: thegaffer/tal-objex
  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);
  }