How to declare Compound Foreign Key for CMR

Hi All,
I would like to know, is it possible to declare CMR field for Compound Foreign key.
Any Pointers would be appreicated.
Thanks
Ann.

Compound foreign keys are declared (when the relationships are used) in the sun-cmp-mappings.xml file, like this:
      <cmr-field-mapping>
        <cmr-field-name>actividadePeriodos</cmr-field-name>
        <column-pair>
          <column-name>ACTIVIDADE.COD_PROJECTO</column-name>
          <column-name>ACTIVIDADE_PERIODO.COD_PROJECTO</column-name>
        </column-pair>
        <column-pair>
          <column-name>ACTIVIDADE.COD_ACTIVIDADE</column-name>
          <column-name>ACTIVIDADE_PERIODO.COD_ACTIVIDADE</column-name>
        </column-pair>
        <fetched-with>
          <none/>
        </fetched-with>
      </cmr-field-mapping>The declaration is done in the parent of the relationship. The other configurations (in sun-cmp-mappings, ejb-jar and the entity code) are just the same as for simple foreign keys.
If the existing database relationships are not used in the app server (if there is no need for composite containment between the parent and the child), then the foreign keys don't need to be declared.

Similar Messages

  • How to create a foreign key for the table from two different tables?

    Hi All,
    I have a three table like below. In the below table SAMPLE_CONS_CHECK and SAMPLE_CONS2_CHECK will be having the primary key for NAME column. The same SAMPLE_CONS3_CHECK table also having the primary key for NAME column and forieign key for SAMPLE_CONS_CHECK and SAMPLE_CONS2_CHECK tables. See the below code 2
    code 1:
    CREATE TABLE SAMPLE_CONS_CHECK
            (NAME VARCHAR2(10),
            SERIES  VARCHAR2(5)
    CREATE TABLE SAMPLE_CONS2_CHECK
            (NAME  VARCHAR2(5),
             MODEL  NUMBER
    CREATE TABLE SAMPLE_CONS3_CHECK
            (NAME  VARCHAR2(5),
             MODEL_NO  NUMBER
            )code 2
    alter table SAMPLE_CONS_CHECK
    add constraint SAMPLE_CONS_CHECK_pk primary key (NAME)
    alter table SAMPLE_CONS2_CHECK
    add constraint SAMPLE_CONS2_CHECK_pk primary key (NAME)
    alter table SAMPLE_CONS3_CHECK
    add constraint SAMPLE_CONS3_CHECK_pk primary key (NAME)
    ALTER TABLE SAMPLE_CONS3_CHECK ADD
    CONSTRAINT SAMPLE_CONS3_CHECK_FK1 FOREIGN KEY
         NAME
    ) REFERENCES SAMPLE_CONS_CHECK
        NAME
    ) ON DELETE CASCADE;
    ALTER TABLE SAMPLE_CONS3_CHECK ADD
    CONSTRAINT SAMPLE_CONS3_CHECK_FK2 FOREIGN KEY
         NAME
    ) REFERENCES SAMPLE_CONS2_CHECK
        NAME
    ) ON DELETE CASCADE;From the above schenario i am able to insert the data to SAMPLE_CONS3_CHECK table. But the parent data is already available in the parent table. The problem is here two different constarints from two different tables. While inserting, it is checking from both the tables whether the parent is exist or not.
    How can i solve this problem? Can anyone halp me about this?
    Thanks
    Edited by: orasuriya on Aug 8, 2009 2:02 AM

    Actually the design is completely incorrect.
    What you say is
    I have
    'foo', 'foo series'
    'foo','foo model'
    'foo',666
    By virtue of table3 referring to both table1 and table2.
    This means you actually need to have 1 (one) table:
    'foo','foo series','foo model', 666
    And the 'problem' disappears.
    Sybrand Bakker
    Senior Oracle DBA

  • ABAP question: define a custom foreign key for a standard field??

    Hi,
    I want to use the field ADDR1_DATA-STR_SUPPL3 for customer use. I must to define a foreign key against a Ztable (as verification table) for this standard field. Also I must to define a custom search help.
    To defining a foreign key for this field, I must be in change mode, so the system ask to me for registering the object. That means this action is a modification. My question is the following: is there any way to do so without SAP standar modification??
    For instance, using BDT events...but how?
    Thanks in advance.
    Regards,
    Rosa

    Hi Rosa,
    Changing SAP Standard dictionary elements is not possible with out changing the same. To change these elements, we dont have any other method apart from SAP standard modification.
    Cheers
    Pavan

  • Enable foreign key for a custom field?

    Hi,
    In my mater table I have a custom field (lumpsum) which has been declared in pa0001 (as a include structure). The same structure has the description for this field.
    My requirement is to assign foreign key for this field to make use of joins in my table view. As this field was into a custom structure of PA0001, I couldnu2019t able to foreign key for this field.
    Please help it
    Regards,
    Vijay

    Hi Vijay,
    Sice it is designed for value check, a foreigh key refers to a TABLE.
    Regards,
    Laurent

  • How to create a account key for application type M ?

    Hi Guys,
    How to create a account key for application type M ? and link the same with
    Gl account.
    thanks.

    Hi
    Please create the account keys or transaction keys in
    SPRO-> IMG-> MM-> Purchasing-> Conditions-> Define Price Determination Process-> Define Transaction/Event Keys
    Thanks & Regards
    Kishore

  • How do I find the key for my time capsule router

    How do I find the key for my time capsule router

    Hello, see if these are of any help...
    http://www.iclarified.com/entry/index.php?enid=4547
    http://manuals.info.apple.com/en/TimeCapsule_SetupGuide.pdf
    If it's the Pre-Shared Key you're looking for, open Airport Utility, under the menu item Base Station, look for Equivalent Network Password.

  • Foreign Keys for a Logical Table

    Hi All,
    I want to know in which scenarios we create the Foreign Keys for a Logical Table. Once we create the foreign key for the logical table, does it mean that it will automatically override if any joins are there.
    Physical Table A, B ( no physical joins)
    Logical Table A, B (logical join B(Dim)-->A(Fact))
    created the foreign key in logical table A with B .(A.1=B.1)
    Will the rpd generate sql with A.1=B.1 join condition for reports.
    I tried to create the logical foreign key for logical table A, I could not see any corresponding table option.Here is its snapshot
    http://tinypic.com/r/jq1gkz/6
    Thanks,
    Virat

    In general when we go complex joins in Physical layer we go for Logical foreign key joins in BMM layer, best examples is SCD Type-II.
    Physical Table A, B ( no physical joins)
    -->You need to have a physical join so that this can be override by BMM layer
    created the foreign key in logical table A with B .(A.1=B.1) Will the rpd generate sql with A.1=B.1 join condition for reports.
    -->Yes you can see this join in BI Physical query.
    I tried to create the logical foreign key for logical table A, I could not see any corresponding table option.Here is its snapshot
    -->2 cases: 1)You need to delete existing logical joins 2) You might not have join in physical layer.
    Hope this helps
    Let me know for issues
    Edited by: Srini VEERAVALLI on Jan 18, 2013 1:29 PM
    BTW: You got very good name, why dont you update in your profile to see your name instead of some number
    Edited by: Srini VEERAVALLI on Jan 18, 2013 1:29 PM

  • How to retrieve the Foreign key information in Oracle

    I want to know how to retrieve the Foreign Key information in Oracle while using SQL Statement?
    I have use three SQL statement to retrieve such information, but the performance is very bad.
    The three SQL Statements are:
    Select constraint_name, r_constraint_name from all_constraints where constraint_type = 'R' and table_name = table1;
    Select column_name from all_cons_columns where constraint_name = cons1;
    Select table_name, column_name from all_cons_columns where constraint_name = r_ccons1;
    Do anyone know another method to retrieve the Foreign Key information which has better performance?

    These sql-statements don't seem very performance intensive. My guess is something is wrong with your database (unless you have millions of constraints). How many constraints do you have? how many concurrent users? What is your dictionary cach hitratio? (other hitratio?) memory problems? other tasks of the computer? is this query the only one being slow? etc.

  • How to change RSAPublicKeySpec to Key for encrypt?

    I have RSAPublicKeySpec and I want to encrypt message with this key.
    How to change RSAPublicKeySpec to Key for encrypt message?

    I try to do this
    try {
    kf = KeyFactory.getInstance("RSA");
    pk = kf.generatePublic(pubCard);
    catch (NoSuchAlgorithmException ex4) { System.out.println("1");
    catch (InvalidKeySpecException ex4) { System.out.println("2");
    try {
    Cipher cipher = Cipher.getInstance("RSA");
    try {
    cipher.init(Cipher.ENCRYPT_MODE, pk);
    catch (InvalidKeyException ex2) { System.out.println("a");
    try {
    ticket = cipher.doFinal(mes.getBytes());
    catch (IllegalStateException ex3) {System.out.println("b");
    catch (IllegalBlockSizeException ex3) {System.out.println("c");
    catch (BadPaddingException ex3) {System.out.println("e");
    catch (NoSuchAlgorithmException ex1) {System.out.println("f");
    catch (NoSuchPaddingException ex1) {System.out.println("g");
    It cougth exception that "NoSuchAlgorithmException"
    What wrong with line
    Cipher cipher = Cipher.getInstance("RSA");
    please tell me

  • HT3986 Does anyone know how to enable the "Delete" key for logging on the Windows 7 partition on the latest iMac, via the latest Apple wireless keyboard? Many Thanks

    Hi All
    Does anyone know how to enable the "Delete" key for logging on the Windows 7 partition on the latest iMac, via the latest Apple wireless keyboard - the standard wired apple keyboard works fine via this key but not the new wireless keyboard?
    Many Thanks

    Holy crap, this fixes the issue.  At least temporarily it has.  I should add that my issue was single finger forward/back swipe stopped working on the magic mouse in Firefox since Mavericks came along.  I have been fighting this since I upgraded to Mavericks a few months ago.  Thank you, tbirdvet.  You have no idea how much easier you just made using my iMac again.
    Message was edited by: wadems

  • How do I get license key for trial app, now that I have joined Creative Cloud ?

    how do I get license key for trial app, now that I have joined Creative Cloud ?

    after trying again, the signin process worked and activated my trial copy for me.

  • 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

  • How can I show Foreign Key name in the Data model Table window

    Hi,
    In one of my table, I had a Foreign Key, but that is not indexed. I want to display the name with in the table second window in realtional data model. If it is indexed, then it is showing in third window. How I can show without indexing that column?
    Thanks.

    I want to show Foreign Key name in the second window.
    Thank you for considering my question,
    Sundar

  • How to create a connection key for an intranet

    I'm trying to create a connection key for a client of ours to
    update a page on their intranet. The intranet is only available
    internally. How do I go about doing this?

    Hi
    Please create the account keys or transaction keys in
    SPRO-> IMG-> MM-> Purchasing-> Conditions-> Define Price Determination Process-> Define Transaction/Event Keys
    Thanks & Regards
    Kishore

  • How to customize the foreign key constraint exception

    Hi All,
    I have two table, A and B.
    B.ref is foreign key references to A.id in database.
    Now I want to delete a row of table A in screen, error messages are :
    "Constraint "xxx.xxxx_S_FK1" is violated during post operation "Delete" using SQL statement "DELETE FROM xxxxxx WHERE xxxxxxxxx" and "ORA-02292: integrity constraint (xxx.xxxx_S_FK1) violated - child record found"
    How do I customize this error message? Is it possible to do it in EO Validation?
    Thank you!

    You can override the DoDML() method in EntityImpl something like follows
    @Override
    protected void doDML(int i, TransactionEvent transactionEvent) {
    try
    super.doDML(i, transactionEvent);
    catch(DMLConstraintException _ex) {
    if(_ex.getErrorCode().equals("26048") ) {
    // handle your exception
    sid

Maybe you are looking for

  • How do I use my iPad with apple tv if my pc crashed and I can't access iTunes to turn on home sharing?

    I bought my husband an apple tv for Christmas but his pc crashed. He can't turn on homesharing on his iPad or access the iTunes store except on my computer (and he doesn't want to do that and sync with mine and lose all his data and apps). He wants t

  • Don't know where to turn, completely turned off by Verizon Wireless

    Father's Day 2014, I walk into a Best Buy to get a new iPhone as my 4S was broken.  I upgrade to a 5s and I am told my plan of unlimited data will remain in tact.  To my surprise, at the end of that billing cycle I get a text saying I am about to sur

  • Create return with reference to original sales order - pricing

    Hi I am using the function SD_SALESDOCUMENT_CREATE to create a return order with reference to the original sales order. All the information from the original sales order (including pricing conditions) I've read with the function BAPISDORDER_GETDETAIL

  • External dvd options

    is anybody using an external dvd dual layer burner with a mac mini with success and if so which one?? my superdrive has gone from system profile etc and i've been quoted £200 for a new logic board. everything else is fine i just can't burn or import

  • CR Svr 08 -XI3.0 -Refresh List of Values after BIAR import

    Hello I use Crystal Server 2008 When I import reports from BIAR file, the lists of values that the reports use are created, and can be viewed/edited through Business Views Manager, on the destination. The data that the LOVs contain is the data from t