public String saveDB() { // Look for columns of type: {foo}_id // For each of those, introspect for 'm{Foo}'. // For each non-null of those, call 'saveDB' on it. // Store the result of that call as '{foo}_id'. if (mSeller != null) { String seller_id = mSeller.saveDB(); if (seller_id != null) set("seller_id", seller_id); } return super.saveDB(); }
protected void setSellerName(String sellerName) { if (sellerName == null || sellerName.length() == 0) return; if (mSeller == null) { mSeller = Seller.makeSeller(sellerName.trim()); } else { mSeller = mSeller.makeSeller(sellerName, mSeller); } Integer seller_id = mSeller.getId(); if (seller_id == null || seller_id == 0) { String raw_id = mSeller.saveDB(); if (raw_id != null && raw_id.length() != 0) seller_id = Integer.parseInt(raw_id); } setInteger("seller_id", seller_id); }
public void fromXML(XMLElement inXML) { super.fromXML(inXML); if (mSeller != null) mSeller.saveDB(); }