2009-11-21 160 views
0

为了更好地学习可可和核心数据,我决定构建一个包含烹饪食谱的应用程序。但是,在尝试创建CD模型时,我已经陷入困境。核心数据关系属性

这三个类的,简化:

Recipe: 
name 
ingredients 
instructions 

Ingredient: 
name 
unit (liter, teaspoon etc) 

当然,在配方的成分也关系需要记录所需要的量。如果我要马上建立一个SQL表,我想最终:

Recipe: Ingredient: Recipe_Ingredient: 
id  id   recipe_id 
name  name   ingredient_id 
instr unit   amount 

正是我怎样才能把这个Recipe_Ingredient关系到CD模式?我只需要添加包含这些属性的RecipeIngredients实体吗?

回答