Mapping a collection property in the Visual Designer

2 posts, 0 answers
  1. Jakkie Esschert van den
    Jakkie Esschert van den avatar
    61 posts
    Member since:
    Sep 2009

    Posted 11 Oct 2010 Link to this post

    Hi,

    I'm trying to create a class in the Visual Designer which contains a List of strings. I can create a property of the type IList<string>, but I can't figure out how to map that property to a separate table. I can get it to work by creating an additional class just to hold that string, but I really don't want the extra overhead. Is there a way to cleanly map this?

  2. TSE
    TSE avatar
    381 posts
    Member since:
    Sep 2008

    Posted 11 Oct 2010 Link to this post

    Hi Jakkie,

    If you want to map this to a separate table I don't see any other option than to construct a persistent class with one field (the string) possibly also a field representing the inverse field of the class that "owns" the list of strings (the class there it is declared). The latter depends on how the relationship between the class and the list of strings is. Either 1:m with an inverse field (fk column in the "string" class) or 1:m with a join table (no need for the fk column in the "string" class, since it is in the join table)

    Regards

    Henrik
  3. DevCraft banner
Back to Top