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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T19:37:32+00:00 2026-05-31T19:37:32+00:00

We have an old application where the relationship is defined as below: class Practice

  • 0

We have an old application where the relationship is defined as below:

class Practice {
   String name
   static hasmany = [doctors:Doctor]
}

and

class Doctor {
  String name
}

There is not a belongsTo relationship defined in Doctor as we do not want to cascade the delete of a doctor when Practice is deleted. This is a very old code and do not want to change it.

Now according to the new functionality, the user should know which Practices the Doctor is linked to while viewing the details of a Doctor. Can anyone help me knowing which is the easiest way of achieving this without making changes to the domain object?

  • 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-31T19:37:33+00:00Added an answer on May 31, 2026 at 7:37 pm

    If variable doctor contains the doctor you want to list practices from, you can get a list of Practice objects having this doctor in their doctors relationship by issuing the following criteria query:

    def practices = Practice.withCriteria {
      doctors {
        idEq(doctor.id)
      }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

We have an old asp application that instantiates a .NET com visible class. In
I have an old legacy application around for which I only have the installer.
I have an old J2EE application (J2EE 1.3), which packages into an EAR, and
I have a 3yr old application that has some controllers with some very unrestful
We have a old Web Based application supported on browsers from IE6 to IE8
I have a bunch of *.TBC files from a very old application that runs
Retrofitting ASP.NET WebForms themes to an old application I have a need to theme
I have inherited an old crusty PHP application , and I'd like to refactor
I have in here an old web application written in ASP.Net 2.0 + AJAX.
I have an old function that is called many times in my application. I

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.