Re: Lookup tables

From: Michael Gentry (blacknex..mail.com)
Date: Fri Dec 22 2006 - 10:37:29 EST

  • Next message: Terry Jeske: "Re: Lookup tables"

    This sounds like normal, standard, typical things one would want to
    do. Cayenne supports in-memory sorting, but it sounds like you want
    to do refreshes from the database, which is fine. Just add an
    ordering clause to your query each time. See if this page helps you:

    http://cwiki.apache.org/CAYDOC/using-orderings.html

    /dev/mrg

    On 12/21/06, Terry Jeske <terry.jesk..mail.com> wrote:
    > Thank you all for your input. Michael asked me "What exactly do you
    > need?". Which is a good question:
    >
    > - We need a way to track projects.
    > - Projects will be displayed to the user in a grid, which should be
    > sortable by Name, and Status.
    > - Status values are: "Completed", "In Progress", "Not Started"
    > - The current status values may change over time. For example "Not
    > Started" may change to "TBD".
    > - The user can change the status of a project by selecting a value
    > from a HTML list box.
    > - An admin user can add (and edit) values to the status table through
    > a web form, and these changes are immediately available to the website -
    > i.e. list box values are populated from the database. Adding a new
    > Status requires no code changes, it is purely database driven.
    >
    > I know that this example is a bit contrived i.e. "status" would normally
    > stay a bit static. However, there are other cases where these values may
    > change, and having them in a Key table should not be a big deal (IMHO <g>).
    >
    > I should note that I am not a DBA, but I know enough to get by, usually by
    > running queries until I get the syntax right. My focus is on the integration
    > side of things, but like many of us, I have to wear many hats.
    >
    >
    > On 12/20/06, Juergen Saar <juerge..saar.org> wrote:
    > >
    > > I would it do in the Andrus-Style ...
    > >
    > > but it seems, as if the idea of terry is a freetext-status,
    > > that is continous changed during the lifecycle of a project.
    > > I wonder why this information is not placed directly in the project-table.
    > >
    > > 2006/12/21, Andrus Adamchik <andru..bjectstyle.org>:
    > > >
    > > > Terry,
    > > >
    > > > Just noticed that according to your message, status_table has an FK
    > > > to project... Wouldn't you want the opposite if a project has just
    > > > one status? (other than that what others and myself suggested in this
    > > > thread is still correct).
    > > >
    > > >
    > > > projects_table
    > > > --------------------------------
    > > > id int (pk)
    > > > projectname varchar
    > > > status_id int (fkey to status_table id)
    > > >
    > > >
    > > > status_table
    > > > ------------------------------
    > > > status_id int (pk)
    > > > status_name varchar
    > > >
    > > >
    > > > Andrus
    > > >
    > > >
    > > > On Dec 21, 2006, at 2:34 AM, Terry Jeske wrote:
    > > >
    > > > > projects_table
    > > > > --------------------------------
    > > > > id int
    > > > > projectname varchar
    > > > > status int
    > > > >
    > > > >
    > > > > status_table
    > > > > ------------------------------
    > > > > projectId int (fkey back to projects_table id)
    > > > > status_name varchar
    > > > >
    > > >
    > > >
    > >
    > >
    >
    >



    This archive was generated by hypermail 2.0.0 : Fri Dec 22 2006 - 10:38:09 EST