Re: Retrieving via auto-generated keys

From: Mike Elliott (mr..79.net)
Date: Tue Jun 01 2004 - 06:28:22 EDT

  • Next message: Gentry, Michael: "RE: [OS-JIRA] Created: (CAY-133) Error Generating Classes"

    On Friday 28 May 2004 11:36, Mike Kienenberger wrote:

    > I've solved this problem using struts/velocity/cayenne.
    >
    > However, the way you're going about it is wrong.
    > If you list primary keys as the accessor, then anyone can manually create a
    > form request and put in any primary key they desire.
    >
    > The way I do it is to create a list of the objects, then index the options
    > 0 to list.size(). When the form is processed, I then look up the element
    > in the list for the option value.

    Thanks. I've been around long enough to recognize when I'm probably going
    down the wrong path. That's why I backed off and gave the overall problem I
    was trying to solve rather than simply focus on my first-cut somewhat awkward
    attempt at a solution. Your suggestion of maintaining the lists and
    generating simple integer keys into them for the select tag is superior in
    this instance and that's what I'll implement.

    I was also glad to get the answer to my question of how to fetch from an
    integer key value. While it's probably not the way to go for this problem,
    it'll probably turn up somewhere else.

    MIke



    This archive was generated by hypermail 2.0.0 : Tue Jun 01 2004 - 02:27:40 EDT