On Thu, Jun 18, 2009 at 11:37, c<[email protected]> wrote: > I'm new to Elixir and SA, and I've been struggling trying to implement > ternary relation using Elixir. > > I'd like to have 3 types of entities: User, Group and Site, where > every User belongs to a Group for a particular Site. So to represent > this relation I thought I should have additional table (eg. > UserGroupSite) which would hold IDs for User, Group and Site. > > so my question is how can I implement it using Elixir?
Use an explicit entity for your relation, and use an AssociationProxy on top for the syntactic sugar. An example of that (for a Many-to-Many relationship with extra columns but a ternary relationship should work as well) is given at: http://elixir.ematia.de/trac/wiki/Recipes/UsingEntityForOrderedList Hope it helps, -- Gaƫtan de Menten http://openhex.org --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "SQLElixir" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/sqlelixir?hl=en -~----------~----~----~----~------~----~------~--~---
