How do I copy a dbsequence key from one entity to another

using the SRDEMO database as an exemple. I created a new table called BOOK. Book is a kind of product. THe primary key of book is the primary key of product. In jdev I created a new updatable entity based on book and a view combining product and book. The product ID gets generated by a trigger, as currently defined in srdemo db. When I run my view in the tester, the product id shows with a negative number, which is the expected behavior for dbsequence ID. The book ID is blank, which is also expected since its value must be copied from the product ID. Book ID is of type NUMBER. So I created a new create method in my viewImpl:
protected void create(AttributeList attributeList) {
System.out.println("in create prodview...");
Number no=this.getProdId().getSequenceNumber(); // get the generated prodid from the sequence
System.out.println("BookId="+no);
this.setBookId(no); // initialise book id with product id
Now when I run the tester I see the same negative number for productID and BookID, as expected. But when I commit my change I get a ORA-02291 on BookID. How do I get BookID initialize with the actual productID ? I'm using jdev 10.1.3.3
Edited by: yvesg2 on Oct 1, 2009 9:12 AM

How about this?
oracle.jbo.server.SequenceImpl sequence = new oracle.jbo.server.SequenceImpl("<Sequence_Name>(Eg. BOOK_ID_SEQ)", getDBTransaction()); // Name of the sequence in DB that generates your Book ID
        if(sequence != null) {
          int no = sequence.getSequenceNumber().intValue();
          System.out.println("BookId="+no);
          this.setBookId(no); // initialise book id with product id
       }-Arun
Untested

Similar Messages

  • How to programmatically copy a OneNote page from one section to another

    How to programmatically copy a OneNote page from one section to another.
    I don't find any interface in OneNote
    2010 Developer Reference which will let me do this.
    any help?
    Regards,
    Umar
    OneNote 2010

    Hi Umarinam,
    Thank you for posting in the MSDN Forum.
    In the page OneNote 2010 Developer Reference, you can see an Application Interface which includes methods
    help retrieve, manipulate, and update OneNote information and content. 
    The below are some basic samples 
    Retrieving Section Metadata in OneNote 2010
    Programmatically Opening and Closing a Notebook in OneNote 2010
    Hope it helps. 
    Best regards,
    Quist Zhang [MSFT]
    MSDN Community Support | Feedback to us
    Develop and promote your apps in Windows Store
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

  • How can I copy an iPhoto book from one Mac to another?

    I'm wanting to copy an iPhoto book from one MBP (OS 10.7.3) to another (10.8.3). Is there an easy way to do it?

    You will have to copy the entire iPhoto Library to the other Mac as the library is a virtual entity in the library recorece in the database files.
    Once it's been copied launch iPhoto with the Option key held down and select the libary in the window that appears.  I
    NOTE:  if the new Mac has  newer iPhoto version than the old Mac check to make sure it has the same theme that you used in the book.  There were some changes in themes from iPhoto 8 (09) to iPhoto 9 (11).  If your new iPhoto doesn't have the same theme you may want to complete the book on the old Mac.
    OT

  • How do I copy an art object from one document to another using illustrator API(C  )

    Hi, I'm trying to copy text and graphic elements from one document into another, does anybody has an idea how to do it using Illustrator SDK(C++)?
    Thanks in advance.

    If you call AIArtSuite::ReorderArt() giving the layer group handle from the target document and using art from the source document, it will move art between documents. That said, there are all sorts of caveats that come along with that -- some things move over automatically (graphic styles, symbols) while others cause problems. E.g. copying art that contains a swatch can cause a crash when you shut down the source document because it may keep the style reference to the swatch in the source document -- which goes away when the document is closed. Gradients in particular are a problem I believe. Straight up colours are (I think) fine. I've had to write a lot of workarounds for various headaches caused by moving art between documents.
    Bottom line: its very doable, but there are a lot of edge cases. This was clearly not an intended use of the SDK, though it is possible.

  • How do I copy an iMovie project from one computer to another (without using aliased files)?

    I followed the instructions at http://support.apple.com/kb/PH14745 to copy an event to one library to another.  The added library was accessed through a network share.  A new folder was created in the iMovie Library package, but the media files were all aliases to the media on the original computer.  Is there any way to actually copy the files and not have iMovie just create aliases?

    I think the trick is to 'Considate source media' on the new library.  See: 
    http://help.apple.com/imovie/mac/10.0/#mov882dee351
    Geoff.

  • How do I copy & transfer iPhoto library from one mac to another?

    I have a Power mac G5 and want to transfer a complete copy of my iPhoto 6 library (with all the specific albums) from my Power mac G5 to a new mac mini. I have an external drive. Is there a way to do this operation direct, between computers, or do I go through the external drive? Which do you recommend and how do I do this?
    After the copy transfer is completed, in the future, when I add new photos to my iPhoto library on my G5 and I want to transfer a copy of the new photos to the mac mini, do I follow the same process you outline above? Will the future copy transfer require I delete the library on the mac mini, and make a new complete copy transfer, or will a future transfer only pick-up the new photos?
    Thanks,
    HDP

    1 - connect the two machines together (a network or firewire target mode) quit iPhoto and drag the iuPhoto library from the old to th enew machine
    2 - alternatively you can connect the EHD to the old machine, drag the iPhoto library to it, move it to the new machine and drag the iPhoto library to the picturews folde on it
    3 - there is no way to sync the libraries - if the two are on a network you could use iPhoto library manager (only if both use the same version of iPhoto ) or use image capture to move the photo to the desktop from the camera and tehn impor tthem into both - but you can not automatically sync them you have to load the photos twice or use IPLM to do it
    ln
    Message was edited by: LarryHN

  • How i can copy my transport request from one system to another system

    hi,
    i want to copy all my code  means( programs,tcode,class,FM...every thing.) which is under a transport request, now i want to copy all this code same as it is in another system
    eg.
    i have all my objects in for example D10 now i want all my code in some another system for e.g in D30.
    how it is possible....

    Hi Vipin,
    Check tcode SE03 for transport related issues.
    as suggested by all the TR needs to be released from the current system to make it ready to be transported to next system.
    Once you release the request ask your basis administrator to transport the request to D30.
    <b>Before releasing the request check with the basis administrator if the target system has been set to D30.</b>
    Lokesh
    Message was edited by:
            Lokesh Aggarwal

  • How do i copy my iTunes folders from one user to another?

    i am setting up a duplicate user account on my MAC and wand to replicate my itunes folder and set up the same on my new user account as my original one.

    Before you change the country, note the following:
    - you must use any remaining store credit on your account
    - download all purchased content
    - ensure you have no current rentals(if you do, you'll have to wait for them to expire)
    - provide a new payment(such as a credit or debit card) associated with a valid billing address in the UK or an iTunes Gift Card purchased in the UK
    - content purchased from the iTunes Store is country-specific. If you wish to upgrade any of your iTunes Store content to iTunes Plus, you'll need to do this before you change countries. The content you purchased while your account was set to the previous country will not be eligible for upgrade once you've changed countries.
    - after you change countries, you will no longer receive application update notifications in iTunes for the apps you purchased in your original country. However, you'll still receive update notifications on your iOS device for any applications installed on it. In addition, you'll be able to download previously purchased applications again for free if they are available on your new country's store. You will not be charged and the download will not appear on your Purchased page. If a previously purchased application is not available in your new country, you will not be able to download it again for free.
    - If you have an iTunes Match subscription, you can't change countries until the subscription has expired.
    - If you have purchased a Season Pass, you cannot change the country associated with your account until that season is done airing and the last episode of the season has been added to the iTunes Store.
    Taking the above into consideration, here's how to change your country:
    1. Open iTunes and click Sign In.
    2. Enter your iTunes Store account name and password, then click Account Info.
    3. On the Apple Account Information page, click Change Country or Region.
    4. Enter the updated information and save your changes.

  • How can I copy a backup file from one computer to another?

    I want all of my app date, music, videos, ect to be on a new computer. Is it possible to back up my iPod Touch 3g on my old computer and copy the backup file onto the new computer? If so, how?

    Before your restoring your iPhone with your PC at work, you can create a backup of your iPhone on the PC before restoring.
    With your iPhone connected and available in the iTunes source list, control click on your iPhone and select Back Up.

  • How do I copy and paste pics from one event to another in iPhoto?

    I'm trying to copy and paste in iPhoto, but every time I get to the paste part nothing happens.  The word "paste" even appears on the screen, but it's grayed out. Any suggestions?

    Hi Mel,
    From the picture in your post, it seems that you are using SharePoint 2010 workflow platform.
    If that is the case, I recommend to use Copy List Item action to copy the current item to other lists instead.
    If you still want to use Create List Item action, could you please provide more details about the two steps in your workflow:
    I am not sure why you need to set the workflow variable to get the ID in the Checklist2.
    Best regards.
    Thanks
    Victoria Xia
    TechNet Community Support

  • How do you copy paste a thumbnail from one file to another in Mavericks

    I used to be able to do a copy/paste and duplicate in the thumbnails...how do I do now in Maverick?

    In the Pages and Numbers applications, the thumbnail view of my document no longer allows me to re-arrange, duplicate or otherwise edit the thumbnails. The fact that I can't right click on the thumbnails to manage the pages are one thing, but the fact that I can't even drag and drop the order of pages is unbelievable. Suggestions?

  • How to transfer/ copy data and setting from one iPhone to another

    Hi,
    I recently cracked the screen on my 3G iPhone and a have fortunately managed to convince the insurance company to pay for a new one.
    I'd like to be able to transfer all my contacts, apps aand setting to the new phone. Only problem is I have to give back the old phone to get the new one.
    Any advice much appreciated, and thanks in advance to anyone who spend time to help

    The iPhone is designed to be synced with the supported applications on your computer for contact info, calendar events, and bookmarks. To transfer iTunes content and photos from your computer to your iPhone requires syncing with iTunes. Photos captured by your iPhone should be imported by your computer as with any other camera. The imported photos can be transferred back to your iPhone via the iTunes sync process.
    iTunes also creates and maintains a backup of your iPhone that includes data such as most iPhone settings, email account settings, SMS messages, notes, recent calls, call favorites, 3rd party app settings and data created and stored by 3rd party apps, contact info, and photos captured by your iPhone - but not a good idea to depend on the backup only for the last 2. Sync contact info with a supported application on your computer and import photos that were captured by your iPhone before giving up your iPhone. You can restore your new iPhone from your existing iPhone's backup followed by a sync.

  • How do I copy an address book from one user account to another?

    How do I copy an address book from one user account to another?

    You haven't understood me. Follow these steps:
    1. Log in the user where are the files you want to transfer, and open a Finder window.
    2. In Finder, select Go menu (on the menu bar) > Go to Folder, and type /Users/Shared. Now you're on Shared folder, so leave that window.
    3. Open a new Finder window without closing the old one, go to the folder with the files you want to transfer, and copy them to Shared folder.
    4. After copying the files to Shared folder, go to  > Log Out, and log in the other user.
    5. Repeat the step 2, and you will get access to the transferred files. Now, you can open them directly from this folder, or you can copy them to a folder on your user folder

  • How do i transfer my itunes library from one macbook to another?

    hi,how do i transfer my itunes library from one macbook to another?

    From your OLD computer...
    Copy your ENTIRE iTunes FOLDER to an External Drive... and then from the External Drive to your New Computer..
    Full Details Here  >  http://support.apple.com/kb/HT1751
    An Added Bonus is that you will have a Backup of iTunes.
    Also... have a look at these 2 Videos...
    http://macmost.com/moving-your-itunes-library.html
    http://macmost.com/moving-your-itunes-media-to-an-external-drive.html

  • How do I transfer my checked songs from one computer to another - tried exporting library playlist etc but no luck! Please help! I have 26,000 songs - 17,000 are selected and I can't run down the list on my new computer and re-check 17,000 songs! Thanks!

    How do I transfer my checked songs from one computer to another - tried exporting library playlist etc but no luck! Please help! I have 26,000 songs - 17,000 are selected and I can't run down the list on my new computer and re-check 17,000 songs! Thanks!

    Make a smart playlist of your whole library but only checked songs - #4 on  http://support.apple.com/kb/ht1801
    Highlight all files in that playlist, then drag to the other drive.  This isn't preserving any playlists or whatever, just copying files from one drive to another.
    You might want to delete the smart playlist this once you are done because it will probably gobble up resources with that many files.

Maybe you are looking for

  • How do I customize the look of my JTable in a scrollable pane

    When I have a JTable in a scrollable pane, there is an annoying blue border that I want to get rid of. I would also like it if, even if there are no entries in the table, the column heads would still show up. Finally, I want to change the background

  • Tab getting overwritten in excise invoice tab in migo

    Hello all, i have a doubt , i have added a custom tab at header level in migo but that tab is getting overlaped when excise tab is coming ie that tab is getting overlapped under excise invoice tab. please help me necessary solution if possible please

  • Utf-8 format

    hi every one, i want to create an xml file from my forms 6i application, i create the file but forms 6i save it as ANSI file, but i want to save it as UTF-8 format, but with TEXT_IO package i don't know if it's possible to do that, can any one help m

  • Disable bluetooth Secure Simple Pairing (ssp)

    Hi, I have an old Bluetooth headset (Z-W88), which cannot be paired in Windows 7 - it shows a code and it asks me to compare it to the one on the headset. No matter how I respond to the question (yes or no), the pairing fails. I figured it out that m

  • Changing providers

    I am thinking about switching carriers to Sprint, but I was told that I would not be able to switch my blackberry to them...Is this true?  Will I have to buy a new blackberry just to change providers or can my blackberry be reconfigured to work with