Okei, since my first post wasn't really good or specific I'm trying to add some more details.
Assume that we have a bunch of tables that look like this:
C_Company (Company [PK], Description, Disabled)
C_Equipment (Equipment [PK], Description, Disabled)
Now, in our framework (today) it's possible to define new tables like this without changing the source code. All that is required is a new row in another table like this:
X_Define_Codes (CodeNumber [PK], TableName, PrimaryKey, DescriptionColumn, DisabledColumn, ...) Values (1, 'C_Company', 'Description', 'Disabled', ...)
(Neither of the tables are actual names nor are they complete, but I'm hoping that it's enough to illustrate how the framework is built up)
So, what we really want to do, by using NHibernate or another (our own?) ORM library would be;
Code:
ICodeTable code = Enityfactory.Create(1); // 1 == C_Company, according to X_Define_Codes
code.GetDescription(1); // Returns the description for Company code 1
ICodetable newCode = EntityFactory.CreateNew();
newCode.PrimaryKey = 2;
newCode.Description = "Foo Inc.";
newCode.Disabled = "";
newCode.Save();
ICodetableCollection codes = EntityFactory.CreateCollection(2);
codes.GetAll();
foreach (ICodeTable code in codes)
code.Description....;
Does any of this make sense? Have anybody done anything like this with NHibernate or any other ORM lib.?