struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Simon Kelly" <ke...@ipe.fzk.de>
Subject Re: [OT] Query design question
Date Fri, 28 Mar 2003 11:48:25 GMT
Not sure if this is what your looking for, but I have a similar problem
where I have keys and long names for db lookup.  When my app starts up, one
of the first things that happens is that the first user in triggers a method
that creates an xml file pulling all the keys in and their related long
names and storing them in the context somewhere, so then the keys can be
used for the db searches, and the xml file can be used to get the long names
when they are required.

Cheers

Simon

(];o)  <= Very poor attempt at a bald man!!

----- Original Message -----
From: "Becky Norum" <bnorum@coe.neu.edu>
To: <struts-user@jakarta.apache.org>
Sent: Friday, March 28, 2003 12:28 PM
Subject: [OT] Query design question


> My database schema references a number of "lookup" tables.
>
> For example,
>
> DATA:
>   id             primary key
>   category       references lookup_category(key)
>   upload_loc     references lookup_upload_location(key)
>   (etc)
>
> LOOKUP_CATEGORY:
>   key           primary key
>   name
>   description
>
> LOOKUP_UPLOAD_LOCATION:
>   key           primary key
>   url
>   description
>
>
> When doing a search, I create an ArrayList "DATA" beans to hold the
> search results.  I want the results to display the long name rather than
> key for various lookup tables, etc.  e.g., "Acousto-Photonic Imaging"
> rather than "api".
>
> Is it a better design to design the query to handle this, e.g.
>
> SELECT a.id, b.name from data a, lookup_category b
>      WHERE a.category = b.key;
>
> Even though an instance of the data bean doesn't now correspond directly
> to a DATA table entry?
>
> or to conduct separate queries.
>
> The first obviously seems faster.
>
> I'm sure this is handled by some design pattern.. but I'm not sure where
> to look.
>
> TIA,
>
> Becky
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: struts-user-help@jakarta.apache.org
>
>


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


Mime
View raw message