I recently inherited a system that relies heavily on the EAV database structure and really fights in terms of performance.
I want to use nhibernate or another suitable ORM product to map these EAV tables to objects so that we can map a row to a property. Then we can reorganize the database to make it relational. Does anyone know if this is possible? An example will also be appreciated! :)
To make you feel the structure, it looks something like this:
Entity (EntityId) EntityVarchar (EntityId, VarcharValue) EntityFloat (EntityId, VarcharValue)
etc. If I had a Customer object, I would say Customer.Name to get the name, not Customer.Varchar ["Name"].
Please note that there is no need to use the EAV model in our system, we do not allow runtime changes in data structures, and I think this is bad practice.
source share