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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T10:23:24+00:00 2026-06-01T10:23:24+00:00

I have category entity and subcategory entity. I need to get subcategory data to

  • 0

I have category entity and subcategory entity. I need to get subcategory data to that related categoryId of category entity.

My category entity contains these attributes: “categoryId”,”categoryName”

subcategory contains: “subcategoryId”,”subcategoryName”, “categoryId”.

So can any one please guide me how can i put the relationship between this two entity ??

Thanks for advance.

  • 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-01T10:23:25+00:00Added an answer on June 1, 2026 at 10:23 am

    Very first you are mixing the concepts of MySQL or SQLite with Core data. Unlike them Core Data does not have primary-foreign Key concept to relate entities(for easy understanding tables in MySQL). Just create relationship between those entities and you can fetch data their data.

    Now about your Entities you have are category and subcategory. So you have to create relationship between them. If one category have many subcategories you have to check To many relationship option from Data Model Inspector..Otherwise One to One relationship would be the one you should go for..Have a look at screenshot how you can make your relationship one to many..

    This is a good tutorial link for one to many relationship. You can refer if you do not know how to implement.

    Also this for tutorial simple relationship in Core Data..

    if you are beginner with Core data you can go with Quick Tutorial Start by Apple and you will get basic idea of Core data.
    enter image description here

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

Sidebar

Related Questions

I have a category system that is related many-to-many with posts. How can I
I have a category tree and i'd like to get all products that are
I have an Item entity that has a ManyToOne relationship to a Category entity.
I have a 2 Entity : Person (Id, CategoryId) and Category(Id). Now when I
currently i have a form, that generates a Drop-Down-Select from my category-entity: $builder ->add('category',
I have an entity called Category and the entity contains a IEnumerable called ChildCategories.
I have a Product and Category entity in many-to-many association. I am trying to
I have an entity Product which has relationship category, which is optional, and use
I have entity e.g. Product which aggregates other entities such as Category . Those
I have category model that has a tree structure. In my database I have

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.