I've recently inherited a system that relies heavily on an EAV database structure, and is really struggling from a performance perspective.
What I want to do is use nhibernate or another suitable ORM product to map these EAV tables to entities in such a way that we can map a row to a property. We can then refactor the database in order to make it relational. Does anyone know if this is possible? An example would also be appreciated! :)
To give you a feel for the structure, it looks something like this:
Entity (EntityId) EntityVarchar (EntityId, VarcharValue) EntityFloat (EntityId, VarcharValue)
and so on. If I had a Customer entity I'd like to say Customer.Name to get the name rather than Customer.Varchar["Name"].
Please note there is no need in our system to use an EAV model, we don't allow runtime changes to data structures, and I believe it's a bad practice anyway.