Exception: non-read-only mapping defined for the primary key field

Hello.
I'm new to Oracle and I created Java EE Web Project.
And I created entities from tableA, tableB, tableC from my database.
tableA has foreign key to tableB and has unidirectional Many-to-One relationship. tableC has two primary keys and one of these is foreign key to primary key in tableA. tableC also has unidirection Many-to-One relationship to tableA.
Then I created session bean and data control from it, in design window, created read-only table from tableA.
And I selected columns in tableA and also in tableB.
I ran the application and saw the following exception in log window.
Local Exception Stack:
Exception [EclipseLink-46] (Eclipse Persistence Services - 2.1.3.v20110304-r9073): org.eclipse.persistence.exceptions.DescriptorException
Exception Description: There should be one non-read-only mapping defined for the primary key field [tableC.tableA_ID].
Descriptor: RelationalDescriptor(mypack.tableC --> [DatabaseTable(tableC)])
tableA_ID is a primary key in tableA.
How can I solve this error?
Please help me.
Edited by: 900471 on 2011. 12. 3 오전 5:32
Edited by: 900471 on 2011. 12. 3 오전 5:33
Edited by: 900471 on 2011. 12. 3 오전 5:33
Edited by: 900471 on 2011. 12. 3 오전 5:34

There are not enough details to be sure since you have not provided the mappings. From just the error, it looks like you are using the tableC.tableA_ID field as the foreign key in the ManyToOne relationship to A, but have marked it as insertable=false, writeable=false, meaning that it cannot be updated or used for inserts.
Either make it writable (set the settings to true), or add another basic mapping/attribute in the entity for TableC that maps to the field which you can use to set when you insert a new tableC entity. A simple example is available at
http://wiki.eclipse.org/EclipseLink/Examples/JPA/2.0/DerivedIdentifiers
Best Regards,
Chris

