ADF: controlling the order in which VO records are inserted

All,
in an ADF BC project, we have some complex MD insert pages that add records to master and detail tables at the same time. The application sits on top of CDM RuleFrame, which exposes the datamodel as DB views with instead-of triggers and adds (Designer) a few nifty things like auto-populated PK fields. Sad enough, we can't use these auto-generated PKs as the 'refresh after insert' settings in an EO work with a RETURNING clause, which is not supported for instead-of triggers. This means we'll have to find the PK sequences ourselves from the EOs and populate these fields ourselves, before committing to the database. So far so good, but things go wrong when we want to insert master and detail at the same time. The PK and FK of the child record are already filled in at insert time (which is nice) but for some reason the child records get inserted before the parents, resulting in an error on the FK as the parent record does not yet exist (which is not nice).
So, here's the question: is there a way to control the order in which new VO records are inserted ? On what is the default order based (maybe a little renaming could help us out to get the alphabet our way) ?
We know defining the FKs as 'initially deferred' will make sure they are only checked at commit time, but our DBA prefers to not use that solution unless strictly necessary. (is there anything bad about deferred keys why we should believe him? ;o) )
And additionally, is there a way around all this manual PK-fetching ? We've tried using the refresh(int refreshMode) method of EntityImpl, but it didn't seem to work.
Many thanks in advance for your tips, suggestions and solutiosn !
Best regards,
Benjamin De Boe

Benjamin,
To handle the problem with the child/parent records being inserted in the wrong order - have a read of the Oracle ADF Developer's Guide for Forms/4GL developers, section 26.7. I use that technique with great success.
John

