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 8208261
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T09:16:50+00:00 2026-06-07T09:16:50+00:00

What I want to do is find a domain and then either create a

  • 0

What I want to do is find a domain and then either create a new one or save the pre-existing one. Here is the code that I am currently working with (in this project, skeleton is the package name):

    def save() {
        Class lob = grailsApplication.getDomainClass('skeleton.'+params.lob.name)
        def instance = lob.get(params.lob.id)
        if (instance){
            params.data.each { name, value ->
                if (instance.metaClass.hasProperty(name)){
                    instance[name] = value
                }
            }
        }else{
            instance = new lob()
            params.data.each { name, value ->
                if (instance.metaClass.hasProperty(name)){
                    instance[name] = value
                }
            }
        }
    }

This doesn’t seem to be working. Can anyone help me with the solution?

  • 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-06-07T09:16:51+00:00Added an answer on June 7, 2026 at 9:16 am

    The object returned by getDomainClass is an instance of GrailsDomainClass. To get the actual domain class on which you can call get, first call getClazz on it. For example:

    Class lob = grailsApplication.getDomainClass('skeleton.'+params.lob.name).clazz
    

    In addition, you’ll have to call newInstance on the class object rather than using the new keyword to create a new instance.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want to find a specific URL inside a domain that it is not
I want to find out if it is possible to create Android API's that
I want to create a private url as http://domain.com/content.php?secret_token=XXXXX Then, only visitors who have
I want to find a way to copy one file to multiple locations simultaneously
I want to find the first element that has appeared in previous positions in
I'm trying to find a good, simple introduction to domain driven design, but that
Here is my controller: def sedomain @domain = params[:domain] @virksomhed = Virksomhed.find(:all) end Virksomhed
I have an unsecured domain and want to create a secured sub-domain. On the
I want to use simple_html_dom.php to do some work. $html = file_get_html('http://www.domain.com'); foreach($html->find('p') as
I'm not validating emails. What I want to do is find (and then change)

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.