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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T22:42:43+00:00 2026-05-23T22:42:43+00:00

I have a MySQL database and would like to have a similar structure in

  • 0

I have a MySQL database and would like to have a similar structure in Core Data. I am very new with using Core Data with Xcode. I have a few fundamental questions if I am doing the right thing.

My Mysql DB looks similar to this:

table.caveconditions
  visibilityID
  percolationID
  xxxx

table.visibility
  visibilityID
  visibilityValue

…and so on. I would then connect the tables using JOINS

Now, I have done the Core Data modeling like this but I am not quite sure if this is the right approach.

Would be great if someone of you could tell me if this is the right way to do it. In the end I would like to use JSON strings to dump the mysql table into core data.

Thanks a lot
Chris

enter image description here

I have created the new schema. Is this right?

enter image description here

  • 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-23T22:42:45+00:00Added an answer on May 23, 2026 at 10:42 pm

    It looks good except for all the “xxxID” attributes e.g. caveID. You also need to follow the naming conventions.

    You have the same attribute names with (presumably) the same values in two or more entities. This is necessary in SQL for joins but in Core Data, this is handled by objects and relationships.

    Each object in Core Data is automatically universally unique. This means when you create a relationship from one object to another, that relationship concrete identifies on specific unique object.

    This means you only need an attribute like caveID in the actual entity that caveID designates which in this case is (presumably) the Caves entity. You don’t need the attribute in the CavesConditions entity or any other entity that has a relationship to the “Caves” entity.

    (If the xxxID were just artifacts of SQL, you don’t actually need them at in Core Data unless some external database your app interacts with requires them.)

    A good rule of thumb to use is that any particular value should show up on only one side of a relationship and, ideally, only once in the entire data model.

    Naming conventions are a little different than SQL. A Core Data entity isn’t a table. An entity is more akin to a class. Each entity is supposed to describe a single instance of a managed object. How many of those instances end up in the object graph is irrelevant. Therefore, entity names are singular.

    In this case, Caves should be Cave, Countries should be Country and so on.

    Relationships are named after the entity they target. It is not immediate obvious but each reciprocal relationship (the default) on the visual data model editor is actually two relationships because there is one relationship description for each side. Each side has the name of the entity targeted. By convention to-one relationships have a singular name and a to-many relationship has a plural name.

    So:

    Caves.relConditions<-->>CaveConditons.getCave 
    

    …would become

    Cave.conditons<-->>CaveConditon.cave
    

    The naming conventions are important because Objective-C uses conventions names to generate and search for accessor methods.

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

Sidebar

Related Questions

I have a mysql database called A. I would like to to get informations
I have a MySQL user added to a database that I would like to
I have mysql database structure like below: CREATE TABLE test ( id int(11) NOT
I'm a bit confused about displaying data from a MySQL database. I would like
I have a mysql database that is tracking hockey stats. What I'd like to
I am creating a C++ application the uses a MySQL database. I would like
I have successfully created Web Services from MySQL Database using Netbeans tutorial . However,
I would like to have a custom function to insert/edit/delete records from a database
I have mysql database and I want a software which can draw the database
I have a MySQL database, and a particular table in that database will need

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.