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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T07:22:32+00:00 2026-05-23T07:22:32+00:00

I have two entities: patient and checkpoint. Patient has attributes such as DOB, name,

  • 0

I have two entities: patient and checkpoint.
Patient has attributes such as DOB, name, ID, etc.
Checkpoint has attributes such as dateRecorded, height, weight, etc.

You probably get the idea- I want there to be a set of patients, and then each patient can have checkpoints associated with that patient.

On both entities, how should I set the settings? The settings are:
Relationship Window

I looked at the documentation for this, and I was still confused. I think what I want is a one to many relationship (for patient), but then I’m not sure how to set the inverses for either of them, or the delete rule and the other stuff. THANK YOU!!

  • 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-23T07:22:33+00:00Added an answer on May 23, 2026 at 7:22 am

    I just got started with Core Data this week. Great question!

    Relationships:

    Since one patient can have many checkpoints, the Patient to Checkpoint relationship is a One to Many relationship. The concept of an “inverse relationship” is essentially this: You’ve got a relationship going one way (Patient to Checkpoint) – now go ahead and look at it from the inverse, the Checkpoint’s perspective. A checkpoint can apply to only a single patient. Therefore, the Checkpoint to Patient relationship is a One to One relationship.

    Inverse Relationships:

    To handle the inverse relationship, simply create each relationship, ignoring the inverse. Then, after you have the relationship on each object, go ahead and define the inverse as the relationship on the other entity.

    In other words, a relationship points to another entity or a group of entities. An inverse relationship points to a relationship on another entity.

    Delete Rules:

    As far as delete rules are concerned, it’s fairly simple. When trying to delete a patient which has checkpoints…

    • Deny: Core Data won’t let you delete the Patient.
    • Cascade: Core Data will delete the Entity (Patient), as well as cascading through relationships and deleting those objects as well. (In other words, Core Data will delete the Checkpoint objects too.)
    • Nullify: Core Data will delete the patient but first remove the relationship. The Checkpoint will remain intact.

    For the Patient entity might want either deny or cascade, depending on how you want to manage your data. Based on your usage case, you probably don’t want nullify, since Checkpoints are dependent upon Patient entities.

    You want nullify for the Checkpoint, since the Cascade would prevent you from deleting a checkpoint without deleting the entire patient, and Deny would effectively force the same.

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

Sidebar

Related Questions

I have two entities: Patient and Job. Patient has a to-many relationship to Job
In my Core Data model I have two entities: List and Patient. List has
I have two entities, Parent and Child. The Parent entity has a to-many relationship
I have two entities in my application: House and Photo . House has a
I have two entities: Image and Tags , with a many-to-many relationship. Image has
I have two entities Room.php /** * @ORM\Table(name=room) * @ORM\Entity(repositoryClass=Ahsio\StackBundle\Repository\RoomRepository) */ class Room {
More specifically i have 3 entities(doctors, patients, prescripts). The prescripts entity has two foreign
i have two entities page and user. the page has a property userId on
I have two entities, a project and a company. One company has a list
I have two entities, Parent and Child, in Entity Framework. The parent has a

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.