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

  • Home
  • SEARCH
  • 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 7597467
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T22:09:48+00:00 2026-05-30T22:09:48+00:00

I have a one-to-one unidirectional relationship between a Booking object and an Address object

  • 0

I have a one-to-one unidirectional relationship between a “Booking” object and an “Address” object and a persistent store.

Normally, each booking stays with the same Address, and under normal conditions this works fine.

However, if for some reason the booking address is changed on the server side, I want to update the Booking with a new Address object, and remove the existing Address object from the relationship. This is because I don’t want the original Address object changed – that should stay as it is in the persistent store.

Can anyone tell me broadly whether this is possible in Core Data, and how to go about doing it? I’m currently using the Magical Record Helper library code.

My efforts so far have been to create a new Address object in a transient context, nullify the existing Address object linked to the Booking, and then add the new Address object to the Booking. However, an error is thrown at this last stage. I have also tried making the relationship bidirectional.

  • 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-30T22:09:49+00:00Added an answer on May 30, 2026 at 10:09 pm

    What I was doing wrong was using a transient context for the new object, which the object with its relationship being replaced was in the default context. Need to go back to core data school.

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

Sidebar

Related Questions

I have one-to-many relationship between parent and child Java objects. The parent object uses
I have an Class with a unidirectional one to many relationship as follows: public
If I have a relationship between two tables (both tables have their own primary
I have one data model 'object' with fields->object_id, object_name. That is: http://localhost:3000/objects/ I have
I have the below unidirectional Many To One mapping @Entity public class Item implements
I am trying to generate a unidirectional one-to-many mapping between two JPA entities. In
Have one object of type A that is related to a bunch of objects
I am trying to create a Unidirectional one-to-one relationship using NHibernate. Example: An Order
I have two tables called Person and Address . These tables I mapped one
I have one Sqlite Database file. I want to share my sqlite database between

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.