Compulsory relation 1 to many from entity A to entity A

Hallo! I'd like to build a database model with winHugs that allows a "recursive relation". For example a single instance of entity "components" is related with at least another row of the entity "components" (1 to many relationship). How can I do that? Thank you for your attention!

On Feb 9, 2008 2:12 AM, news@lyra.net
I'd like to build a database model with winHugs that allows a "recursive relation". For example a single instance of entity "components" is related with at least another row of the entity "components" (1 to many relationship). How can I do that?
A very simple approach is to use a recursive data type: data Relation = Relate Component [Component] If components store their relations, then data Component = Component { related :: Maybe [Component] } There are much more complicated but type-safe approaches too. What are you looking to do? Justin
participants (2)
-
Justin Bailey
-
news@lyra.net