Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Okay since no one answered this I will answer it my self. What I did was fairly easy once I setup the data properly in the JSON object by naming index name the same as th column name . I was able to add a mixture of customer table objects and address table objects. Once you call up the URI groovy script you can easily save to each table with minimal effort. Here is the JSON object setup in the Android Activity in the OnClick method when hitting save button:</p> <pre><code>public void onClick(View v) { ....... JSONObject cust = new JSONObject(); try { cust.put("customersFirstname", customer.getCustomers_firstname()); cust.put("customersMname", customer.getCustomers_mname()); cust.put("customersLastname", customer.getCustomers_lastname()); cust.put("customersEmailAddress", customer.getCustomers_email_address()); cust.put("customersTelephone", customer.getCustomers_telephone()); cust.put("customersUsername", customer.getCustomers_username()); cust.put("customersPassword", customer.getCustomers_password()); cust.put("customersNewsletter", 0); cust.put("entryFirstname", customer.getCustomers_firstname()); cust.put("entryLastname", customer.getCustomers_lastname()); cust.put("entryStreetAddress", address.getEntryStreetAddress()); cust.put("entryStreetAddress2", address.getEntryStreetAddress2()); cust.put("entryCity", address.getEntryCity()); cust.put("entryState", address.getEntryState()); cust.put("entryPostcode", address.getEntryPostcode()); cust.put("entryCountryId", address.getEntryCountryId()); cust.put("entryZoneId", address.getEntryCountryId()); PostJson.sendJSON("URL/webservices", cust); ......... } </code></pre> <p>Then on the Groovy side for my webservices all I do to save the Customer info for the table is:</p> <pre><code>def input = request.JSON def instance = new Customers(input) instance.save() </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload