API Relationships

I have a Parent/Child relationship.
Using the API, If I call GetRelationshipMembership() and then iterate thru the RelationShipMembership collection, how do I know what Name to give the relationship? Is it Name or Name2?

You define the Relationships in MDM Console.
For each Relationship, you have relationship details.
Ex:
The details go as follows
Name: Upsell
Type: Parent/Child
Name is: Parent
Name2: Upsell For
In the above example, the property value <b>Name is</b> dictates what the name of the relationship is.
Use
Example:<b>RelationshipInfo class</b>
try {
relationshipInfoArray = catalog.GetRelationships();
if (relationshipInfoArray != null) {
for (int i = 0; i < relationshipInfoArray.GetSize(); i++) {
relationshipInfo = relationshipInfoArray.GetRelationshipInfoAt(i);
System.out.println(relationshipInfo.GetName());
} catch (StringException e) {
e.printStackTrace();
Hope this helps;
Please mark helpful answers

Similar Messages

  • How to read records from Relationship table using ABAP API's

    Hi All,
    I need to retrieve the records from Relationship table. In Java API's I came to know there is an option to retrieve this. I could not find anything in ABAP API's. Is there any option in ABAP API's to do this.
    Please Suggest.
    Thank You,
    Gajendra.

    Hi Gajendra,
    You can mainly read records from MDM (in a DDIC structure) using ABAP API's using the following function modules/methods:
    1. RETRIEVE: This is used to generically retrieve records from tables. Attributes and Values can also be retrieved.
    2. RETRIEVE SIMPLE: Retrieve records from MDM in a simple way.( simple data types).
    3. RETRIEVE CHECKOUT: Retrieves all checked out ID's.
    4. RETRIEVE ATTRIBUTES: Retrieves attribute(s) from a Taxanomy table.
    You will find all these methods in the following interface
    Interface : IF_MDM_CORE_SERVICES
    Hope it helps.
    *Please reward points if found useful.
    Thanks and Regards
    Nitin Jain

  • How to create relationship between two records using MDM Java APIs

    Hi,
    I am trying to create relationship between two records using Java Apis. Please guide me in doing this.
    Regards,
    Niraj

    Hi Niraj,
    There is ModifyRelationshipsCommand:
    http://help.sap.com/javadocs/MDM/SP06/com/sap/mdm/data/commands/ModifyRelationshipsCommand.html
    Retrieve Relationship command:
    http://help.sap.com/javadocs/MDM/current/com/sap/mdm/schema/commands/GetRelationshipListCommand.html
    Also, please refer similar thread, MDM Java API and relationships.
    Hope it helps..
    Regards,
    Mandeep Saini

  • Fetching parent-child relationship using API or XSD parsing?

    Hi,
    I would like to fetch all children of a parent object. I did not see any API to provide this information. I tried with GetMapping API, however it does not provide list of all child objects.
    E.g. Fetching all child of "Account" object should return all child objects {Activity, Address, Asset, Attachment, Business Plan, Claim, Deal Registration, Financial Account, Financial Account Holder, Financial Plan, Lead, Message Response, Note, Objective, Opportunity, Policy, Policy Holder, Revenue, Service Request, Special Pricing Request}
    Is it possible through API? If not, then XSD parsing seems to be the only way to retrieve children. Any guideline or rule on XSD parsing to get list of all children. XSD parsing doesn't look a good solution. Any other way to do so?
    This information is crucial for us. Please provide input.
    Thanks
    Ravish

    833189 wrote:
    Hi,
    I would like to fetch all children of a parent object. I did not see any API to provide this information. I tried with GetMapping API, however it does not provide list of all child objects.
    E.g. Fetching all child of "Account" object should return all child objects {Activity, Address, Asset, Attachment, Business Plan, Claim, Deal Registration, Financial Account, Financial Account Holder, Financial Plan, Lead, Message Response, Note, Objective, Opportunity, Policy, Policy Holder, Revenue, Service Request, Special Pricing Request}
    Is it possible through API? If not, then XSD parsing seems to be the only way to retrieve children. Any guideline or rule on XSD parsing to get list of all children. XSD parsing doesn't look a good solution. Any other way to do so?
    This information is crucial for us. Please provide input.
    Thanks
    RavishHi Ravish,
    Any success on this one? We are hurdling the same difficulty as of the moment. We are basically building a plugin that will remotely (and automatically) import a CRMOD object's data model. That goes to say also that we're relying on CRMOD's web services for our solution.
    I've read from the Web Services on Demand Guide that GetMapping is suppose to "Return the display names and XML tags of the fields of a record type *or one of its child components*..."+. It seems that this translates to - if you want the list of fields for a child component, you have to run GetMapping on the child component. If this is the case, what other available web services calls can we make to get the relationship hierarchy of a CRMOD object? Any help would be greatly appreciated.:-)
    Thank you,
    John

  • How to obtain parent record from child record in relationship using API

    Hi,
    I have a record in the main table that is the child in a parent/child relationship to another main table record.  Using the Java API, how would I obtain the parent record in the relationship where I am starting with the child record?  In the API there seems to just be calls for getChildren, but not a getParent type call.
    Appreciate any immediate help that can be provided.
    Thanks,
    Eddie

    Hi Eddie,
    Please follow the below steps to retrieve only parents of a child Record.
    1. Create RetrieveRelationshipsCommand.
    2. Set the parameter RelationshipId.
    3. Set the parameter Anchor Record and Anchor Record Id. In this case the child record for which parents records to be retrieved.
    4. Set the parameter setGetChildren as false . This retrieves only the parent records for the specified child reocrd.
    5. Execute the RetrieveRelationshipsCommand.
    6. Retrieve member records from above step.
    Hope it helps
    Regards,
    Neeharika

  • API  for updating contract Relationships for Contract Repository

    Hi all,
    what is the API used to update th Contract relationship details in oracle contracts?
    Please help.

    Hello,
    LSMW (Recording/IBIP--Change mode Is Not available in STD SAP ) Will not help you In this case.So Please go for BDC Programme.write BDC logic in such way that it will always fetch Those operation In Task List Which need to be Upadted with  Contract Numbers  by applying condtion check for those operation in task List.
    Reagrds,
    Rakesh

  • How to specify AND/OR relationships while linking nodes in uCMDB Java API

    Hi,
    I am trying to build a TQL via the uCMDB Java API. The structure that I am trying to build is of this type:
    |- Server
        |- Disk
        |- FileSystem
        |- NIC(Interface)
            |-IPAddress
    In the TQL I want to specify the relationship between server and  nic (interface) as composition or containment. So if either relationship matches, it should return me data.
    To build this, I used the following code:
    //server node
    QueryNode serverNode = queryDefinition.addNode("ServerNode").ofType("node");
    //nic (interface) node, uses containment link
    QueryNode nicNode = queryDefinition.addNode("NICNode").ofType("interface");
    //nic (interface) node, uses composition link
    QueryNode nicNode1 = queryDefinition.addNode("NICNode1").ofType("interface");
    // now add relationships
    serverNode.linkedTo(nicNode).withLinkOfType("containment").atLeast(0);
    serverNode.linkedTo(nicNode1).withLinkOfType("composition").atLeast(0);
    My guess is that when I am adding relationships using "withLinkOfType()", it directly ANDs the conditions. Is there a way I could OR conditions which says:
                        Give me NIC Interfaces which either have a composition or containment relation with my server.
    Thanks in advance!

    Hi,
    You need to create a ejb-jar.xml and jboss.xml files to deploy the application on the servers.
    Also, put these lines of codes after getting System Properties.
    prop.put(Context.PROVIDER_URL, "iiop://localhost:[port_no]");Thanks,
    Srikant

  • Delete Relationships via API

    Can anyone tell me the correct method for deleting relationships within the repository using the API? It seems to me that deleting one end of a relationship would null-out the OTHER_RELATIONSHIP_END_REF value on the other end of the relationship and then the other end would have to be deleted separately but that doesn’t seem to be the case. I have tried to retrieve the other end after deleting the first end and gotten a NO_DATA_FOUND exception. However, if I do not delete the other end then Designer throws an exception regarding a null value in the TO_ENTITY_REFERENCE property of the end I attempted to delete. I have taken steps to ensure the entities on both ends of the relationship are checked-out prior to performing the delete but I do not seem to be able to come up with a combination of deletes that completely removes the relationship.
    Any help would be greatly appreciated.

    I think I've solved my own problem: deleting one end of the relationship causes the other end to be deleted automatically -- nice.

  • Need help in getting MDM relationship details using Java Apis

    Hi,
    Is it possible to search records which are in relationship using Java Apis? Suppose Record A is Parent record and Record B,C,D ... are child records.
    I have to search all the records which are in relationship with record A.
    Can any one send code snippet on this.
    Regards,
    Niraj

    Hi Niraj,
    You can use RetrieveRelationshipsCommand api to get the relationship child of the Anchor Record.
    RetrieveRelationshipsCommand command = new RetrieveRelationshipsCommand(connectionAccesor);
    command.setSession(session);
    command.setAnchorRecord(anchorRecord); / command.setAnchorRecordId(anchorRecordId); (use any of the two statements)
    command.setRelationship(relationshipId); //For child int type is 10, and for Parent_child int type is 5
    command.setMemberResultDefinition(resultDefinition);
    command.execute();
    //Get Member Records' resuld definition
    ResuldDefinition rd = command.getMemberResultDefinition();
    Hope this helps you.

  • Mapping a one to many relationship using fluent api

    Hi I can't map my domains to match the database, since database is already created, I can't create or remove any other extra table.
    Database
    CREATE TABLE PLAYER (Id Int, Name varchar(100), PRIMARY KEY (Id))
    CREATE TABLE POSITION (Id Int, Name varchar(100), PRIMARY KEY (Id))
    CREATE TABLE CHAMPIONSHIP (Id Int, Name varchar(100), PRIMARY KEY (Id))
    CREATE TABLE RELATED (PlayerId Int, PositionId Int, ChampionshipId int,
    FOREIGN KEY (PlayerId) references PLAYER(id),
    FOREIGN KEY (PositionId) references POSITION(id),
    FOREIGN KEY (ChampionshipId) references CHAMPIONSHIP(id),
    CONSTRAINT AK_RELATED UNIQUE(PlayerId,PositionId,ChampionshipId))
    Domains:
    public class Player
    public Player()
    this.Relateds = new List<Related>();
    public int Id {get;set;}
    public string Name { get; set; }
    public virtual ICollection<Related> Relateds { get; set; }
    public class Position
    { public int Id {get;set;}
    public string Name { get; set; } public virtual ICollection<Related> Relateds { get; set; }
    public class Championship
    { public int Id {get;set;}
    public string Name { get; set; } public virtual ICollection<Related> Relateds { get; set; }
    public class Related
    public int PlayerId { get; set; }
    public Player Player{ get; set; }
    public int PositionId { get; set; }
    public Position Position { get; set; }
    public int ChamionshipId { get; set; }
    public Championship Championship { get; set; }
    FLUENT API:
    modelBuilder.Entity<Player>().HasKey(m => m.Id);
    modelBuilder.Entity<Player>().Property(m => m.Name).IsRequired();
    modelBuilder.Entity<Position>().HasKey(m => m.Id);
    modelBuilder.Entity<Position>().Property(m => m.Name).IsRequired();
    modelBuilder.Entity<Championship>().HasKey(m => m.Id);
    modelBuilder.Entity<Championship>().Property(m => m.Name).IsRequired();
    Seed.cs
    public DbSet<Player> Players { get; set; }
    public DbSet<Position> Positions { get; set; }
    public DbSet<Championship> Championships { get; set; }
    private void Seed2(ApplicationDbContext context)
    string[] playerNames = new string[] { "Adam", "John", "Lucas" };
    string[] positionNames = new string[] { "Sniper", "Camper", "Assalt" };
    string[] championshipNames = new string[] { "BF4", "CS1.6", "TF2" };
    int relations = 3;
    try
    foreach (var name in playerNames)
    if (!this.Players.Any(m => m.Name == name))
    Player player = new Player { Name = name };
    context.Players.Add(player);
    foreach (var name in positionNames)
    if (!this.Players.Any(m => m.Name == name))
    Position position = new Position { Name = name };
    context.Positions.Add(position);
    foreach (var name in championshipNames)
    if (!this.Championship.Any(m => m.Name == name))
    Championship championship = new Championship { Name = name };
    context.Championships.Add(championship);
    context.SaveChanges();
    for (int i = 1; i <= relations; i++)
    var player = context.Players.ToList()[i];
    var position = context.Positions.ToList()[i];
    var championship = context.Championships.ToList()[i];
    if (!context.Relateds.Any(m =>
    context.Players.Any(t => m.PlayerId == t.Id)
    && context.Positions.Any(t => m.PositionId == t.Id)
    && context.Championships.Any(t => m.ChampionshipId == t.Id)))
    Related related = new Related
    Player = player,
    Position = position,
    Championship = championship
    player.Relateds.Add(related);
    context.Entry(player).State = EntityState.Modified;
    context.SaveChanges();
    catch (Exception ex)
    throw;
    I'm not able to insert into the Related table, I think the fluent api is not maped well, how can I fix it?

    Hello,
    >>I'm not able to insert into the Related table, I think the fluent api is not maped well, how can I fix it?
    As you mentions, your database already exists, so I assume that you are using database first approach, then, as far as I know, the fluent API is made only for Code-First approach and we don't need the fluent API if we create your model via Database-First.
    For database first approach, we just need to import existed tables to the designer surface by “Update Model From Database”. And with your provided model, I noticed that the related table does not contain a primary constraint, in Entity Framework, a table
    without the primary key would be treated as a view that is read only. So please create a primary constraint for the related table as:
    CREATE TABLE RELATED (PlayerId Int, PositionId Int, ChampionshipId int,
    FOREIGN KEY (PlayerId) references PLAYER(id),
    FOREIGN KEY (PositionId) references POSITION(id),
    FOREIGN KEY (ChampionshipId) references CHAMPIONSHIP(id),
    PRIMARY KEY CLUSTERED (PlayerId ASC, PositionId ASC,ChampionshipId asc),
    CONSTRAINT AK_RELATED UNIQUE(PlayerId,PositionId,ChampionshipId))
    With your provided tables, after adding this constraint, the Related table could add a new row as:
    using (DFDBEntities db=new DFDBEntities())
    RELATED related = new RELATED() { PlayerId = 1, ChampionshipId = 1, PositionId = 1 };
    db.RELATEDs.Add(related);
    db.SaveChanges();
    Regards.
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey.

  • What's the relationship between JSF api, JSFRI, Myfaces API, Myfaces impl

    JSF RI is an implementation of JSF reference, so is Myfaces impl, right?
    i just confused about the two APIs, could anyone explain it for me.
    thanks!

    JSF is a specification.
    Sun Mojarra is an implementation of the JSF specification.
    Sun JSF RI (Reference Implementation) is an old name of Mojarra, used up to 1.2_07.
    Apache MyFaces is another implementation of the JSF specification.
    You cannot mix multiple implementations with each other. You can however add any component library to your taste on top of a JSF implementation, e.g. Apache Tomahawk, JBoss RichFaces, IceFaces, etcetera.

  • Sorting on one-to-many relationship with JPA criteria API

    I'm having some trouble using JPA criteria API with collection references.
    I have an entity called Competence that has a one-to-many relation to CompetenceName that contains names for Competence for several languages.
    [Competence.java]
    @OneToMany(mappedBy="competence", cascade=CascadeType.ALL, orphanRemoval=true)
    private List<CompetenceName> competenceNames;
    [CompetenceName.java]
    @ManyToOne @JoinColumn(name = "competence_id", referencedColumnName = "id")
    private Competence competence;
    @ManyToOne @JoinColumn(name = "lang_id", referencedColumnName = "id")
    private Language language;
    @Basic @Column(name = "name", length = 50)
    private String name
    Now I want to load 200 Competence-entities and sort them by their name (depending on the language of the logged in user). How would this be done using the JPA Criteria API? With a normal query, I would accomplish this with
    "SELECT DISTINCT c FROM Competence AS c LEFT JOIN c.competenceNames AS cn ORDER BY cn.name"
    Obviously, CompetenceName could contain zero entries for a Competence, but it works anyway with a normal query. With criteria API, it would look something like:
    CriteriaQuery<Competence> cq = cb.createQuery(Competence.class);
    Root<Competence> competence = cq.from(Competence.class);
    competence.fetch(Competence_.competenceNames);
    cq.select(competence).orderBy(cb.asc(competence.get(Competence_.competenceNames).get(CompetenceName_.name)); // Doesn't work
    Is this even possible to do without creating a normal query?
    Edited by: 812655 on Nov 24, 2010 2:32 AM

    // Doesn't workWhat does not work? What error do you get?
    You need to use "join" to define a join.
    CriteriaQuery<Competence> cq = cb.createQuery(Competence.class);
    Root<Competence> competence = cq.from(Competence.class);
    Join<CompetenceName> name = competence.join(Competence_.competenceNames);
    cq.orderBy(cb.asc(name.get(CompetenceName_.name));
    The "fetch" will do a fetch join, if you also wish to load the data in the same query.
    James : http://www.eclipselink.org

  • What is the relationship of javatv api,jmf api and mhp api ?

    Whether all these three set of API are required to write digital tv program?

    That depends on what the digital TV program (I assume you mean MHP application) wants to do. Specifically;
    - javax.tv.xlet.Xlet is needed whatever you want to do.
    - Most of the rest of JavaTV is only needed if you want to write an electronic program guide, e.g. to get at service information.
    - If you want to write a program which manipulates the video & audio of the TV signal then you need the JMF API and also a small part of javax.tv.service.selection to get hold of the JMF player for the running TV content.
    - The MHP APIs do many different things, again depending on what your application wants to do.
    - You don't mention them but you also probably need some of the org.havi.ui APIs. In MHP, the top level graphics Container class for applications is an instance of org.havi.ui.HScene. Also the "VK_" constants for some of the remote control codes are only defined in org.havi.ui.HRcEvent.
    See http://www.mhp-interactive.org for examples of how to use many of the MHP APIs.

  • Using a byte[] as a secondary index's key within the Collection's API

    I am using JE 4.1.7 and its Collections API. Overall I am very satisfied with the ease of using JE within our applications. (I need to know more about maintenance, however!) My problem is that I wanted a secondary index with a byte[] key. The key contains the 16 bytes of an MD5 hash. However, while the code compiles without error when it runs JE tell me
    Exception in thread "main" java.lang.IllegalArgumentException: ONE_TO_ONE and MANY_TO_ONE keys must not have an array or Collection type: example.MyRecord.hash
    See test code below. I read the docs again and found that the only "complex" formats that are acceptable are String and BigInteger. For now I am using String instead of byte[] but I would much rather use the smaller byte[]. Is it possible to trick JE into using the byte[]? (Which we know it is using internally.)
    -- Andrew
    package example;
    import com.sleepycat.je.Environment;
    import com.sleepycat.je.EnvironmentConfig;
    import com.sleepycat.persist.EntityStore;
    import com.sleepycat.persist.PrimaryIndex;
    import com.sleepycat.persist.SecondaryIndex;
    import com.sleepycat.persist.StoreConfig;
    import com.sleepycat.persist.model.Entity;
    import com.sleepycat.persist.model.PrimaryKey;
    import com.sleepycat.persist.model.Relationship;
    import com.sleepycat.persist.model.SecondaryKey;
    import java.io.File;
    @Entity
    public class MyRecord {
    @PrimaryKey
    private long id;
    @SecondaryKey(relate = Relationship.ONE_TO_ONE, name = "byHash")
    private byte[] hash;
    public static MyRecord create(long id, byte[] hash) {
    MyRecord r = new MyRecord();
    r.id = id;
    r.hash = hash;
    return r;
    public long getId() {
    return id;
    public byte[] getHash() {
    return hash;
    public static void main( String[] args ) throws Exception {
    File directory = new File( args[0] );
    EnvironmentConfig environmentConfig = new EnvironmentConfig();
    environmentConfig.setTransactional(false);
    environmentConfig.setAllowCreate(true);
    environmentConfig.setReadOnly(false);
    StoreConfig storeConfig = new StoreConfig();
    storeConfig.setTransactional(false);
    storeConfig.setAllowCreate(true);
    storeConfig.setReadOnly(false);
    Environment environment = new Environment(directory, environmentConfig);
    EntityStore myRecordEntityStore = new EntityStore(environment, "my-record", storeConfig);
    PrimaryIndex<Long, MyRecord> idToMyRecordIndex = myRecordEntityStore.getPrimaryIndex(Long.class, MyRecord.class);
    SecondaryIndex<byte[], Long, MyRecord> hashToMyRecordIndex = myRecordEntityStore.getSecondaryIndex(idToMyRecordIndex, byte[].class, "byHash");
    // END

    We have highly variable length data that we wish to use as keys. To avoid massive index sizes and slow key lookup we are using MD5 hashes (or something more collision resistant should we need it). (Note that I am making assumptions about key size and its relation to index size that may well inaccurate.)Thanks for explaining, that makes sense.
    It would be the whole field. (I did consider using my own key data design using the @Persistent and @KeyField annotations to place the MD5 hash into two longs. I abandoned that effort because I assumed (again) that lookup with a custom key design would slower than the built-in String key implementation.)A composite key class with several long or int fields will not be slower than a single String field, and will probably result in a smaller key since the UTF-8 encoding is avoided. Since the byte array is fixed size (I didn't realize that earlier), this is the best approach.
    --mark                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

  • Customer Interface vs HZ API

    Gurus,
    I need your help in Customer Conversion (R12). I tested the Customer Open Interface (ra_customers_interface, ra_customer_profiles_interface, ra_contact_phones_interface). Everything goes through fine into HZ Tables.
    But I want some more Customer Master fields to be passed from Legacy system.
    Eg:
    - Account Description / Name (hz_cust_accounts)
    - SalesPerson (Acct Site Level - hz_cust_account_sites_all)
    - Order Management Attributes like PRICE_LIST (Account Level or at Acct Site Level)
    We have the option to pass DEMAND_CLASS_CODE (one of the OM attributes) but not the other OM attributes like PRICE_LIST etc.
    What would be the best approach to do conversion in this case ?
    - Use "Customer Interface" first and then use HZ APIs to update the specific fields
    - Directly use HZ APIs to upload all the attributes. (I am not comfortable with this as it
    needs much more effort making sure to populate all relevant tables)
    Am I missing something ? Could you please provide your suggestions.
    Thanks,
    Dinesh

    Dinesh,
    In my opinion, unless you are comfortable that you know entire TCA architecture, I do not suggest to use the indivdual pieces of code to convert the modules like Parties, Accounts, relationships and so on. One specific example is, Credit Holds at the customer sites. If you check this, it inserts a row into a OM table oe_hold_sources (ofcourse this is obsolete in R12).
    So you can use the customer interface with updates later.
    One idea is this:
    Use all the Site_use_attributes (unless you are using them to store your own values) to store these values like price_list_id, order_type_id and convert them using the Customer Interface into attributes. At the end of the program (request set) your program fires and updates all the site uses with respective values in the attributes to the destination columns and wipes off the attributes so that they can be used in the future. Also you can insert the values into an audit table.
    Thanks
    Nagamohan

Maybe you are looking for