ibatis-user-java mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Collin Peters" <cadio...@gmail.com>
Subject iBatis and entity-attribute-value style tables
Date Wed, 28 Feb 2007 00:17:58 GMT
Does iBatis have any kind of built-in support for
entity-attribute-value (EAV) style tables?  An EAV table (or key-value
table) is one where the data is represented in rows instead of in
columns.   A simple example is here:

So for example, if you had a users table such as:
user_id  integer,
firstname text,
lastname text

And you needed to represent properties for each users, you could add a
few new columns:
property1  text,
property2 text,

But the problem is that you are locked down by the columns. i.e. for
each property you add, you need a to add a column to represent that
property.  EAV would re-structure this by having another table called
user_properties which would look like:
user_property_id integer,
user_id integer,
property_name text,
property_value text,

So you gain flexibility at the cost of complexity.  We have a
situation like this and I am wondering if iBatis can do some kind of
magic to convert the properties automatically.  Let me know if you
need a more concrete example to understand this.  Before I spend the
time to do that I will see if anyone has any comments.

Collin Peters

View raw message