struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Craig R. McClanahan" <craig...@apache.org>
Subject Re: How closely to map VOs/ActionForms to relational DB?
Date Wed, 22 Jan 2003 01:42:46 GMT


On Tue, 21 Jan 2003, David Graham wrote:

> Date: Tue, 21 Jan 2003 18:10:33 -0700
> From: David Graham <dgraham1980@hotmail.com>
> Reply-To: Struts Users Mailing List <struts-user@jakarta.apache.org>
> To: struts-user@jakarta.apache.org
> Subject: Re: How closely to map VOs/ActionForms to relational DB?
>
> Use views to ease your join problems.  If a person can have many accounts
> then I will have a Person object in each account object but I won't have a
> list of accounts in the person object.
>

If you don't need your VOs to actually be JavaBeans, you might want to
look at a recent addition to commons-beanutils (included in the 1.6
version that was just released, so it'll be included in Struts 1.1 final)
called RowSetDynaClass.

What this does is copies the data from an SQL query (either a ResultSet or
a RowSet) into a List of DynaBeans that can then be manipulated via
BeanUtils and PropertyUtils methods.  This way, you don't care how many
different combinations of column names all your different queries might
require - you are essentially creating a VO dynamically on the fly with
just the right set of properties.

Javadocs:  http://jakarta.apache.org/commons/beanutils/api/

> David
>

Craig


--
To unsubscribe, e-mail:   <mailto:struts-user-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:struts-user-help@jakarta.apache.org>


Mime
View raw message