Toplink Essentials: how can I not to auto persist computed/virtual column

Tags: Toplink Essentials, JPA, virtual columns
Hi All,
This appears to be a newbie question. But I cannot get it solved.
First, my system is Eclipse + TOPlink essentials.
My relational db table has a computed column. It is derived from a column of the same table.
create table WINE(
WINE_NAME VARCHAR2(25),
WINE_STORAGE_DATE DATE,
VINTAGE AS (EXTRACT(YEAR FROM WINE_STORAGE_DATE))
In my JAVA entity, I would like to map VINTAGE into a "auto-generated" field. In this way, when I update relational db table, VINTAGE won't be in the JPA generated INSERT statement, but I can query the VINTAGE into my java entity/object.
I tried the following JPA annotation in my java entity class.
@Entity
public class Wine implements Serializable {
@GeneratedValue private Integer VINTAGE;
I can query db table -- VINTAGE flows from db table to my java object. But when I update table ( I left VINTAGE un-specified ), I get the following error:
Internal Exception: java.sql.SQLException: ORA-54013: INSERT operation disallowed on virtual columns
Error Code: 54013
Call: INSERT INTO WINE(WINE_NAME, WINE_STORAGE_DATE, VINTAGE) VALUES (?, ?, ?)
     bind => PinotNoir, 2003-01-05 00:00:00.0, null
Any suggestions on what annotation tage I should use to tell the JPA Provider not to include VINTAGE in the auto-generated INSERT statement?
Thank you very much.
Jing
Edited by: user11935396 on Sep 25, 2009 1:36 PM
Edited by: user11935396 on Sep 25, 2009 1:37 PM

I am not sure if your annotation @GeneratedValue is proper. According to javadoc "Provides for the specification of generation strategies for the values of primary keys. The GeneratedValue annotation may be applied to a primary key property or field of an entity or mapped superclass in conjunction with the Id annotation."
I would rather try to annotate VINTAGE as @Column(insertable=false, updatable=false)

Similar Messages

  • How can i make it auto line alignment in ScriptUI?

    I want that form recognize new line character. (like '\n')
    So I programmed like this. But it's not working.
    var win =new Window ("dialog", "test");
    win.orientation = "column";
    var form1 = win.add ("edittext", undefined, "");
    form1.onChanging = function(){
      if(form1.text.search("\n") == true){
       form2.active = true;
    var form2 = win.add ("edittext", undefined, "");
    var form3 = win.add ("edittext", undefined, "");
    win.show();
    How can i make it auto line alignment in ScriptUI?
    Is it possible?

    Your answer is not exactely I want.
    But I got hint from your answer.
    All I want is "How I can split multilined text into dozen edittext field?"
    So I can make this from your sourcecode.
    Your answer is so helpful.
    Thank you.
    var win = new Window ("dialog", "test");
    win.orientation = "column";
    var charLen=30;
    var copytext = [];
    var form0 = win.add ("edittext", [0, 0, 150, 200], "", {multiline:true});
    form0.height = 100;
    var form1 = win.add ("edittext", undefined, "",{readonly:true});
    form1.characters = charLen;
    var form2 = win.add ("edittext", undefined, "",{readonly:true});
    form2.characters = charLen;
    var form3 = win.add ("edittext", undefined, "",{readonly:true});
    form3.characters = charLen;
    form1.active = true;
    form0.onChanging = function(){
        form1.text = form0.text.split('\n')[0]
    form2.text = form0.text.split('\n')[1]
    form3.text = form0.text.split('\n')[2]
    win.show();

  • HT5295 How can I stop the auto play feature automatically playing/streaming the next podcast?

    How can I stop the auto play feature automatically playing/streaming the next podcast?

    Hi there.
    I listened to podcast there were two things I found that helped me out. Both we're in the podcast app itself.
    Firstly change the default sorting order. When looking at the list off episodes a available on your ios device tap on the description part at the top, this will bring up the settings for that podcast (subscribe mark as played etc) scroll to the Bottom and select oldest first. This will mean that if you are listening to the latest download it will stop at the end as there will be no more to play.
    Secondly, and useful if listening to older podcasts in the list, you can use the timer to stop once the current episode has ended. To do this when you are in the podcast playback screen slide the "album artwork" up, revealing the playback options and nifty tape playing animation this is where you adjust playback speed and set a timer. The timer has a number of options to set playback to stop after set amount of time. However one of these options is to stop once the current episode you are listening to ends. This can also be current chapter if the podcast you are listening to supports chapters.
    Hope this helps, if not clear let me know

  • How can I stop the auto-saving of Pages version 4.1?

    How can I stop the auto-saving of Pages version 4.1?

    Why not just open your eyes !
    Under 10.6.8, we had two menu items :
    Save and Save As…
    Now we have a single Save…
    Since the first delivery of the macintosh,
    a menu item whose name ends with ellipsis is one which always open a dialog.
    Under 10.6.8 and older the Save button was used to save and already saved document without opening a dialog.
    If the document was never saved, it behaved as the Save As… one.
    With Lion the Save feature : save an already saved once document is no longer required as the system autosaved everything.
    There was no reason to keep this aspect of the Save item.
    Remaining tasks are those which were dedicated to the Save As… button.
    The engineers choose to drop one op the now duplicating items.
    The synthesis is the Save… item which clearly state what it is supposed to achieve.
    Triggering it, we may :
    change the name used to save
    change the destination folder
    export as .doc
    export as Pages '08
    Of course there is always the black triangle allowing us to use the stripped dialog or the full one.
    Yvan KOENIG (VALLAURIS, France) mardi 26 juillet 2011 12:15:06
    iMac 21”5, i7, 2.8 GHz, 4 Gbytes, 1 Tbytes, mac OS X 10.6.8 and 10.7.0
    Please : Search for questions similar to your own before submitting them to the community
    To be the AW6 successor, iWork MUST integrate a TRUE DB, not a list organizer !

  • How can I move movies from my computer to my iPad? They will play in quicktime but not iTunes

    How can I move movies from my computer to my iPad? They will play with quicktime but not iTunes so I can't sync them

    Th AVPlayerHD works well for playing other video types.  You can transfer the videos via USB in the app tab in iTunes on your computer.  When you open that tab when you have you iPad connected to the computer scroll down and you will see apps listed on the left and a blank on the right.  Click on the app and then click on the add button under the blank window on the right.  Then navigate to the video you want to play and it will transfer it to the iPad.  I have about 14 movies on mine using AVPlayerHD.  works very well.  Also have VLC player (before it was yanked from the app store).  Works about the same.
    You can also get the app Air Video and stream the video to from your computer to the iPad, and even have Theo ad connected to the tv to watch on there.  I do that all the time with my iPhone.  Saves time with not having to sync movies all the time.

  • How can I change my auto-correction language from english to french?

    My system language is english, so all the default language is also in english
    but how can I change the auto-correction language from english to french and without changing the menu language?
    Message was edited by: Marixomia

    It's just, I want to change my spelling checker from english to french, that when I type some words in wrong order or miss some, I can know that.
    For now, when I type in french, almost every words are underlined by the red lines...

  • How can i NOT include top level keyword in the metadata of an image?

    Hello,
    I want to know how can i NOT include top level keyword in the metadata of an image. I know there is an option for not applying a keyword to an exported image, but is there an option for not applying the top level keyword to the actual image?
    I have organized my geographical (by location) keywords like this:
    Places
    USA
    New York
    Miami
    Spain.
    If i add geographical keywords to all my images, all my images will have the keyword "Places", i dont think that it have any sence to have all your images with one keyword. How can i fix this? Any sugestion? i will appreciate it a lot any help or information that you could give me.
    Excuse my english, i know it is not good. I hope that you could understand me.
    Thanks,
    Marcelo :)

    Explicitly excluding a keyword only applies when "exporting". Unfortunately, there's currently no way to stop the keyword being written to the file when "Save Metadata to File" command is used. The natural reaction of users to this difference is to suggest that it is stupid. Nevertheless, there are good reasons why the difference exists:
    1. "Export" creates a new file whereas "Save Metadata to File" writes the metadata back into the existing file.
    2. There are very good reasons why certain keywords should not be written to file, and the example given in the OP is one. Saving metadata to file is more often used as means of backing up important image related metadata, independently of the catalog or allowing the metadata to be visible in other aplications. It would be rare that such a file would be shared with a third party, so the reason for not including certain keywords is less obvious. Actually, not including it can result in no end of confusion and grief. For example, if the top level (or any keyword) was excluded during the save metadata process then the other keywords would be orphaned when image is imported back into the catalog (e.g. buiding a new catalog).
    The development team are aware of the need, in some circumstances, to exclude certain keywords when save metadata command is used. How and when the issue is resolved, without adding even more confusion/complexity, is some way off.

  • How can I deactivate photoshop on a computer that is not working any more?

    How can I deactivate photoshop on a computer that is not working any more?

    Contact Adobe customer service:
    http://helpx.adobe.com/contact/
    Ken

  • How can I set up auto respond for email

    How can I set up auto respond for email?

    Hey there jimmac169,
    It sounds like you want to have the Mail app automatically reply to emails that come in. You can do this in the app itself, but in order for the function to work, Mail needs to be open. Take a look at this info from the following article:
    Mail (Yosemite): Reply to, forward, or redirect messages
    Automatically reply to or forward messages
    Mail must be open before it can automatically forward or reply to messages. If you want to send automatic replies when Mail isn’t open—like when you’re on vacation—check with the provider of your email account. 
    Choose Mail > Preferences, then click Rules.
    Click Add Rule, then type a name for the rule.
    Indicate whether any or all of the conditions must be true for the rule to be applied.
    Set the conditions that determine which messages to automatically reply to or forward.
    Choose options from the “Perform the following actions” pop-up menu.
    Forward messages: Choose Forward Message from the first pop-up menu, then enter the email addresses where you want to receive the forwarded messages. Click Message, then enter any text you want to include with the forwarded message. For example, you could explain that you’re automatically forwarding messages. 
    Reply to messages: Choose “Reply to Message” from the first pop-up menu, click “Reply message text,” then enter your reply. Mail includes the full text of the original message in your reply. 
    Click OK.
    Carefully consider the rules you create. If they’re too broad, messages can be sent inadvertently or create loops (replies to replies you sent). If possible, test the rules. 
    Thank you for using Apple Support Communities.
    All the very best,
    Sterling

  • How can I disable the auto resizing in NetBeans?

    Hello,
    how can I disable the auto resizing in NetBeans?
    I cannot resize nor displace components due to this automation.

    first what do u mean by auto resizing ? if u mean the layout that automatically aligns itself then ..... if that's yr question then u need to set the layout to null
    if using netbeans then right click on the the mainPanel and setlayout to null if eclipse the frame.getContent.setlayout(null);
    NetBean doesn't have a forum it has mailing list u can subscribe there
    http://www.netbeans.org/servlets/TLogin
    Edited by: raven_roy on Mar 12, 2008 2:58 AM

  • I have an amazing number of duplicates - not photo - but other.  How can I get rid of them?   Virtually all kinds if data is duplicated often 20- to 50 times. The duplicates are bot restricted to any one kind of data.

    I have an amazing number of duplicates - not photo - but other.  How can I get rid of them?   Virtually all kinds if data is duplicated often 20- to 50 times. The duplicates are bot restricted to any one kind of data.

    https://discussions.apple.com/message/25888564#25888564

  • How can I make my query to compare only columns of two tables... not the storage information?

    11GR2
    =-----------------------------------
    I am using below querry to compare two table that has same name, under two different users... But after making storage information false like below and  if the storage information is different on column level than it create "Alter modify " statements for the column ... How can I make my query to compare only columns of two tables... not the storage information?
    begin
    DBMS_METADATA.SET_TRANSFORM_PARAM(DBMS_METADATA.SESSION_TRANSFORM,'PRETTY', TRUE);
    DBMS_METADATA.SET_TRANSFORM_PARAM(DBMS_METADATA.SESSION_TRANSFORM,'SQLTERMINATOR',TRUE);
    DBMS_METADATA.SET_TRANSFORM_PARAM(DBMS_METADATA.SESSION_TRANSFORM,'SEGMENT_ATTRIBUTES', FALSE);
    DBMS_METADATA.SET_TRANSFORM_PARAM(DBMS_METADATA.SESSION_TRANSFORM,'STORAGE', FALSE);
    DBMS_METADATA.SET_TRANSFORM_PARAM(DBMS_METADATA.SESSION_TRANSFORM,'TABLESPACE',FALSE);
    DBMS_METADATA.SET_TRANSFORM_PARAM(DBMS_METADATA.SESSION_TRANSFORM,'CONSTRAINTS',FALSE);
    DBMS_METADATA.SET_TRANSFORM_PARAM(DBMS_METADATA.SESSION_TRANSFORM,'REF_CONSTRAINTS',FALSE);
    DBMS_METADATA.SET_TRANSFORM_PARAM(DBMS_METADATA.SESSION_TRANSFORM,'CONSTRAINTS_AS_ALTER',FALSE);
    End;
    select REGEXP_REPLACE(dbms_metadata_diff.compare_alter('TABLE','TABLE_NAME_A','TABLE_NAME_A','USER1','USER2'),('USER1...'),'', 1, 0, 'i') from dual

    I am using below querry to compare two table that has same name, under two different users... But after making storage information false like below and  if the storage information is different on column level than it create "Alter modify " statements for the column ... How can I make my query to compare only columns of two tables... not the storage information?
    If you want help you have to SHOW us what you are doing and how you are doing it; you can't just try to tell us in your own words.
    We can't see your computer screen.

  • How can one turn off auto-correct on safari?

    How can one turn off auto-correct on safari?

    Right click on a word  in an editable area.
    Then choose  Spelling and Grammar.
    Click "Correct Spelling Automatically" to remove the tick mark if it is on to disable the feature.

  • How can I turn off auto-renewal for subscriptions? I have been in the manage my account but I can't see any other option than to auto-renew?

    how can I turn off auto-renewal for subscriptions? I have been in the manage my account but I can't see any other option than to auto-renew?

    Follow the instructions in this article. You can turn off the auto-renewal on either your i-device or via iTunes on your computer:
    Manage your auto-renewing subscriptions - Apple Support
    Cheers,
    GB

  • How can I not use so much data?

    How can I not use so much data on my iPhone?

    http://9to5mac.com/2013/09/25/ios-7-how-to-monitor-track-your-cellular-data-usag e/
    https://itunes.apple.com/us/app/my-data-manager-track-your/id477865384?mt=8

Maybe you are looking for

  • Modifying the Breakdown Duration with the help of a BAPI

    Hi, I am using BAPI_ALM_NOTIF_DATA_MODIFY to modify a notification. This BAPI allows to modify everything but the Breakdown duration.Any idea why is that? Or is there a workaround? From a SAP Note it seems for MCI7 - Brekdown Analysis report would sh

  • Adobe PDF forms

    Hi all, Please help me out... In Adobe PDF forms, how should we assign master pages to body pages. Kindly give me the steps... in the Adobe LifeCycle Designer. Thanks in advance. Jaffer Ali.S

  • View and read pdf's on iPhone 3g

    how can i put pdfs on my iphone 3g (without emailing them because there to big) and read them? do i need any apps (free if possible) and how would i go about putting the pdf's on my iphone? thanks

  • Preloader Not Showing....

    I have a working preloader that I made. The preloader shows up fine if I go to the site through the published html file. The thing I want to do is make an image link and when you click that, have it open the swf file in a seperate window. I have done

  • Itunes keeps on freezing when synced

    WHY DOES It ... FREEEZE.. and how do I go back a version.. EVER Since updating to Vers. 11.1 or something.. It keeps freezing and I am tired of it!!!