Joshua, 

There are many ways to accomplish your goal. To answer your
question, the DAO is typically the object that encapsulates the
persistance and query logic and therefore would perform the 
query using the key passed in from the domain object.

As far as returning results, you have a couple options:

- Return a collection of DataTransportObjects (DTO) where
  each DTO represents a record in the result set. 

- Return a collection of DynaBeans 
  (http://jakarta.apache.org/commons/beanutils/api/index.html)
  whose creation can be facilitated by RowSetDynaClass  
  (http://jakarta.apache.org/commons/beanutils/api/index.html)

- Return a CachedRowSet
  http://developer.java.sun.com/developer/Books/JDBCTutorial/chapter5.html

- I think Craig is working on a way to make RowSetDynaClass detachable.
  That is, so you can use it AFTER closing and releasing the ResultSet
  but I'm not sure if its ready for primetime yet.


You should be able to use any of the Struts, Struts-EL, or JSTL tags
to iterate over and render the contents of the returned results.

HTH,

robert

> -----Original Message-----
> From: White, Joshua A (CASD, IT) [mailto:[EMAIL PROTECTED]]
> Sent: Tuesday, February 18, 2003 3:40 PM
> To: Struts Users Mailing List
> Subject: Proper place/tier for retrieving DDLB Values
> 
> 
> This is what I have done thus far:
> 
> 1 Developed domain objects.
> 2 Developed persistence tier
> 
> Problem:
> 
> Where should the code which takes a key from a domain object (for example
> orderTypeId) and looks it up in a database to get the 
> corresponding values?
> This type of logic doesn't really fit in the domain object tier.  Is this
> done by DAO only?  Assuming that all I need is a name/value pair, 
> what type
> of object/collection should this DAO return?  How/where should I then
> convert these values into an object/collection of objects the struts
> html:select tags can use?
> 
> -Joshua
> 
> 
> 
> This communication, including attachments, is for the exclusive use of 
> addressee and may contain proprietary, confidential or privileged 
> information. If you are not the intended recipient, any use, copying, 
> disclosure, dissemination or distribution is strictly prohibited. If 
> you are not the intended recipient, please notify the sender 
> immediately by return email and delete this communication and 
> destroy all copies.
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to