如何为属性建模父子关系。 [英] How to model a parent-child relationship for a property.

查看:165
本文介绍了如何为属性建模父子关系。的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在SQL Server数据库中有一个架构,我需要为其创建Commerce Server架构。 我的每个产品都有颜色属性。 颜色可能是也可能不是颜色系列的成员。 例如,颜色为"亮白色"。并且颜色为"古董白"。都是"白色"的成员。 。家庭 然后,我需要能够在颜色"古董白"下搜索产品。和颜色系列"白色"。 我如何在Commerce Server中对此进行建模?

I have a schema within a SQL Server database that I need to create a Commerce Server schema for.  Each of my products has a color property.  The color may or may not be a member of a color family.  For example, the color "bright white" and the color "antique white" are both members of the "White Color" family.  I would then need to be able to search for products under both the color "antique white" and the color family "White Color."  How would I model this in Commerce Server?

推荐答案

我会有一些随意的想法;我倾向于将颜色与产品的变体属性联系起来。有了这个,我的第一个想法是将两个属性作为变体放在给定的产品上。属性将是枚举值类型属性,并应允许查询,例如;

给我所有具有变体颜色系列白色的产品,并且颜色为亮白色或
给我所有的产品和/或颜色为亮白色
或者给我所有颜色系列的产品

Some random thoughts I had would be; I have a tendency to associate color with being a variant property of a product. With that my first thought would be to put both properties as variants on a given product. The properties would be Enumeration value type properties and should allow for a query like;

Give me all products that have a variant color-family of white and come in a color of bright-white
or
Give me all products that come in a  bright-white in color
or
Give me all products that come in the color-family of white


这篇关于如何为属性建模父子关系。的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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