Similar Messages

  • For the Primary Key Field with the combination of other fields

    Hai
    I Have a problem in creating trigger for the following
    the problem goes like this..
    i have a table with the fields
    fld1 (varchar2(6) fld2(varchar2(20)) fld3 (number)
    the fld1 is a primary key.
    here in this table i am inserting the values ..
    At the time of inserting the fld1 should get the part value of fld2
    say if new value for fld2 is "SAM & CO" then
    it should take the first letter and then followed by the sequence..
    i.e., the fld1 is the combination of a
    letter + firt letter of the fld2 + sequence
    fld1 fld2 fld3
    CS001 SSSSS 324234
    CP001 PPPPP 5345435
    CS002 SSSS 53543543
    Here the Sequence should vary depending on the alphabet of the fld1
    if P the the Sequence should be the next number of fld1 to P
    i.e.,
    if i add the value like this
    insert into tname(fld2,fld3) values('PQQQQ',34343)
    then it should be inserted as
    CP002 PQQQQ 34343
    I need the solution for this..
    Thanx
    Gaya3
    thanx
    gaya3

    There are not enough details to be sure since you have not provided the mappings. From just the error, it looks like you are using the tableC.tableA_ID field as the foreign key in the ManyToOne relationship to A, but have marked it as insertable=false, writeable=false, meaning that it cannot be updated or used for inserts.
    Either make it writable (set the settings to true), or add another basic mapping/attribute in the entity for TableC that maps to the field which you can use to set when you insert a new tableC entity. A simple example is available at
    http://wiki.eclipse.org/EclipseLink/Examples/JPA/2.0/DerivedIdentifiers
    Best Regards,
    Chris

  • Message no.8Z876 No time base defined for the revaluation key -Problem ABAW

    Hello,
    I have a problem... I have a revaluation area (04: in local currency) and a parallel revaluation area (05: in hard currency) and I have to revaluate an asset, but I couldn't with Tx ABAW. The error is :
    Message no. 8Z876 No time base defined for the revaluation key
    I checked the configuration and I think it's all ok. I did some tests and I could revaluate only the Area 04 (local currency). Example:
    Area 04: 500000 PEN
    Area 05: 0 USD.
    But this is a big problem for example when I make a transfer the asset to other because the revaluation Area doesn't transfer.
    Can anybody please tell me how resolve this?
    Regards,
    Fernando
    PD: I'm so sorry for my grammatical errors, I'm spanish speaker

    Hi
    The error
    message 8Z 876 can be shown for two basic things:
    1. TBE (Time Base exposure variant) is not maintained.
       Please check if any time base is maintained for the revaluation key.
    And if it have all the intervals correctly defined and the post flag
    marked for the months required to calculate revalaution.
       If it is maintained please check if the last revaluation date is
    filled in your revaluation areas. If the last revaluation date field is
    blank, the time base must have the following entry: 31.12.XXXX-1 where
    XXXX is the current fiscal year (for ABAW).
    2. In the ABAW transaction itself you are trying to post values to any
    of the parallel areas defined in the chart of depreciation.
       In transaction ABAW (or AB01) do not post any amount to parallel
    areas. The posted values should be equal to zero.
       The values in hard currency will never be revaluated by the inflation
    program. If this is the case, please enter manually only zero values as
    "Amount posted" in those parallel areas.
    If by some specific reasons you still plan to post (manually) to these
    parallel areas, you will get error message 8z876 in accordance to your
    explanation of the problem.
       To allow posting of non-zero amounts to these areas, you need to
    create Revaluation Key NULO. To do this, go to the customizing system
    IMG (transaction SPRO) according to the link:
    IMG -> Financial Accounting -> Asset Accounting -> Special Valuation ->
            Revaluation of Fixed Assets -> Revaluation for the Balance Sheet
            -> Inflation -> Maintain Revaluation Keys
    Create new entry (click F5) for key with name NULO, And save data
    (Ctrl+S).
      Please, adjust your customizing in accordance with the instructions
    above.
    Best Regards,
    Blaz

  • No User Mapping Defined for the system

    Hi,
    I am trying to create the transcation iView ,here in this i want to run the BW transcation..
    For this i have created the transaction iView with the transaction code in that iview properties i have given the system alias which i have created for the BW system..
    The system which i have created for this is SAP R/3 dedicated...
    when i try to see the preview for this transaction iview it is giving the Error"No user Mapping defined in the system...
    i have done the user mapping also...
    Plz can any one help me in this..
    useful solution will be rewarded...
    Thanks
    Shashank
    Message was edited by: shashank moharana

    Hi Shashank
    the follwoing is total soln for connect EP AND BW and for ITS as well as SSO
    <b>Creating BW system in Portal</b>
    From the portal top-level navigation, choose System Administration -> System Configuration -> System Landscape
    Navigate to Portal Content -> Your SAP Ssytem  Folder  i.e SAP BW
    Right-click on the SAP BW folder, then choose New -> System
    Select SAP system using dedicated application server
    from System Template
    Make the following entries for the BW system you want to connect to the Enterprise Portal
    System Name -
      SAP_BW
    System ID   -
      Any ting u want like SAP_BW or SID of BW
    System ID Prefix -
      com.mycompany
    Master Language  -
      English
    Description   -
    NEXT -> Summary, review the options you selected for the new page.To make changes, choose Back to return to the appropriate screen. Then choose Next till you reach the Summary page, review, and choose Finish
    Choose Open the object for editing and choose OK
    The Property Editor iView will open
    Select Connector in the Property Category dropdown
    Enter the fields below according to your SAP system
    Application Host -
      IP Address of BW system or Host name ( FQDN required for SSO )
    SAP Client  ---  BW system client
    SAP System ID -
    SID of BW
    Server Port -
    3200 default for system number 00
    SAP System Number -
      00 or ur instance number
    <b>System Type  -
      SAP_BW</b>
    NOW,
    Select User Management from the Property Category dropdown list
    Enter the fields below
    Logon Method -
         UIDPW
    User Mapping Type  ---     Admin,user
    Note -: IF u want to use SSO for BW system first selct above and test it with BW system if it's ok than change to following
    Logon Method -
         SAPLOGONTICKET
    User Mapping Type  ---     Admin,user
    choose SAVE.
    Select System Aliases in the Edit dropdown list. This opens the System Alias Editor
    In Alias, enter SAP_BW. Choose the Add button
    Choose Save to save your changes and close the page
    <b>Connect With ITS</b>
    For BW
    In Property Catalog, use the dropdown to select ITS.
    Set your SAP system properties according to Following
    ITS Description -
      Description
    ITS Host Name  -
      Host name : Port for BW system
    <b>If u want to use SSO use FQDN instead of host name</b>
    ITS Path -
    /scripts/wgate
    ITS Protocol -
      http
    Save your settings.
    <i>u can check its for BW by following
    Find a port for BW using IIS manager
    Administrator tools -> Internet Service Manager - >
    extend the HOST
    Find the site created for BW system same like SID of BW system -> right click -> Properties
    TCP Port -- this is used for ur BW system</i>
    in IE  http://host_for_its:Port_for_bw/scripts/wgate/webgui/!
    <b>WAS for BW System</b>
    Select Web Application Server (WAS) in the Property Category dropdown list
    WAS Description  -
    BW WAS
    WAS Host Name -
      Host name : Port for BW system
    <b>use FQDN for SSO</b>
    WAS Path -
    /SAP/BW/Bex
    WAS Protocol -
    http
    Save ur entry.
    <b>User Management  For BW and EP</b>
    Befor u start if u don't use SAP Secu lib during installation
    change the following
    system Administration -> System configuration -> Um configuration -> Direct editing
    find out follwoing
    ume.usermapping.unsecure=False
    change to
    ume.usermapping.unsecure=TRUE
    Save and restart portal server
    ther are so many option available for DATA source u have required doc for using that
    if u have any query for that msg me back
    <b>Mapping Users in the Portal</b>
    if u want to use UIDPW than user must be map to BW system
    go by following
    User Administration -> User Mapping
    select the user u want to map by serch or entering a name
    Choose the Alias for your backend system, for example SAP_BW
    Enter the user id and password for BW user
    save ur changes.
    <b>SSO configuration</b>
    make sure ur Portal ITS and BW WAS system belong to Same
    domain.
    i.e 
    portal.mycompany.com
    its.mycompany.com
    bw.mycompany.com
    if not, u can do by creating a alias into host file for corresponding system
    for SSO follwoing parameter must be set in profile parameter using RZ10 in BW system
    login/accept_sso2_ticket  -
      1
    login/create_sso2_ticket  -
      1
    login/ticket_expiration_time  --- desired value default 60
    now download the portal certificate form follwoing
    System administration -> System configuration -> Keystore
    Administration
    donload verify.der file save it it's like verify.der.zip
    extract it than u can get verify.der
    now in BW system using trans.  STRUSTSSO2
    in the certificate section choose import certificate
    choose the file tab enter the path of the portal's verify.der file
    set the file format to DER coded
    in the trust manager choose ADD to PSE and Choose
    ADD to ACL
    in the dialog box enter the portal system's id (SID) and client
    by default portla system ID is the common name (CN) and client is 000
    save ur entry and restart the BW server
    this are the basci configuration if u have any query related to it msg me back
    regards,
    kaushal

  • How to display the Primary key field in Application Form.

    IDFINALNO , USERNAME
    (No view) , RockQin
    I developed one new application form which is including the "Edit" item in every record.
    But I can not find the data that is Primary key field . So how to config the property to display that data.
    Thanks a lot!

    One of the guidelines when selecting column for a primary key is:
    Choose a column whose data values are never changed. A primary key value is only used to identify a row in the table, and its data should never be used for any other purpose. Therefore, primary key values should rarely or never be changed.
    Cheers!

  • Is it possibel to update the primary key field

    hello
    i want to ask is it possible to update the value of primary key filed ?

    784633 wrote:
    hello
    i want to ask is it possible to update the value of primary key filed ?What does it take to test for yourself?
    I threw this together in about 90 seconds:
    SQL> CREATE TABLE MYPKTEST
      2       (
      3        MYPK VARCHAR2(5),
      4        MYOTHERSTUFF VARCHAR2(5),
      5  PRIMARY KEY (MYPK) VALIDATE
      6       );
    Table created.
    SQL> --
    SQL> insert into mypktest values
      2       ('abcde',
      3        'vwxyz'
      4       );
    1 row created.
    SQL> --
    SQL> select * from mypktest;
    MYPK  MYOTH                                                                    
    abcde vwxyz                                                                    
    SQL> --
    SQL> update mypktest
      2  set mypk = 'fhgij'
      3  where mypk= 'abcde';
    1 row updated.
    SQL> --
    SQL> select * from mypktest;
    MYPK  MYOTH                                                                    
    fhgij vwxyz                                                                    
    SQL> spool off

  • How to pass values for compound primary keys for updating the record in db.

    i have a entity bean in my ejb with two primary keys to it...eg. roleid,rolename...
    when iam retriving the record i use only one primary key ...so again to modify and update he same record which i retrived is a pbm..
    i cannot set the values for the compoundpk,,,
    but i can do the update for the bean with single primary key..
    i need to know how to pass the values/parameters for the coumpound primary key in my update method...
    thanx in advance...
    Arjun.G

    I istantiated a object for the pk class and assign the values for the primary key fields...
    Arjun.G

  • No configuration is defined for the entry BIWGMLQuery error

    Error Summary
    Hi,
    When I use the WebDynpro compiler, it compiles and deploys without error.  However, when I attempt to run the model in WebDynpro, I get the attached error message.
    It is imperative that we be able to use the Flash compiler going forward, rather than WebDynpro.
    See attached error message.
    While processing the current request, an exception occured which could not be handled by the application or the framework.
    If the information contained on this page doesn't help you to find and correct the cause of the problem, please contact your system administrator. To facilitate analysis of the problem, keep a copy of this error page. Hint: Most browsers allow to select all content, copy it and then paste it into an empty document (e.g. email or simple text file).
    Root Cause
    The initial exception that caused the request to fail, was:
       com.sap.tc.wd4vc.intapi.info.exception.WD4VCRuntimeException: No configuration is defined for the entry BIWGMLQuery
        at com.sap.tc.wd4vc.xglengine.XGLEngine.createComponentInternal(XGLEngine.java:559)
        at com.sap.tc.wd4vc.xglengine.XGLEngine.getCompInstanceFromUsage(XGLEngine.java:362)
        at com.sap.tc.wd4vc.xglengine.XGLEngine.getCompInstance(XGLEngine.java:329)
        at com.sap.tc.wd4vc.xglengine.wdp.InternalXGLEngine.getCompInstance(InternalXGLEngine.java:167)
        at com.sap.tc.wd4vc.xglengine.XGLEngineInterface.getCompInstance(XGLEngineInterface.java:165)
        ... 52 more
    Thanks,
    Visshwas

    Here i have attached the error messages.
    [http://tinypic.com/view.php?pic=2z4l6xi&s=5]
    [http://tinypic.com/view.php?pic=fjjpc3&s=5]
    Please help.
    Regards,
    Visshwas

  • No configuration is defined for the entry BIRGMLQuery

    Hi:
    I´m working with VC EHP1 SP4. I have my VC Iview working ok with a BI_Query with Compile Runtime=flash but when I change the compiler runtime to Webdynpro the following error is display at runtime::
    com.sap.tc.wd4vc.intapi.info.exception.WD4VCRuntimeException: No configuration is defined for the entry BIRGMLQuery
    I search all over SDN and marketplace but I can´t find where I have to do the configuration for the  BIRGMLQuery.
    Thanks a lot for your time.
    Rocío.

    Needed anymore

  • How do I obtain the next number for a Primary Key using an ADF View Object?

    I have two separate View Objects (A & B) for the same Entity Object. View Object A does a SELECT on all of the fields in the table. This View Object is where I execute my adds and updates. View Object B is only used to retrieve the next number for the primary key. This is done so that when I add a row to the database, I always get the max number of the primary key and add one to it. I accomplished this by setting the SQL mode to Expert and using the SQL: "SELECT MAX(NBR) AS MAX_NUMBER FROM TABLE_1". This may be overkill having a seperate View Object for this, but so far this is the only way I have found to obtain the next number. However, I have discovered that this way does not always work.
    The problem I'm running into is when I try to add multiple records to View Object A without committing the transaction between each add. Because View Object B is disconnected from View Object A, the MAX_NUMBER of View Object B comes back with the same number for each add I do on View Object A. So I know I must retrieve the MAX_NUMBER from View Object A.
    I've tried using the following code in my Table1ViewImpl class:
    this.setQuery("SELECT MAX(Table1.NBR) AS MAX_NUMBER FROM TABLE_1 Table1");
    this.executeQuery();
    The view object now has what I want, but I have yet to figure a way to extract the MAX_NUMBER out of the View Object. I've also looked into using the method addDynamicAttribute() but I can't figure out any way to set the attribute with the MAX_NUMBER.
    I can't be the only one trying to retrieve the next number from a database table using ADF. Can anyone help me with this? FYI - I'm using JDev 10.1.3 EA.

    You missing the point.
    On a multi-user db knowing the next highest number doesn't guarantee the number will be available when it comes time to commit the record. You can prove this to yourself by opening two instances of your app and do whatever you do to add a new record to your VO. Both will assume the same number, and when you commit an error will be generated
    You must use sequences to avoid the possibility of duplicate keys. If you are trying to avoid gaps in your numbering then you need to convince yourself why this is necessary.

  • How to change the source type for a primary key on a form?

    Hi,
    At the time of creating a form, I had set the source type for the primary key to an existing sequence.
    Now I want to change the source to a trigger.
    Can anyone suggest how to do it?
    Thanks in advance,
    Annie

    Annie:
    Define the trigger and then delete the page process named 'Get PK'
    Varad

  • Knowing the Primary Key Sequence Generator of a table

    Hello All,
    I'm working on an application that uses Oracle toplinks/JPA for persistence. The entity classes in the application have primary key fields with annotations @Id and @GeneratedValue(strategy = GenerationType.AUTO). Per our understanding, this means the primary key generation is done by JPA/Top-links. When we see our database, we notice only one SEQUENCE table available and that table has only one row, while in the application, we are getting different sequence numbers for the primary key of each entity. So, not clear on how this sequence number is generated. Could anybody share information on where the sequence number is stored for each entity/table? Really appreciate your help here. Our database is MSSQL.
    Thank you,
    Venkatesh

    EclipseLink/TopLink uses Table sequencing for GenerationType.AUTO because it is more portable between databases. My understanding of your issue is from
    http://en.wikibooks.org/wiki/Java_Persistence/Identity_and_Sequencing#Table_sequencing
    Each row in the table represents one sequence generator, and your entities are all using the same default sequence generator and so all use the same row.
    To use multiple rows I believe you need to define multiple TableGenerators.
    Best Regards,
    Chris

  • Using a custom PL/SQL to populate the primary key in a tabular form

    I want to use a Custom PL/SQL Function to populate the primary key when I insert a new record into a tabular form. I want to get the value from a hidden page Item. The code I am using for the primary key source is:
    BEGIN
    INSERT INTO TEAM_MEMBERS(TEAM_ID)
    VALUES(:P75_TEAM_ID);
    END;
    When I try to insert a new record I get the following error:
    Error      ERR-1904 Unable to compute item default: type = Function Body computation_type= BEGIN INSERT INTO TEAM_MEMBERS(TEAM_ID) VALUES(:P75_TEAM_ID); END; .
    ORA-06550: line 5, column 2: PLS-00103: Encountered the symbol ";" when expecting one of the following: begin case declare end exception exit for goto if loop mod null pragma raise return select update while with << close current delete fetch lock insert open rollback savepoint set sql execute commit forall merge pipe The symbol "exit" was substit
    Any ideas what I am doing wrong?
    Thanks!

    Brian - Sometimes whitespace at the end of the block causes this. Be sure to trim everything after the last semicolon including tabs and newlines.
    Scott

  • How can we export the Primary key values (along with other data) from an Advantage database?

    One of our customers is moving from our application (which uses Advantage Database Server) to another application (which uses other database technology). They have asked us to help export their data, so that they can migrate it to another database system. So far, we have used the Advantage Data Architect (ARC32) "Export Table Structures as Code" functionality to generate SQL. We used the "Include existing data" option. The SQL contains the necessary code to recreate the tables and indexes. The customer's IT staff will alter the SQL statements as necessary for their new system.
    However, there is an issue with the Primary Keys in these table. The resulting INSERT statements use AutoInc as the type for the Primary Key in each Table. These INSERT statements contains "DEFAULT" for the value of each of these AutoInc fields. The customer would like to output an integer value for each of these Primary Key values in order to maintain referential integrity in their new system.
    So far, I have not found any feature of ARC32 that allows us to export the Primary Key values. We had been using an older version of ARC32, since our application does not use the latest version of ADS. I did download the latest version of ARC32 (11.10), but it does not appear to include any new functionality that would facilitate doing this sort of export.
    Can somebody tell me if there is such a feature in ARC32?
    Or, is there is another Advantage tool to facilitate what we are trying to accomplish?
    If there are no Advantage tools to provide such functionality, what else would you suggest?

    George,
      It sounds like the approach you are using is the correct one. This seems to be the cleanest solution to me especially since the customer is able to modify the generated SQL statements for their new system.
      In order to preserve the AutoInc values I would recommend altering the table and changing the field datatype from AutoInc to Integer. Then export the table as code which will export the actual values. After the tables have been created on the new system they can change the field datatype back to an AutoInc type if necessary.
    Regards,
    Chris Franz

  • Creating a script for a PRIMARY KEY USING INDEX SORT doesn't work

    Probably a bug.
    h1. Environment
    Application: Oracle SQL Developer Data Modeler
    Version: 3.0.0.655
    h1. Test Case:
    1. Create a new table TRANSACTIONS with some columns.
    2. Mark one of numeric columns as the primary key - PK_TRANSACTIONS.
    3. Go to Physical Models and create new Oracle Database 11g.
    4. Go to Physical Models -> Oracle Database 11g -> Tables -> TRANSACTIONS -> Primary Keys -> PK_TRANSACTIONS -> Properties:
    a) on General tab set Using Index to BY INDEX NAME
    b) on Using Index tab choose a tablespace
    c) on Using Index tab set Index Sort to SORTED.
    5. Export the schema to DDL script. For the primary key you will get something like this:
    ALTER TABLE TRANSACTION
    ADD CONSTRAINT PK_TRANSACTION PRIMARY KEY ( TRAN_ID ) DEFERRABLE
    USING INDEX
    PCTFREE 10
    MAXTRANS 255
    TABLESPACE TBSPC_INDX
    LOGGING
    STORAGE (
    INITIAL 65536
    NEXT 1048576
    PCTINCREASE 0
    MINEXTENTS 1
    MAXEXTENTS 2147483645
    FREELISTS 1
    FREELIST GROUPS 1
    BUFFER_POOL DEFAULT
    ) SORTED
    h1. Reason of failure
    The script will fail because SORTED is not allowed here. It should be SORT.
    Additionally, the default behaviour for Data Modeler is to set Index Sort to NO but default setting for Oracle database 11g is SORT. Shouldn't Data Modeler use SORT as the default value?
    Edited by: user7420841 on 2011-05-07 03:15

    Hi,
    Thanks for reporting this problem. As you say, it should be SORT rather than SORTED. I have logged a bug on this.
    I also agree that, for consistency with the database default, it would be better to have SORT as the default in Data Modeler.
    David

Maybe you are looking for

  • Downloading Raw Images into Aperature

    This topic has to do with getting Raw images into Aperture and not the application it's self. There happens to be several ways to download images from a memory card (from the camera to the USB port, from a card reader to the USB port, from a card rea

  • Using Proteus X with a midi sequencer - VST work around

    I got Proteus X with the X-board 61. I've been trying to use it with Cubase. First it took me a while to figure out that Proteus X has to be used with a sequencer using VST you can't just select it as a midi device. Am I wrong here? I really can't be

  • How can I keep the cookie history for one website while not allowing it for others?

    My privacy setting is set to clear history, cookies, etc whenever I close out of Firefox. As a result, one website I use frequently re-asks security questions after I log-in even though I tell it that it should remember and recognize my private compu

  • ICal, Skype and Mail with problems

    Hi! I need some help about a problem related my iCal and others softwares as Skype and Mail which use a customized numeric system (iCal while changing the days or Skype and Mail while receiving any new message in the red splash...). The problem is th

  • I can't install the Folio Producer tools

    I can't install the Folio Producer tools  And   Error message  is "  Insert the CD-ROM  "??? Anybody having the same problems? Thanks~!