cayenne-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Mike Kienenberger <mkien...@gmail.com>
Subject Re: [HELP] Problem: Cayenne - ORM and "TEMP" tables
Date Fri, 09 Mar 2012 14:35:53 GMT
If it were me, I would add a status column to the Test table
(approved, pending-approval, maybe rejected).
Then I would store both approved tests and pending-approval tests in
the same tables rather than using identical temporary tables.

You might also consider adding a related_parent_test_id column to the
Test table, so you can quickly identify which tests are related
revisions of each other.

When a Maker makes a change to a test, make a new pending-approval
copy of the Test, linking it back to the original.

When an Approver approves it, delete the original (or mark it as
obsolete) and mark the new test as approved.   When an approver
rejects it, delete the copy (or mark it as rejected).


Another approach would be to add the status column to each table.
Instead of copying the entire test, just maintain the differences
between the approved test records and the pending-approval test
records.  Possibly you'd use status items like (pending-addition,
pending-removal, pending-modification).   Then you don't need to
maintain and copy entire tests.


But in any case, I would avoid separate identical tables.

On Thu, Mar 8, 2012 at 8:58 PM, atomix <say_i_love_you_4ever@yahoo.com> wrote:
> I had a situation, not completely related to Cayenne only, may be every ORM
> framework...
>
> Say I had a Test, the Test has Question(s) ,a Question can be in various
> Test
> Test -n-n- Question for short.
> Also, in TestHasQuestion table has a property of order, and value of the
> Question in a specific the Test.
>
> Here is the problem:
> The every update in a Test have to be approved (by Maker and Approver)
>
> So basicly, a Maker do a lot of changes in a Test, then submit it in a Temp
> Table (which have almost same structure), then Approver accept or reject,
> the Test should be return to its previous APPROVED status.
> ---------------------------------------------------------
> Yes, the scenerio for 1 Table is pretty simple to imagine...
> Now, Question also -1-n- to Answers. Answers also link to another Table..
> ...
> and I confused a lot how to work out the case in a ORM system like Cayenne.
> It can be handle in a simpler enviroment like SQL, but the whole tables are
> linked together in Cayenne...
>
> Just few temp-tables make my life suck big times ....
> ...
>
> --
> View this message in context: http://cayenne.195.n3.nabble.com/HELP-Problem-Cayenne-ORM-and-TEMP-tables-tp3811483p3811483.html
> Sent from the Cayenne - User mailing list archive at Nabble.com.

Mime
View raw message