On Tue, 21 Jan 2003, David Graham wrote:
> Date: Tue, 21 Jan 2003 18:10:33 -0700 > From: David Graham <[EMAIL PROTECTED]> > Reply-To: Struts Users Mailing List <[EMAIL PROTECTED]> > To: [EMAIL PROTECTED] > 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:[EMAIL PROTECTED]> For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

