struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Craig R. McClanahan" <>
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 <>
> Reply-To: Struts Users Mailing List <>
> To:
> 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.


> David


To unsubscribe, e-mail:   <>
For additional commands, e-mail: <>

View raw message