Composite Foreign Key Relationships

I'm having problems defining relationships that are using the same set of fields in a composite primary key and a composite foreign key. Are there any examples for doing this kind of thing. I think I have the primary keys set up correctly but the foreign key defs aren't working yet. From the spec it looks ike it should be something like this:
@ManyToOne
     @PrimaryKeyJoinColumns({
     @PrimaryKeyJoinColumn(name="CGMTI_ID"),
     @PrimaryKeyJoinColumn(name="MISSION_REF_DATE")})
     CgmtiHeader cgmtiHeader;
Also, the composite foreign keys seem to make Dali's entity generation blow up.

This mapping is missing the referencedcolumn definition, and because it is a composite pk, it cannot figure out a default value. So it should similar to:
@ManyToOne
@PrimaryKeyJoinColumns({
@PrimaryKeyJoinColumn(name="CGMTI_ID", referencedColumnName="CGMTI_ID),
@PrimaryKeyJoinColumn(name="MISSION_REF_DATE", referencedColumnName="MISSION_REF_DATE)})
CgmtiHeader cgmtiHeader;
Similar discussions exist in threads:
Extra Columns in ManyToMany table workaround
and
http://forums.java.net/jive/thread.jspa?threadID=2564&messageID=36441
both of which list blogs showing examples.
Best Regards,
Chris

Similar Messages

  • Composite foreign key, LOV, WSG, Designer 6i

    Hello,
    I have one composite foreign key that consists of 3 columns,
    which belongs to three different tables (there are
    master-detal-detail relationships between those 3 tables). Let's
    call those tables A, B and C.
    Now, I'd like to generate wsg module (based on table D) that has
    all three columns displayed. Also, I'd like to generate three
    dependant LOVs in such way that I am able first to select row
    from table A using first LOV. Second LOV should display rows from
    table B, but only those rows that are in context of A. Similary,
    third LOV should display rows from table C, but only rows in
    context of B.
    Is there any way to this in Designer 6i Release 4 ? This way
    default behaviour in Designer 2.1.2 and 6.
    Thanks.
    Goran Oparnica
    IN2 d.o.o.
    Zagreb

    The Headstart Utilities are part of the Headstart Oracle Designer package which is downloadable from OTN. Headstart Oracle Designer is an accelerator suite consisting of Templates, Object Libraries, Preference Sets, PL/SQL libraries and utilities to make using Designer to generate Forms applications easier.
    To get more information on Headstart you can go to the OTN home page, choose Internet Tool under the Products section on the menu. Under the Headstart 'Internet Developer Suite', click on Headstart Oracle Designer
    Regards,
    Lauri

  • Need help with defining composite foreign keys

    Hi there, i´m in troubles with defining a composite foreign key. The scenario is:
    * Table TABLE_A has no unique primary key. Instead its primary key is a composition of five foreign keys.
    * Table TABLE_B and TABLE_A have a many-to-many relationship with each other.
    When I create the entity manager for running the DDL scripts into the DB i´m getting "ORA-02270: no matching unique or primary key for this column-list".
    These are my entities (sorry the portuguese terms, but i think the issue can be understood without translation...).
    @Entity
    @Table( name = "DESTAQUE_PDE" )
    public class DestaquePDE implements Serializable {
         private static final long serialVersionUID = 4694859522628884981L;
         @Id
         @GeneratedValue( strategy = GenerationType.SEQUENCE )
         @Column( name = "ID_DESTAQUE_PDE", nullable = false )
         private long id;
    //Some fields were ommited here for simplicity....
         @ManyToMany( cascade = CascadeType.ALL )
         @JoinTable( name = "JOIN_DESTAQUES_CORRELACAO",
                        joinColumns           = @JoinColumn( name = "JOIN_ID_DESTAQUE", referencedColumnName = "ID_DESTAQUE_PDE" ),
                        inverseJoinColumns      = {@JoinColumn( name = "JOIN_ID_COR_PUB_ALVO", referencedColumnName = "FK_ID_PUBLICO_ALVO" ),
                                                 @JoinColumn( name = "JOIN_ID_COR_RES_LINHA", referencedColumnName = "FK_ID_RESOLUCAO_LINHA" ),
                                                 @JoinColumn( name = "JOIN_ID_MOD_CRED", referencedColumnName = "FK_ID_MODALIDADE_CREDITO" ),
                                                 @JoinColumn( name = "JOIN_ID_AG_FIN", referencedColumnName = "FK_ID_AGENTE_FINANCEIRO" ),
                                                 @JoinColumn( name = "JOIN_ID_PROG_LINHA", referencedColumnName = "FK_ID_PROGRAMA_LINHA" )}
         private List<EntradaTabelaCorrelacao> correlacoes;
    @Entity
    @Table( name = "CORRELACAO" )
    @IdClass( TabelaCorrelacaoPK.class )
    public class EntradaTabelaCorrelacao implements Serializable {
         private static final long serialVersionUID = -3337072470212918325L;
         @Id
         @Column( name = "FK_ID_PUBLICO_ALVO" )
         private long idPublicoAlvo;
         @Id
         @Column( name = "FK_ID_RESOLUCAO_LINHA" )
         private long idResolucaoLinha;
         @Id
         @Column( name = "FK_ID_MODALIDADE_CREDITO" )
         private long idModalidadeCredito;
         @Id
         @Column( name = "FK_ID_AGENTE_FINANCEIRO" )
         private long idAgenteFinanceiro;
         @Id
         @Column( name = "FK_ID_PROGRAMA_LINHA" )
         private long idProgramaLinha;
         @Column( name = "CS_SITUACAO", nullable = false, length = 1 )
         private String situacao;
         @ManyToMany( mappedBy = "correlacoes" )
         private List<DestaquePDE> destaquesPDE;
    //more relationships ommited for simplicity....
    public class TabelaCorrelacaoPK implements Serializable {
         private long idPublicoAlvo;
         private long idResolucaoLinha;
         private long idModalidadeCredito;
         private long idAgenteFinanceiro;
         private long idProgramaLinha;
    //getters and setters ommited....
    These are part of the DDLs generated by toplink:
    CREATE TABLE DESTAQUE_PDE (
         ID_DESTAQUE_PDE NUMBER(19) NOT NULL,
         VL_ALOCACAO_AUTORIZADA NUMBER(16,2) NOT NULL,
         VL_TOTAL NUMBER(16,2) NOT NULL,
         QT_OPERACOES NUMBER(16,2) NOT NULL,
         NM_DESTAQUE_PDE VARCHAR2(255) NOT NULL,
         VL_ESTIMATIVA_REAPLICACAO NUMBER(16,2) NOT NULL,
         VL_MONTANTE NUMBER(16,2) NOT NULL,
         FK_ID_PDE NUMBER(19) NOT NULL,
         FK_RESOLUCAO_PROGRAMA NUMBER(19) NOT NULL,
         PRIMARY KEY (ID_DESTAQUE_PDE)
    CREATE TABLE CORRELACAO (
         FK_ID_PUBLICO_ALVO NUMBER(19) NOT NULL,
         FK_ID_RESOLUCAO_LINHA NUMBER(19) NOT NULL,
         FK_ID_MODALIDADE_CREDITO NUMBER(19) NOT NULL,
         FK_ID_AGENTE_FINANCEIRO NUMBER(19) NOT NULL,
         FK_ID_PROGRAMA_LINHA NUMBER(19) NOT NULL,
         CS_SITUACAO VARCHAR2(1) NOT NULL,
         PRIMARY KEY (FK_ID_PUBLICO_ALVO, FK_ID_RESOLUCAO_LINHA, FK_ID_MODALIDADE_CREDITO, FK_ID_AGENTE_FINANCEIRO, FK_ID_PROGRAMA_LINHA)
    ALTER TABLE DESTAQUE_PDE
    ADD CONSTRAINT FK_DESTAQUE_PDE_FK_ID_PDE
    FOREIGN KEY (FK_ID_PDE)
    REFERENCES PDE (ID_PDE)
    ALTER TABLE DESTAQUE_PDE
    ADD CONSTRAINT DESTAQUEPDEFKRESOLUCAOPROGRAMA
    FOREIGN KEY (FK_RESOLUCAO_PROGRAMA)
    REFERENCES RESOLUCAO_PROGRAMA (ID_RESOLUCAO_PROGRAMA)
    (*) ALTER TABLE CORRELACAO
    ADD CONSTRAINT CORRELACAO_FK_ID_PUBLICO_ALVO
    FOREIGN KEY (FK_ID_PUBLICO_ALVO)
    REFERENCES PUBLICO_ALVO (ID_PUBLICO_ALVO)
    ALTER TABLE CORRELACAO
    ADD CONSTRAINT CORRELACAOFKID_RESOLUCAO_LINHA
    FOREIGN KEY (FK_ID_RESOLUCAO_LINHA)
    REFERENCES RESOLUCAO_LINHA (ID_RESOLUCAO_LINHA)
    ALTER TABLE CORRELACAO
    ADD CONSTRAINT CRRELACAOFKIDMODALIDADECREDITO
    FOREIGN KEY (FK_ID_MODALIDADE_CREDITO)
    REFERENCES MODALIDADE_CREDITO (ID_MODALIDADE_CREDITO)
    ALTER TABLE CORRELACAO
    ADD CONSTRAINT CORRELACAOFKIDAGENTEFINANCEIRO
    FOREIGN KEY (FK_ID_AGENTE_FINANCEIRO)
    REFERENCES AGENTE_FINANCEIRO (ID_AGENTE_FINANCEIRO)
    ALTER TABLE CORRELACAO
    ADD CONSTRAINT CORRELACAOFK_ID_PROGRAMA_LINHA
    FOREIGN KEY (FK_ID_PROGRAMA_LINHA)
    REFERENCES PROGRAMA_LINHA (ID_PROGRAMA_LINHA)
    As I told before, the error i´m getting with these mappings is:
    ORA-02270: no matching unique or primary key for this column-list
    The error occurs exactly when executing the instruction with (*).
    Thanks in advance for any help!
    Regards
    Loreno

    The error says that the table PUBLICO_ALVO does not have a primary key or unique constraint for (ID_PUBLICO_ALVO), so you cannot define a foreign key constraint to it. This table was not included in your DDL, how was it created? You need to add a primary key or unique constraint in this table on this field.
    If you do not wish to have the unique or foreign key defined you can just ignore the error, it is just a warning.
    <p>---
    <br>James Sutherland
    <br>Oracle TopLink, EclipseLink
    <br>Wiki: Java Persistence, EclipseLink

  • Problem with Foreign Key relationships in SAP R/3 4.7

    Hi Experts,
    I am trying to create a foreign key relationship between 2 transparent tables in SAP R/3 4.7
    Table 1:ZAAVNDR (MANDT (pk), VENDORNO (pk), NAME, REGION, COUNTRY (fk)) Foreign Key Table
    Table 2: ZAAVNDRREF(MANDT(pk), COUNTRY (pk)) ---Check table
    I have added few valid countries in check table but when I am adding some records in foreign key table with invalid countries these records are not being restricted and are still successfully going into the table.
    Could any one please help in this.
    Thanks in anticipation.
    -Amit

    Hi Sandra,
    Many thanks for your response and providing time of yours.
    Now, I have done exactly the same thing, but still it is the same.
    I have created two new tables as below:
    ZAAVREF (Check table)
    MANDT (PK)
    COUNTRY (PK) Domain:ZAACOUNT (CHAR 10)
    ZAAV1 (Foreign key table)
    MANDT (PK)
    COUNTRY (PK) Domain:ZAACOUNT (CHAR 10)
    Then I have created FK on country of foreign key table ZAAV1 and then SE16 (for table ZAAVREF)->Create Entries-> Entered values for Country only->Save....Records entered with valid Country values.
    After that SE16 (for table ZAAV1)->Create Entries-->Entered an Invalid country->Save->Still the record entered to the Database successfully....
    Could you please let me know where I am going wrong.
    I am using SAP R/3 4.7 and creating tables using Tools->ABAP Workbench->Development->ABAP dictionary

  • Maintenance View for custom table with foreign key relationship

    Hi Folks,
         I have created a custom table with foreign key relationship with other check tables. I want to create a maintenance view / tablemaintenance generator. What all things I need to take care for the foreign keys related fields while creating the maintenance view / tablemaintenance generator.
    Regards,
      santosh

    Hi,
    You do not have to do anything explicitely for the foreign key relationships in the table maintainance generator.
    Create the table maintainance generator via SE11 and it will take care of all teh foreign key checks by itself.
    Regards,
    Ankur Parab

  • Mapping in OWB with primary key and foreign key relationship

    Hi all,
    I am new to this datawarehousing field. I have just started my career. I have to now create a mapping in owb where a table has a field which is a primary key of another table in the same staging area. If you guys could help me out with the a method it can be created that would be very helpful to me.
    I thought of 2 ideas,
    1. If I can use a look up, but then I am not sure if i can use a lookup for primary key, foreign key relationship. If I can use also, I do not know how to use that.
    2. What if I can directly take that the first table and link the primary key of that table to the second table which uses that primary key of the first table as one of its fields.
    I do not know how feasible these methods are. Please guys help me out.
    Thanks in advance.

    I have a similar case where table a and table b having relation but table a got inserted with data and table b is empty so there no values for foriegn key column in table b to realte with table a.
    Now i want to load table b foriegn key with primary key column values of table a.
    how can we do this in owb
    thanks
    kumar

  • Code generation - foreign key relationships

    I'm using the code/descriptor generation tab to generate classes from existing tables. It offers an option of choosing which relationships to generate, but seems to miss out some of the defined foreign key relationships in the database.
    I have three tables, CLIENTS, TXNS and REG
    The following constraints are defined in my database:
    TXN Primary Key: (TXN_ID)
    CLIENTS Primary Key :CLIENT_ID, TXN_ID)
    CLIENTS Foriegn KEy : TXN_ID references TXNS
    REG Primary Key: CLIENT_ID, TXN_ID
    REG Foreign Key: CLIENT_ID, TXN_ID references CLIENTS
    I select these three tables and choose generate classes and descriptors for selected tables. When the "Choose Relationships to generate" screen comes up, it only shows me the CLIENTS<-->TXNS relationship, but not the REG<-->CLIENTS relationship, even though the database foreign key constraints all look as though they've been defined in similar ways.
    thanks for any help.

    Hi Matt,
    I'm not surprised that you have an issue with this. One bugbear I have with Gateway is that for some reason the designers don't think any context beyond the immediate preceding navigation node is important. They don't support this within the same service,so it's hardly likley to work in a service reference.
    I may be wrong but I don't think GW is OData compliant in this respect. If I have the navigation path /blindservice/FromHereSet(1)/ToAPoints(22)/ToBPoints, it's rather restrictive to say I cannot see the initial key of '1' in the path when I am trying to resolve 'ToBPoints'. If that value - where I started - is key to the context, I have to know it.
    Currently the only way to access this context is to embed the 'key history' in the intermediate entities, i.e. /blindservice/FromHereSet(1)/ToAPoints(1,22)/ToBPoints. In my view that is corrupting the URl to suit the limitations of the SAP OData implementation. What's even more confusing/frustrating is that the technical request context appears to be able to store the stacked navigation keys but doesn't make use of this design. 
    I feel your pain
    Ron.

  • Composite Foreign Keys

    How do I map a composite foreign key using toplink?
    I can reference a particular record in mytable using the following sql statement:
    SELECT * FROM mytable m WHERE m.foreign_id = x AND m.type = y;
    Where x represents the primary key in my entity and y represents a second part of the primary key (e.g. "type 1")
    How do I accomplish this from within my entity?
    Thanks

    If you are using JPA, you need to use either an IdClass or EmbeddedId for composite primary keys.
    If you are using the TopLink native API you just need to call addPrimaryKeyFieldName() with both column names.
    See,
    http://en.wikibooks.org/wiki/Java_Persistence/Identity_and_Sequencing#Composite_Primary_Keys
    James : http://www.eclipselink.org

  • Optional Composite Foreign Key

    The tool doesn't seem to be handling this correctly when some of the columns are mandatory and others are nullable. I have a composite foreign key where one column is part of the primary key and the other is not. In the Columns properties of the Table dialog, it shows the column that is part of the primary key as mandatory. But on the diagram, the "red dot" indicator is missing. It also give me an error on the Foreign Keys properties when I click OK or Apply.

    No, You cant get a composite keys based on two different primary keys. Reason for this can be like unique index is being used when we create any primary key. When we create a composite primary key, one index is created for the two fields and thus one index store the values for two columns involved in the composite primary key and these values are stored in pairs. So when any foreign key references this composite primary key, it will match the data in pairs as it is stored in the index(unique index).
    Now when we say to create a composite foreign key based on two different primary keys , we are taking into account two indexes for two different fields. So there is no pairing in these two indexes. So when we will create foreign key using this, it will not get a pair of values or we can say oracle cant get us consistent pair of values from two indexes. So maintaining integrity will not be possible.
    Yes you can create two foreign keys on one column which can refer two different primary keys.
    Regards

  • Composite Foreign Key

    Dear All
    please correct this syntax for composite foreign key.
    Ater Table emp_pays
    Add Constraints emp_pt_fk Foreign Key(emp_id,pt_id) Referenes emp(emp_id),pay_type(pt_id);
    Thanks in advances
    Regards,

    No, You cant get a composite keys based on two different primary keys. Reason for this can be like unique index is being used when we create any primary key. When we create a composite primary key, one index is created for the two fields and thus one index store the values for two columns involved in the composite primary key and these values are stored in pairs. So when any foreign key references this composite primary key, it will match the data in pairs as it is stored in the index(unique index).
    Now when we say to create a composite foreign key based on two different primary keys , we are taking into account two indexes for two different fields. So there is no pairing in these two indexes. So when we will create foreign key using this, it will not get a pair of values or we can say oracle cant get us consistent pair of values from two indexes. So maintaining integrity will not be possible.
    Yes you can create two foreign keys on one column which can refer two different primary keys.
    Regards

  • Before delete trigger and foreign key relationship

    Hi,
    I am analysing one database for migration. On one parent table there is before delete trigger , to delete records from child. Also there is foreign key relationship on child table for this parent table.
    When I am deleting a row from parent, message gets displayed as "there are child records found."
    I would like to know, if there is foreign key relatioship then delete trigger on parent does't work, what is exactly happening?

    Could you post that trigger code and the Oracle version as well?
    With basic assumptions, I can't reproduce what you have stated here.
    Connected to:
    Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - Production
    With the Partitioning, OLAP, Data Mining and Real Application Testing options
    SQL> create table parent (id number primary key);
    Table created.
    SQL> create table child (id number);
    Table created.
    SQL> alter table child add constraint fk_parent foreign key (id) references parent;
    Table altered.
    SQL> create or replace trigger bdr_parent
      2  before delete on parent
      3  for each row
      4  begin
      5  delete from child where id = :old.id;
      6  end;
      7  /
    Trigger created.
    SQL> insert into parent (id) values (1);
    1 row created.
    SQL> insert into child (id) values (1);
    1 row created.
    SQL> commit;
    Commit complete.
    SQL> delete from parent where id = 1;
    1 row deleted.
    SQL> select * from parent;
    no rows selected
    SQL> select * from child;
    no rows selected
    SQL> rollback;
    Rollback complete.
    SQL> alter table child drop constraint fk_parent;
    Table altered.
    SQL> alter table child add constraint fk_parent foreign key (id) references parent on delete cascade;
    Table altered.
    SQL> delete from parent where id = 1;
    delete from parent where id = 1
    ERROR at line 1:
    ORA-04091: table SCOTT.CHILD is mutating, trigger/function may not see it
    ORA-06512: at "SCOTT.BDR_PARENT", line 2
    ORA-04088: error during execution of trigger 'SCOTT.BDR_PARENT'
    SQL>

  • How to create a Foreign key relationship between 2 user defined tables...

    Hi Folks,
    I have created two user defined tables... Where in i want to create foriegn key relationship between the 2 tables.... Can anyone guide the step by step procedure to do this scenario...
    Any help would be highly appreciated...
    Thanks

    Hi
    1.  In the 2nd table call the field of the 1st table which is a primary key.
    2.  Give the same field and dataelement name.
    3.  Select that field and then click on the foreign key field icon which is beside Search Help button.
    4. Then give short text, and the 1st table name.
    5. Then in the below box give the 2nd table name and 2nd table field name which you have called from 1st table.
    6. Then click on copy, then u will be able to see Check table name and check table field name beside foreign key table name.
    7. Then again click on copy.
    Regards
    Haritha.

  • Composite foreign key issue

    Hi,
    I am trying to create a composite foriegn key. I have created my primary key as a composite key, made up of three fields.
    Table 1
    PatientID - Made from 3 fields(a,b,c)(primry key)
    Table B
    PatiendID- (should be the foreign key which references table1)
    However i am finding that when i try to create my constraint i get the following messages
    error 02270 - no matching unique or primarty key for this column list.
    below is the sample code i am using to create my foreign key)
    (ALTER TABLE XD_PatientSedation ADD CONSTRAINT fk_Sedation_PatientID FOREIGN KEY (PatientID)REFERENCES XD_Patient_Demographics(PatientID)
    I am really stuck on this and dont quite know what to do.
    Hope you can help.
    Thanks
    Jagdish

    Just speaking about design, when you want to use a foreign key, it already means that the referenced columns represent something important enough to be a primary key of some other table. I don't understand the business logic of your example (using real table and column names would help), but the solution is probably one of these two :
    a) your foreign key should in fact refer to (a,b,c), the complete primary key of the first table (what was suggested by the others).
    b) your foreign key should stay as 'a' (patientid?), you should have a third table (patients?) whose primary key is 'a', and your "Table 1" should have a foreign key on 'a', referencing the third table. In this case you may find it silly to create a new table with only one column, but I would bet that you will very soon think of interesting attributes which could be added to this table.
    In any case, I think that Oracle did a good job by forcing an improvement of your design !

  • Query Builder - foreign key relationships not showing automatically

    Is it standard functionality in APEX that foreign key to primary key relationships are not shown in Query Builder when choosing related tables? Do you always have to join FKs to PKs manually (i.e. using control click) whenever you create joins in queries? In Oracle forms and SQL Developer the foreign key constaints are always draw in automatically. Any reason why this is not part of APEX's query builder as well? It's such a hassel to have to put them in each time when the relationships could easily be read directly from the data dictionary constraints.
    regards
    Paul P

    bump...

  • Foreign Key Relationships to external associations - Is it really this dodgy or is there a better way?

    Hi All,
    Let's picture that I have a GW service called Search Helps and within that service I have a PersonalAreas Entity Set which acts as a search help for drop down fields effectively that need to select a Personal Area.  I have 3 properties, with Personal Area Id and Company Code being the keys, and the text for Personal Area being the 3rd and last property. You really need to filter PersonalAreas by Company Code otherwise it's a fairly useless result set.
    Now within a different GW service, I have an entity called Position which has a single key of PositionId.  There is also a a property of company code on this Position.
    Now rather than asking the UI developer to get the Company code value and filter PersonalAreas with it directly, I thought it would be nicer for the UI developer just to use the navigation from a specific Position to PossiblePersonalAreas.  e.g. Positions('123')/PossiblePersonalAreas returns the entity set of PersonalAreas filtered by the Position's Company Code.
    So with that in mind, I add the external model reference pointing at the search helps service; then create an external association via the sneaky External Associations Editor button (that doesn't appear on the Wizard just to confuse you), and set up my Dependent entity to point at the Search Helps PersonalAreas entity.
    At this point I really want to tie the Position's Company Code to the PersonalAreas Company Code, but all I can do is set up a referential constraint of PositionId to CompanyCode or have no referential constraint at all (note - in my example I added the referential constraint as there is an issue with navigation keys being provided to external associations from what I can tell - more about this below).
    So, without any other option, I go into my GetEntitySet method of PersonalAreas and write something like the following:
      CASE iv_source_name.
        WHEN 'Position'.
          READ TABLE it_filter_select_options ASSIGNING <filter> INDEX 1.
          CHECK sy-subrc = 0.
          READ TABLE <filter>-select_options assigning <select_option> INDEX 1.
          CHECK sy-subrc = 0.
          position_id = <select_option>-low.
    *     Get company code for position
          TRY.
              CREATE OBJECT o_position
                EXPORTING
                  i_position_id = position_id.
              o_position->get_cost_centre_information(
                IMPORTING
                  e_company_code = company_code
            CATCH zcx_hr_object.
          ENDTRY.
      endcase.
    * Continue with retrieving PersonalAreas for given Company Code
    <Remaining code not shown>
    e.g. I have to assume CompanyCode is actually "Position Id" when the source of this call is from Position (I could also look at the navigation to find this has come from Position but if you're wondering, unfortunately for external associations, the key is not included in this for some reason but the same followup logic of reloading the object would be required).
    So the question I'm hoping the answer to is Yes is: Am I missing something in my understanding here?
    Thanks,
    Matt
    Edit since posting and playing around a bit more: Thinking about this further - it's unfortunate, but the navigation property in odata really implies the dependent entity has knowledge of the principal entity and realistically must know how to instantiate it if it needs to get data based on one of the properties. 
    Now while I'm fine with that (sort of) I think it's wrong that the dependent entity needs to have the required key properties to hold the principal entities as it makes something like a generic search help impossible to do with navigation - Maybe I just need to be done with that and expect filters to be used by UI programmers to find foreign key'ed entities....

    Hi Matt,
    I'm not surprised that you have an issue with this. One bugbear I have with Gateway is that for some reason the designers don't think any context beyond the immediate preceding navigation node is important. They don't support this within the same service,so it's hardly likley to work in a service reference.
    I may be wrong but I don't think GW is OData compliant in this respect. If I have the navigation path /blindservice/FromHereSet(1)/ToAPoints(22)/ToBPoints, it's rather restrictive to say I cannot see the initial key of '1' in the path when I am trying to resolve 'ToBPoints'. If that value - where I started - is key to the context, I have to know it.
    Currently the only way to access this context is to embed the 'key history' in the intermediate entities, i.e. /blindservice/FromHereSet(1)/ToAPoints(1,22)/ToBPoints. In my view that is corrupting the URl to suit the limitations of the SAP OData implementation. What's even more confusing/frustrating is that the technical request context appears to be able to store the stacked navigation keys but doesn't make use of this design. 
    I feel your pain
    Ron.

Maybe you are looking for

  • Can Oticon streamer 1.4 play music or map directions?

    I have a 4s iPhone and my wife has a new 5s. I have an Oticon hearing aid. Cannot get either phone to play music or map directions with the oticon streamer 1.4.  Using iOS 7. And it worked ok a week ago, but not this week???!!! Procedure I use: Get r

  • Error in posting the Idoc....

    Hi Experts,      When I post the Idoc from the external system to the SAP,I am getting the error as application document not posted and status code as 52.so what I need to do to overcome this error,please help me over this issue. Regards, Kiran.

  • Replacement for deprecated StringBufferInputStream

    I'm working on something where I need to compare sets of String name/value pairs. Some of the name/value pairs are in a String in java.util.Properties format. My approach has been to use aPropertiesObject.load(new StringBufferInputStream(the_string_w

  • Adding example to conbody with paragraphs after it

    Is it possible to have an example in a conbody followed by paragraphs? We are trying to add an example followed by paragraphs within a conbody. However, our doc is invalid when we try to do this. So, we added example to the conbody element in the EDD

  • Non supported character set: oracle-character-set-46??? - pls help!

    Hello, I'm running Hello World example. Could you please help me to resolve "Non supported character set: oracle-character-set-46" error i got?!?! This seems to be nls_character problem but somehow i can't figure out what and where should be changed