核心数据:以多对多关系管理员工合同? [英] Core data: Managing employee contracts in a many-to-many relationship?

查看:163
本文介绍了核心数据:以多对多关系管理员工合同?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用Core Data映射关系的想法。



我有一个 Employer Employees 的多对多关系。基本上,员工可以为多个雇主工作,雇主可以有多个雇员。



我面临的问题是,我不知道如何管理雇员和雇主之间的合同。



由于雇员可以为一个或多个雇主工作,他们自然会有一个合同为他们工作的每个雇主(完成工资,持续时间)以及他们为特定雇主工作的日期列表。



我的问题是 - 如何管理合同 ContractDates

图片如下。



< b
$ b

解决方案

在现实世界中,你在雇主和雇员之间有一份合同。那么为什么不在核心数据中做同样的事情呢?
>


I am mapping an idea for a relationship using Core Data.

I have an Employer entity who has a many-to-many relationship with Employees. Basically, an employee can work for multiple employers, and an employer can have multiple employees.

The problem I'm facing is, I'm not sure how to manage the contracts between employees and employers.

As an employee can work for either 1 or many employers, they would naturally have a contract for each employer they work for (complete with salary, duration) and a list of dates when they are working for a specific employer.

My question is - how to manage the relationships between Contracts, ContractDates with Employers and Employees?

Thank you.

Image follows.

解决方案

in the real world you have a contract between an employer and an employee. So why not do the same in core data?

这篇关于核心数据:以多对多关系管理员工合同?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