Best approach to map custom entities against generic tables?
Posted: Wed 24 Apr 2013 01:39
Hi,
I need to work with custom entities and I do not wish to have loads of tables. So I have come up with an idea of having one generic "Class" table with is then link to a "Group" table with custom column of string type.
ie C1, C2, C3.
It seems to me that there could be 2 methods to create the specific entities via ED.
1) Create a DB View for each "Group" and create an entity for each view by editing the "Mapping Details". Incidentally, although it says <Add a Table or View>, I can only see my tables? Is this a bug or am I missing something. The View definitely exists.
2) Use the Query View facility in the "Mapping Details" option and write the appropriate Entity-SQL. With this approach, one would not need to write specific DB Views. Would these be updatable like DB Views as long as I accessed just one table?
Thanks.
I need to work with custom entities and I do not wish to have loads of tables. So I have come up with an idea of having one generic "Class" table with is then link to a "Group" table with custom column of string type.
ie C1, C2, C3.
It seems to me that there could be 2 methods to create the specific entities via ED.
1) Create a DB View for each "Group" and create an entity for each view by editing the "Mapping Details". Incidentally, although it says <Add a Table or View>, I can only see my tables? Is this a bug or am I missing something. The View definitely exists.
2) Use the Query View facility in the "Mapping Details" option and write the appropriate Entity-SQL. With this approach, one would not need to write specific DB Views. Would these be updatable like DB Views as long as I accessed just one table?
Thanks.