Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6473869
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T06:31:04+00:00 2026-05-25T06:31:04+00:00

Still no answer…anyone have something better? Okay complex 2 part question here. I have

  • 0

Still no answer…anyone have something better? Okay complex 2 part question here. I have an Android registration page that gathers information customer name, address, email, phone,… When they click submit I want to send that data to a webservice, that is using Groovy, grails and Hibernate, I am creating. So my First question how do I send that data to my webservice, can some give an example?

Once I send that data on the Webservice, how do I make a complex insert into 2 tables from my Groovy scripts, where customer table has id of address table ? These are legacy tables so the standard domains don’t work since id column name is not the standard “id”. and the relationship is one customer row per address_book row.

Customer table has id, name, email, username, password and address_id
Address table has id, address, city state, zip …

here are my domains for addressbook and customers:

class AddressBook {
String entryStreetAddress
String entryStreetAddress2
String entryPostcode
String entryCity
Integer entryState
Integer entryCountryId

static mapping = {
    id column: "address_book_id"
    version false
}

 }

Heres the legacy customers table notice customerDefaultAddressId is the address_book_id in previous domain:

class Customers {
String customersFirstname
String customersMname
String customersLastname
String customersEmailAddress
Integer customersDefaultAddressId  //address id joins AddressBook to Customers
String customersTelephone
String customersUsername
String customersPassword

static mapping = {
    id column: "customers_id"
    version false
}
}
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-25T06:31:04+00:00Added an answer on May 25, 2026 at 6:31 am

    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:

    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);
    
    .........
    }
    

    Then on the Groovy side for my webservices all I do to save the Customer info for the table is:

    def input = request.JSON
    def instance = new Customers(input)
    instance.save()
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have very simple question but the answer is still not clear. If i
This is probably a stupid question, but I still have no answer. I would
Sounds like a stupid question with an obvious answer :) Still I've ventured to
Please if anyone knows the answer, I´m still looking for 3 days and nothing..
I've been reading the answer to a similar question , but I'm still a
I still am confused regarding Ajax technology. And I still cannot answer this question
I have my own answer to this question, which I'll post, but I wanted
I searched high an low and still cannot find a definite answer. How do
I've always wondered this, and still haven't found the answer. Whenever we use cout
Still 'diving in' to Python, and want to make sure I'm not overlooking something.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.