Similar Messages

  • How to control the order in which records get indexed

    Hi,
    I like to control the order in which the ATG (10.1.2) product records get indexed in Endeca (3.1.1). I like the products/categories to be indexed in the order in which they are sequenced in BCC (in otherwords baseed on the sequence num they have). How to do this? Please help

    If you want TopLink to set the values in a particular order you can order the mappings on a descriptor by setting their ‘weight’ (DatabaseMapping.setWeight(int). All DirectToField type mappings are defaulted to a weight of 1 and all relationship mappings are defaulted to a weight of MAX_INTEGER. Mappings with a lower weight value will be processed first by TopLink.
    --Gordon

  • I have multiple email accounts on my iPad. How do I control the order in which the accounts are displayed?

    I have multiple email accounts on my iPad. How do I control the order in which the accounts are displayed?

    In landscape mode, the mailbox list is automatically displayed (in portrait mode, you will need to tap the button to,show it).
    To edit the list, tap edit as shown below.

  • Any way to control the order in which data is exported?

    I found it surprisingly easy to set up a form to submit its contents via a formmail script -- perhaps too easy...
    Using Acrobat 9 (and the demo version of Acrobat X), I've modified a form that students fill out so that when they hit the submit button it pushes the form contents to a script which relays it to an e-mail address specified on the form -- no problems there.
    But the order in which those fields are listed in the e-mail bears no relation to the order the fields appear in the form -- or alphabetical order of the field names or data values or the tab order. It's the same order every time. And as far as I can tell the mailing script isn't doing anything to change the order of the data.
    This is mostly an issue of making the e-mail friendly for the supervisor who has to look at the e-mails as they come in. (I've done a number of searches on Google and here in the forums before posting and haven't found any references to similar problems, so maybe I do have a funky script.)
    I'm wondering if a) there's something native to the form that could change the order of the data and b) there's some straightforward way of controlling that. (I imagine I could write some JavaScript to control the output I had to, but it seems like a needless step.)
    Thanks for any insight anyone can provide.

    function(){return A.apply(null,[this].concat($A(arguments)))}
    A solution would be to modify the server script to output in the order you want, as opposed to just looping over the collection of fields present in the incoming data as formmail type scripts typically do.
    That is what I wound up doing -- making a copy of the mailing script and reformatting the message body string to contain just the data responses my colleage wanted in the order he wanted. It beats the old method of requiring users to fill out the PDF, save the document and then e-mail in the PDF as an attachment.

  • JSTL Change the order in which children tags are processed

    Hi there,
    Is there any way one can manipulate the order in which tags are executed/processed within for example an iteration tag? I.e. let's say I have the following:
    <m:my_iterate_tag data="data">
      <dotag1>XX</dotag1>
      <dotag2>YY</dotag2>
    </m:my_iterate_tag/>The user can set as a preference in my application that they want <dotag2> to
    be displayed/executed first before <dotag1>, e.g. like in a column in a table. How can I change
    the order of these tags when I execute the <m:my_iterate_tag>? Do I do it in
    <m:my_iterate_tag> or is there another or better way? Please help.
    Thanks,
    Marius Botha

    Okay, lets start with getting the order in which to display columns... So you say:
    get the order of these columns from the db (e.g. client
    says 1=title, 2=number, don't display "type" column)Based on the DB, then, create a java.util.List that would have the column names in the order they want... (not real code...)
    ArrayList columnOrder = ["title", "number"]
    When you get to iter_tag:table.doStartBody, then create a java.util.HashMap (lets say) called tableColumnData.
    Then in the iter_tag:column tag, you would the value provided in the tag mapped to the property name as the key in the tableColumnData map:
    tableColumnData.put("number", <this iteration's number value>);
    tableColumnData.put("title", <the value returned from the g:href tag>);
    tableColumnData.put("type", <anything>);
    Then, in the iter_tag:table.doEndBody, you do a loop, getting the name of the column to display from the columnOrder list, and using that name to pull the value out of the tableColumnData map:
        for (int i = 0; i < columnOrder.size(); i++) {
            out.println("<td>" + tableColumnData.get(columnOrder.get(i)) + "</td>");
        }You would put the columnOrder in a scope where you won't have to relaod it all the time, like maybe the user's session. You would put the tableColumnDataMap to make sure it is unique to the table... either in the pageContext, or store it in the iter_tag and make a method where the nested tags can retrieve it.

  • Lion has changed the order in which Finder items are sorted in Icon View; Acc vs. Desc.  How can you change this order?

    The order in which items are sorted has changed in Lion and I can't figure out how, or if, it can be changed.  Previously in Snow Leopard if you sorted by 'Date' in Icon View, your icons would be arranged from oldest to newest.  The same was true for 'Kind' and all the order sort options.  In Kind my *.zip files were positioned last.
    Now in Lion, the order is reversed.  Newest and Zips on top... the accending vs. decnding order has been changed.  How can I change the sort order in Icon View?

    I managed to fix the reverse order issue by deleting the com.apple.finder.plist and com.apple.finder.plist.lockfile in the user library folder. I did have to use terminal to delete the files and then re-launch finder from the force quit window. Here are the step-by-step instructions:
    Hold down the option key while selecting the Go menu. Select Library.
    Navigate to the Preferences.
    Find the com.apple.finder.plist.lockfile and delete it.
    Open Terminal (Application/Utilites)
    In Terminal type in sudo rm (include a space after the rm and do not hit enter)
    Drag com.apple.finder.plist file to the terminal window. It will fill in the path to the file)
    Press return.
    Type in your password and hit return. (The cursor will not move when you type in your password)
    From the Apple menu, select force quit.
    Highlight finder and select re-launch.
    Be careful when using Terminal. There is no undo button and you can accidentally delete important files.
    I hope this helps.
    Henry

  • How do I control the order in which JTree displays nodes?

    I'm trying to display the nodes in a JTree in a specific fashion, but I can't figure out how to change the order JTree displays them in. It seems the default is alphabetically, with leaves first and nodes with children second. I've spent a few hours pouring through the documentation, but I haven't been able to find out what I need to do. Anyone know?

    They are displayed in the order they are added on the same level.

  • What determines the order in which phone numbers are displayed in address book/contacts on Mac and iPad/iPhone?

    I may have "Work, Home, Skype, Work Fax" (for example) order in Adress Book on my Mac, but there is no gurantee, apparently, that this order will be preserved across entries on my iPad and iPhone.  In some entries I might get "Home, Work, Skype, Work Fax" while others might have "Work, Skype, Home, Work Fax".  Even with just Work and Home, the ordering is not consistent.  Can I force a specific order?

    Having the same problem.  Have iPad and iPhone, both running ios5, both sync to the cloud, and data entered on one soon shows up like magic on the other.  But Lion MacBook Pro refuses to join in the dance.  Contacts and calendar entries on the mbp don't show up in either the ipad or iphone.  I have the same account login info setup on all three devices, and as much as I can tell, preferences set up correctly.  Oddly enough, when I am in the mbp cloud preference pane, and click on the ? for help, it tells me it can't give me help because it is not connected to the internet.  Well, it clearly IS connected to the internet.  Don't know if that is related to the non-syncing or not, but it is a little strange.  A little bit of operating manual for cloud would be helpful.

  • How can I change the order in which purchased movies are downloaded?

    If for instance, I rent three movies on iTunes Store and decide I want the download of my last pick, to be the first one finished downloading... is there a way to do this?

    Pause the ones that you do not want to be first.

  • Force the order in which WHERE clauses are applied?

    I need to make sure that one where clause filtering is applied before the other. How do I do that?
    Several of my where clauses are below.
    I need to make sure than the where clause in bold is applied before several where clauses on the bottom. Otherwise, I get error: division by 0.
    where ...
    and a.surveydate = (select max(surveydate) from survey
    where id = a.id
    and surveydate < b.surveydate
    and b.surveydate between TO_DATE('&lowdate','DD-MON-YYYY')
    and TO_DATE('&highdate','DD-MON-YYYY')
    and (
    ( abs( (b.totvacant/totunits - a.totvacant/totunits) /
    (b.surveydate - a.surveydate) * 365 ) >= 0.00 )
    or ( abs( (b.avgcost/ a.avgcost -1 ) /
    (b.surveydate - a.surveydate) * 365 ) >= 0 )
    or ( abs( (b.free_rent - a.free_rent ) /
    (b.surveydate - a.surveydate) * 365 ) >= 0 )
    Thank you. I know very little about query optimization, but I have a sense that I need to use some kind of SQL hint.

    Why not rewrite the where clause a bit to intercept »ORA-01476: divisor is equal to zero«?:
    SELECT *
      FROM tab
    WHERE a.surveydate =
              (SELECT MAX (surveydate)
                 FROM survey
                WHERE ID = a.ID
                  AND surveydate < b.surveydate
                  AND b.surveydate BETWEEN TO_DATE ('&lowdate', 'DD-MON-YYYY')
                                       AND TO_DATE ('&highdate', 'DD-MON-YYYY')
                  AND (   (ABS ((b.totvacant / totunits - a.totvacant / totunits
                                / NULLIF (b.surveydate - a.surveydate, 0) * 365
                               ) >= 0.00
                       OR (ABS ((b.avgcost / a.avgcost - 1)
                                / NULLIF (b.surveydate - a.surveydate, 0) * 365
                               ) >= 0
                       OR (ABS ((b.free_rent - a.free_rent)
                                / NULLIF (b.surveydate - a.surveydate, 0) * 365
                               ) >= 0
                      ))

  • How can I control the order of playback on MuVu Mix (USB 2.

    What determines the order of playback of music files stored on the MuVu Mix (USB 2.0)? How can I control the order?
    Apparently it is not name order. The music titles are prefixed by sequential numbers. But that is not the order that the files play back.
    I tried erasing all contents, then copying the files one by one to the MuVo Mix in the order that I want them to play back (name order). But that is not the order that the files play back.
    By the way, in both case, I removed the ".dat" file first. (I also tried keeping the ".dat" file, to no avail.)

    SSR wrote:
    > on the newer MuVos (which I would have thought included the Mix)
    > it's filename order. Other than that it's hard to know, but it sounds
    > like you ought to contact Support to check.
    I did, and they confirmed (very quickly; kudos!) what you and I both expect: the play order is determined by the alphabetical order of the file names. The mistake was mine. I ass-u-me-d that the MSWin folder "Name ^" order was correct. I did not realize that it is not exactly alphabetical when the file name begins with a number (e.g, the track number). I had renumbered songs from a second CD by simply adding 00 to the track number. Thus, songs and 2 of the first CD are played after songs 08 and 09 of the second CD, as they should alphabetically, even though they appear in the order , 2, 08, 09 in the "Name ^" list. Klunk! Mea cupla!

  • Get the rows in the same order in which it has been inserted.

    Hi,
    I have a table with four columns(All varchars)...and there are no primary keys
    i have inserted 15 rows where col1="xyz"
    Now while retrieving the same...i dont get the same in the order i ahve inserted..
    What is the way to get the rows in the same order in which it has been inserted..?
    Regards

    I have a table with four columns(All varchars)...and
    there are no primary keys
    i have inserted 15 rows where col1="xyz"
    Now while retrieving the same...i dont get the same
    in the order i ahve inserted..
    What is the way to get the rows in the same order in
    which it has been inserted..?
    RegardsWhy? What is your business case behind this?
    In my experience an "order by" is used way too much without any real need to do it. Are your users interested to know in what order a few records from two years ago have been inserted? What about updates since that time?

  • How can you control the order of video tracks?

    I have an iDVD project with an intro movie (movie played when the disc is first inserted), 5 20 minutes videos (each of which is an individual iMovie project with chapter markers, but the videos are meant to be watched in order 1, 2, 3, 4, then 5), and an addition 5 minute video. When I created the disk image, I noticed it started encoding the last of the 20 minute videos and then seemed to encode the rest of the videos in random order.
    I burned the disk image to DVD and started watching it in my DVD player. When you watch the first 20 minute video, when it finishes you return to the menu so you can choose the second 20 minute video. But, if you scene skip through a 20 minute video on the last scene, it takes you to the next track. The problem is the tracks are all in random order. So instead of scene skipping to the next 20 minute video, it takes me to the intro video, then to 20 minute video, ect. It's all out of order.
    My question is does anyone know how to control track order? Is the track order the order in which the videos are encoded? (It seems to that is the case.) I tried inserting the videos into the iDVD project in the order I wanted them, but I don't know if that will work or not. The assets all appear in random order in the Project Info window.

    I would like to know also. I have made many DVDs, but the number order does seem to be random. For presentation purposes I want to play a specific clip by hitting it's corresponding number on the DVD player remote when the DVD is at a complete stop (so if I put the movie clip in the 2 spot and hit the number 2 on the remote, then the 2 movie clip will play). I can get this to work from the menu by dropping them in iDVD in the order I want and waiting for each to encode before dropping the next, but at a complete stop I cannot ensure number 2 on the remote will play number 2 on the DVD. To me it looks like iDVD gives those numbers in the order in which the audio is encoded when burning, with the shorter clips first and longer ones last.
    Can anyone help me?

  • What is the order in which I must change my Apple ID on all my Mac products:iTunes, iCloud for iphone-MacIntel- MacAirbook

    I wish to change my email account on my AppleID. But I am faced with having to go back and forth between old and new emails/accounts to get ALL my Mac products changed to the new email address. I have needed to delete acounts, and then reset accounts back to the old account to only re-delete or re-set.
    Is there a specific order in which to do update all my Mac products? What item do I reset first, what product follows the next? I do not have an ipad but might as well add it to the list for when I do get one and have to do this all again.
    What I have done so far-
    My apple ID is  currently set to the original email account (aol) that I wish to delete.
    my icloud on my iphone has been deleted
    my iTunes is set to the old aol account
    Now... what item gets changed first, second.....

    First verify that your existing Apple ID password conforms to these rules:
    If not, change your Apple ID password first.
    To change your password read Apple ID: Changing your password
    Then, sign out of all the Apple services on all your Apple products. Use the link in Step 8 of this document as a checklist to make sure you do all of them:
    Apple ID: Changing your Apple ID
    The order in which you change your Apple ID does not matter.
    Subsequent to changing your Apple ID read and follow:
    Apple ID: What to do after you change your Apple ID

  • How do I control the order of all day events in iCal?

    How do I control the order of all day events in iCal?  Even if I painstakingly try to
    re-order the events the way I want them, when they print, they are in a different order.
    I have searched other forums and no one seems to have an answer to this.  Has
    anyone found the solution?  Thanks!

    I also have this issue, where the events in iCal change when viewing in print preview or printing. I even notice they will switch if I try to print again??!!! I am using different calendars to show different colours. and they are setup on iCloud not on my mac.
    it is becomign frustrating when I print 2 months worth and ssome events are correct in order and alas some will change when I print again!
    Can anyone help please?
    thanks

Maybe you are looking for

  • I have had constant problems with my Verizon broadband internet service, and can only assume I will need to cancel my contract.

    According to Verizon, my family is somehow using 15 to 16 GB of data per month on our unlimited data plan, sometimes more. This is a jump from 4 to 6 GB in the spring of 2012. We have done nothing to justify such a huge surge in data usage per month,

  • Importing clips of all different shapes and sizes

    I'm completely new to final cut pro and in fact not a film person at all but audio so please be patient. What I'm doing is creating a film montage. The clips I'm compiling together happen to be a few different sizes of widescreen and then some full s

  • Hp deskjet 5550, fading print

    Trying to print out several pages the print fades with each one and by fourth page it just comes out white. Printing quality on first page also not up to scratch (seems to be thickened) but at least legible. When I try again hours later, having switc

  • Safari 5.1.10 cannot entirely block cookies?

    Hi, Using Safari 5.1.10 (on a MacBook Pro 10.6.8) I have not been able to stop Safari from collecting cookies. Even if I've selected 'always' in the 'preferences/privacy/block cookies' dialog box, they still get collected. On my previous MacBook/Safa

  • Query troubles

    I have a table in my database called message_builder. It is probably badly designed and looks like this message_builder(message_ID, sent_business_ID1, sent_business_ID2, sent_business_ID3) Another table business looks like this: business(business_ID,