You are viewing a plain text version of this content. The canonical link for it is here.
Posted to ojb-dev@db.apache.org by Leandro Rodrigo Saad Cruz <le...@ibnetwork.com.br> on 2004/05/05 17:54:45 UTC

[RFC] using one row per object attribute

Hi all. It's been a while.Since I don't contribute to ojb for some time
I'm looking for advice on this.

I'm trying to implement a user (U name it) control system that uses a
variable number of attributes. The database mapping for this will be
something like this :

ATTRIBUTE_LIST_ID - ATTRIBUTE_ID - ATTRIBUTE_TYPE - ATTRIBUTE_VALUE

Example
user1 : Leandro,male
user2 : diogo,??
user3 : ??,female 

ATTRIBUTE_LIST_ID - ATTRIBUTE_ID - ATTRIBUTE_TYPE - ATTRIBUTE_VALUE
	1		1		NAME		LEANDRO
	1		2		GENDER		MALE
	2		3		NAME		DIOGO
	3		4		GENDER		FEMALE

Using one database row per user attribute gives me the necessart
flexibility to add/remove attributes and search for users based on the
attributes they have.

Is the any support on OJB to easilly persist and object like this :


AttributeList {

  int listId; // glues attributes together
  Map attributes; // each attribute has one attribute type and a value

}

Any helpful advice ?

-- 
Leandro Rodrigo Saad Cruz
InterBusiness Tecnologia e Serviços
IB    - www.ibnetwork.com.br
DB    - www.digitalbrand.com.br
OJB   - db.apache.org/ojb
XINGU - xingu.sf.net


---------------------------------------------------------------------
To unsubscribe, e-mail: ojb-dev-unsubscribe@db.apache.org
For additional commands, e-mail: ojb-dev-help@db.apache.org