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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T17:04:05+00:00 2026-06-18T17:04:05+00:00

how to save class extend in grails? example i have class user and administrator

  • 0

how to save class extend in grails?
example i have class user and administrator

class User {
    String name
    String password
}

class Administrator extends User {
    String authoritySelected
}

example in class User i have save “user1”,
and then i want to change user1 from class user to class administrator and update authoritySelected

def update(){
    def user1 = User.get("user1")
    user1.authoritySelected
    user1.save(flush:true)
}

and get error :

No such property: authoritySelected for class:User

so, how to save authoritySelected in class User and change that to class Administrator? thanks.

  • 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-18T17:04:07+00:00Added an answer on June 18, 2026 at 5:04 pm

    When you say “and then i want to change user1 from class user to class administrator”, what exactly are you trying to do?

    You are trying to access a property of an object that doesn’t exist in that object. Downcasting simply doesn’t work like that. You should instantiate an object of type Administrator in order to save one of its properties after.

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

Sidebar

Related Questions

For example: class User extends Spine.Controller @configure 'User', 'name' @extend Spine.Model.Ajax @url: '/save' user
I have a actionSave class which extends AbstractAction.I use it for save button. somewhere
I have various class which perform save and update operations of GUI elements, it
I have a class that I instantiate to save or load xml data. For
I have a fairly simple class that I want to save to SQL Server
I want to extend the User model with the following: class Client(models.Model): business_name =
i have a problem. This is how im trying to extend default User model:
I have a simple Backbone.js model: class Avia.Student extends Backbone.Model Told you it was
I have a Grails integration test that extends GroovyTestCase with two test methods. The
Code: class Session extends Backbone.Model initialize: -> @bind 'change', @save console.log 'init' class SessionList

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.