Parent - Child mapping - ODI

Hi experts,
I have source as a below format, in .xls, this is parent- child relationship..
Gen1     Gen2     Gen3     Gen4
9000000009 blank     blank     blank
blank     910000000 blank     blank
blank     blank     9110000000     blank
blank     blank     9120000009     blank
blank     blank     blank     9121100009
And trying the data into Oracle table with the below format.
Gen1     Gen2     Gen3     Gen4
9000000009               
9000000009     9100000009          
9000000009     9100000009     9110000000     
9000000009     9100000009     9120000009     
9000000009     9100000009     9120000009     9121100009
Please help me what is the workaround I can follow to achieve using ODI.
regards,
Preet
Edited by: 914626 on Mar 4, 2012 10:13 PM
Edited by: 914626 on Mar 4, 2012 10:14 PM
Edited by: 914626 on Mar 4, 2012 10:15 PM
Edited by: 914626 on Mar 4, 2012 10:15 PM
Edited by: 914626 on Mar 4, 2012 10:17 PM

Thanks for the thoroughness. There was a mistake in moving the code over for the forum. The field names are correct throughout the original source code.
BASE_OBJECT_ID is used throughout.
I suspect the problem lies in the one-to-many sampleItem(s) relationship that is based upon the subclassed item class. (The relationship is actually "sampleItems" in the real code and somehow got changed in the move over.)
The problem may lie in the mapping of the attribute override in the child class to the referencing of the item class from the parent side of the relationship in the Sample class.
I further suspect this may be specific to Eclipselink based upon other postings I've seen on the web that have similar problems...
Any thoughts?
Edited by: Chris-R on Mar 3, 2010 9:56 AM

Similar Messages

  • Informatica parent child mapping

      down votefavorite I have a scenario where suppose saycountry      province      city      zip
    ind           ts           hyd       xyz
    ind          maha          mum       abc
    Desired output:id   name         parent-id
    1    india         1
    2    telengana     1
    3    hyderabad     2
    4    xyz           3
    5    mumbai        1
    6    abc           5
    I have to do it with informatica mapping any ideas how do I show this parent child relationship. I am not able to get the logic for thisThanksKumar

    Thanks for the thoroughness. There was a mistake in moving the code over for the forum. The field names are correct throughout the original source code.
    BASE_OBJECT_ID is used throughout.
    I suspect the problem lies in the one-to-many sampleItem(s) relationship that is based upon the subclassed item class. (The relationship is actually "sampleItems" in the real code and somehow got changed in the move over.)
    The problem may lie in the mapping of the attribute override in the child class to the referencing of the item class from the parent side of the relationship in the Sample class.
    I further suspect this may be specific to Eclipselink based upon other postings I've seen on the web that have similar problems...
    Any thoughts?
    Edited by: Chris-R on Mar 3, 2010 9:56 AM

  • JPA One-To-Many Parent-Child Mapping Problem

    I am trying to map an existing legacy Oracle schema that involves a base class table and two subclass tables that are related by a one-to-many relationship which is of a parent-child nature.
    The following exception is generated. Can anybody provide a suggestion to fix the problem?
    Exception [EclipseLink-45] (Eclipse Persistence Services - 2.0.0.v20091127-r5931): org.eclipse.persistence.exceptions.DescriptorException
    Exception Description: Missing mapping for field [BASE_OBJECT.SAMPLE_ID].
    Descriptor: RelationalDescriptor(domain.example.entity.Sample --> [DatabaseTable(BASE_OBJECT), DatabaseTable(SAMPLE)])
    The schema is as follows:
    CREATE TABLE BASE_OBJECT(
    "BASE_OBJECT_ID" INTEGER PRIMARY KEY NOT NULL,
    "NAME" VARCHAR2(128) NOT NULL,
    "DESCRIPTION" CLOB NOT NULL,
    "BASE_OBJECT_KIND" NUMBER(5,0) NOT NULL );
    CREATE TABLE SAMPLE(
    "SAMPLE_ID" INTEGER PRIMARY KEY NOT NULL,
    "SAMPLE_TEXT" VARCHAR2(128) NOT NULL )
    CREATE TABLE SAMPLE_ITEM(
    "SAMPLE_ITEM_ID" INTEGER PRIMARY KEY NOT NULL,
    "SAMPLE_ID" INTEGER NOT NULL,
    "QUANTITY" INTEGER NOT NULL )
    The entities are related as follows:
    SAMPLE.SAMPLE_ID -> BASE_OBJECT.BASE_OBJECT_ID - The PKs that are used to join the sample to the base class
    SAMPLE_ITEM.SAMPLE_ITEM_ID -> BASE_OBJECT.BASE_OBJECT_ID - The PKs that are used to join the sample item to the base class
    SAMPLE_ITEM.SAMPLE_ID -> SAMPLE.SAMPLE_ID - The FK that is used to join the sample item to the sample class as a child of the parent.
    SAMPLE is one to many SAMPLE_ITEM
    The entity classes are as follows:
    @Entity
    @Table( name = "BASE_OBJECT" )
    @Inheritance( strategy = InheritanceType.JOINED )
    @DiscriminatorColumn( name = "BASE_KIND", discriminatorType = DiscriminatorType.INTEGER )
    @DiscriminatorValue( "1" )
    public class BaseObject
    extends SoaEntity
    @Id
    @GeneratedValue( strategy = GenerationType.SEQUENCE, generator = "BaseObjectIdSeqGen" )
    @SequenceGenerator( name = "BaseObjectIdSeqGen", sequenceName = "BASE_OBJECT_PK_SEQ", allocationSize = 1 )
    @Column( name = "BASE_ID" )
    private long baseObjectId = 0;
    @Entity
    @Table( name = "SAMPLE" )
    @PrimaryKeyJoinColumn( name = "SAMPLE_ID" )
    @AttributeOverride(name="baseObjectId", column=@Column(name="SAMPLE_ID"))
    @DiscriminatorValue( "2" )
    public class Sample
    extends BaseObject
    @OneToMany( cascade = CascadeType.ALL )
    @JoinColumn(name="SAMPLE_ID",referencedColumnName="SAMPLE_ID")
    private List<SampleItem> sampleItem = new LinkedList<SampleItem>();
    @Entity
    @Table( name = "SAMPLE_ITEM" )
    @PrimaryKeyJoinColumn( name = "SAMPLE_ITEM_ID" )
    @AttributeOverride(name="baseObjectId", column=@Column(name="SAMPLE_ITEM_ID"))
    @DiscriminatorValue( "3" )
    public class SampleItem
    extends BaseObject
    @Basic( optional = false )
    @Column( name = "SAMPLE_ID" )
    private long sampleId = 0;
    Edited by: Chris-R on Mar 2, 2010 4:45 PM

    Thanks for the thoroughness. There was a mistake in moving the code over for the forum. The field names are correct throughout the original source code.
    BASE_OBJECT_ID is used throughout.
    I suspect the problem lies in the one-to-many sampleItem(s) relationship that is based upon the subclassed item class. (The relationship is actually "sampleItems" in the real code and somehow got changed in the move over.)
    The problem may lie in the mapping of the attribute override in the child class to the referencing of the item class from the parent side of the relationship in the Sample class.
    I further suspect this may be specific to Eclipselink based upon other postings I've seen on the web that have similar problems...
    Any thoughts?
    Edited by: Chris-R on Mar 3, 2010 9:56 AM

  • Parent child deletion  in ODI

    Hi ,
    I am using ODI for data migration.
    I have created interface for that . i have done error handling . now i need to implement parent child deletion. that is i need to delete parent record if the child record is no there for a particular Policy. can any one help me in implementing this in ODI.

    Can you please provide me the steps/document for exception handling in ODI interfaces.. I am creating interfaces to load flat files into custom tables and I need to provide exception handling in each interface. I would appreciate.
    Thanks
    Ram

  • Parent-child relation between Activities

    Hello,
    Is it possible to give parent child relationship between Activities within single Project? The requirement is, parent Activity to take part in overall scheduling whereas the Dates for parent Activity are determined by the child Activities attached to it.
    Thank you,
    Hemant

    Hi,
    In PS we  can map through the network activity and activity elemnents. For scheduling the projects the start date and end date of all  the activity elements are included in the respective network activity. for better understanding refer the following link.
    http://help.sap.com/saphelp_erp60_sp/helpdata/en/a9/8a853488601e33e10000009b38f83b/frameset.htm
    http://help.sap.com/saphelp_erp60_sp/helpdata/en/a9/8a853488601e33e10000009b38f83b/frameset.htm
    Regards,
    Nag.

  • Parent Child relation in one transaction throws error... (

    In nutshell, I have a parent->child relation ship in DB and due to the UI requirement, I created view link as Child->parent, it is giving a hack a lot of problems.... (it sounds silly but looks like I am loosing my mind over this)
    Let me explain my situation,
    - I have a table A with col-a and col-b. I have another table B with col-a (primary key) and col-c. (This way table A is a parent table)
    - ON UI side i created relationship like table B is parent and Table A is child using col-a
    - I need to create parent-child (one record for each) record programatically.........
    I tried following thing:
    - from backing bean, as soon as i create Table-B row first, i get error saying too many objects with same key (which is understandable because of table design..... and associaion must be throwing that error)
    - from EOImpl file, it doesn't even find the child record being created... so during commit I can't send the foreign key value from Table-a to Table-b
    Any suggestion is greatly appreciated?
    Thank you,
    -Raj

    that depends on how you implement the multiple selection of orders.. you have to pass the selectedValues to the backend or store the values in a map or list and pass it..

  • Cascading parent/child inserts while avoiding uniqueness constraints

    Assume that I have two classes that I'd like to persist: MyObject and
    InternalObject. MyObject has an InternalObject field. That is, MyObject is
    the parent, InternalObject is the child in this one-to-one relationship.
    Steps involved:
    1) Enable ForeignKeyConstraints property in kodo.properties. That is add
    the line,
    kodo.jdbc.ForeignKeyConstraints=true
    2) In package.jdo, add the following kodo extensions for MyObject's
    InternalObject field mapping, i.e., io in my case.
    <field name="io" default-fetch-group="false">
    <extension vendor-name="kodo" key="jdbc-delete-action"
    value="cascade"/>
    <extension vendor-name="kodo" key="dependent" value="true"/>
    </field>
    The reasons that we have done these steps: we'd like kodo to properly
    re-order the sql statements if necessary in order not to violate
    parent/child dependencies during insertion, and also force cascading
    deletes in case we delete the parent object.
    Now comes the bulk of the algorithm.
    String sKey // key of the object to insert
    String sValue //value of the object to insert
    MyObject o = new MyObject(sKey, sValue);
    InternalObject io = new InternalObject(sKey,sValue); //using same values :)
    o.setInternalObject(io); //parent-child relation
    Object id = ((PersistenceCapable) o).jdoNewObjectIdInstance();
    ((PersistenceCapable)o).jdoCopyKeyFieldsToObjectId(id);
    kpm.currentTransaction().begin();
    try {
    Object trio = kpm.getObjectById(id, true);
    kpm.deletePersistent(trio);
    kpm.flush(); //apply deletes on the datastore
    } catch (ObjectNotFoundException oe) {
    System.out.println("First time!");
    kpm.makePersistent(o);
    kpm.currentTransaction().commit();

    If this is a question, the extension you have is only a directive to
    mappingtool to create cascade foreign keys. However, at runtime Kodo
    will rely upon the foreign key definitions in the schema. You should
    verify that the foreign key exists as you like in the schema. If you
    want to have child relationships to be deleted, you should use the
    dependent and element-dependent extensions.
    Ahmet Bulut wrote:
    Assume that I have two classes that I'd like to persist: MyObject and
    InternalObject. MyObject has an InternalObject field. That is, MyObject is
    the parent, InternalObject is the child in this one-to-one relationship.
    Steps involved:
    1) Enable ForeignKeyConstraints property in kodo.properties. That is add
    the line,
    kodo.jdbc.ForeignKeyConstraints=true
    2) In package.jdo, add the following kodo extensions for MyObject's
    InternalObject field mapping, i.e., io in my case.
    <field name="io" default-fetch-group="false">
    <extension vendor-name="kodo" key="jdbc-delete-action"
    value="cascade"/>
    <extension vendor-name="kodo" key="dependent" value="true"/>
    </field>
    The reasons that we have done these steps: we'd like kodo to properly
    re-order the sql statements if necessary in order not to violate
    parent/child dependencies during insertion, and also force cascading
    deletes in case we delete the parent object.
    Now comes the bulk of the algorithm.
    String sKey // key of the object to insert
    String sValue //value of the object to insert
    MyObject o = new MyObject(sKey, sValue);
    InternalObject io = new InternalObject(sKey,sValue); //using same values :)
    o.setInternalObject(io); //parent-child relation
    Object id = ((PersistenceCapable) o).jdoNewObjectIdInstance();
    ((PersistenceCapable)o).jdoCopyKeyFieldsToObjectId(id);
    kpm.currentTransaction().begin();
    try {
    Object trio = kpm.getObjectById(id, true);
    kpm.deletePersistent(trio);
    kpm.flush(); //apply deletes on the datastore
    } catch (ObjectNotFoundException oe) {
    System.out.println("First time!");
    kpm.makePersistent(o);
    kpm.currentTransaction().commit();
    Steve Kim
    [email protected]
    SolarMetric Inc.
    http://www.solarmetric.com

  • How to handle parent-child dimension in OWB?????

    i have a dimension have many levels,and the amount of levels is varing,so i cannot use the wizard to define my dimension ,seems with OWB i can only define dimension with certain amount of levels.......
    my dimension data is stored with this format:
    child parent
    Los Angles US
    US WORLD
    it is called a parent-child relation ,how can i define dimension with parent-child relation witn OWB...
    Can OWB do it ?????

    i have a dimension have many levels,and the amount of levels is varing,so i cannot use the wizard to define my dimension ,seems with OWB i can only define dimension with certain amount of levels.......
    my dimension data is stored with this format:
    child parent
    Los Angles US
    US WORLD
    it is called a parent-child relation ,how can i define dimension with parent-child relation witn OWB...
    Can OWB do it ????? You must define a dimension, define the dimension levels and the hierarchy inside the dimension (a hierarchy can have as many levels as you want, parent-child relationship is a normal hierarchy concept - no rocket science here). Then you have to map the data source for the dimension levels appropriately. Please refer to the user manual, chapter 4 ("Defining dimensianal targets") for details.
    Regards:
    Igor

  • Multi-Org Parent-Child LOV

    Issue Description:
    in Action BC (Table: S_EVT_ACT) we are trying to implement the following organization based parent child picklists/LOVs for Status->Status Reason
    [Status] - Activity Status field (col: EVT_STAT_CD)
    *Picklist: LOV Type = 'EVENT_STATUS', picklist BC: 'List Of Values Dynamic (REL)'
    [LN Status Reason] - customised field/column (Col: X_STATUS_REASON)
    *Picklist: LOV Type = 'LN_MISSED_ACTIVITY_REASON', picklist BC: 'PickList Hierarchical'
    *Pick Map: [LN Status Reason] = [Value], [Status] = [Parent] (Constraint = Y)
    in the Admin-Data LOVs:
    Type = EVENT_STATUS, Display Value/LIC = "Not Achieved", Organization = "Org 1"
    Type = LN_MISSED_ACTIVITY_REASON
    Display Value/LIC = "Reason 1", Parent LIC = "Not Achieved", Organization = "Org 1"
    Display Value/LIC = "Reason 2", Parent LIC = "Not Achieved", Organization = "Org 1"                                                                                          
    On UI, create new record in Account - Activities, selecting Status = "Not Achieved".
    Now when i try to select the Status Reason value, the drop down does not give me any value.
    If I set the Organization to blank on "Reason 1", then the "Reason 1" value shows up in the Status Reason drop down under Account - Activities.
    In SQL of the log file, for the Status Reason drop down, it always hard code a T1.BU_ID is null in the WHERE clause, this would explain why its blank in the dropdown
    Also as a test, If i remove all the pick map constraints for the [LN Status Reason] field (ie the only record in the pick map is [LN Status Reason] = [Value]), then the drop down works correctly (ie displaying both the values with Organization = "Org 1"), and in the SQL of the log file, instead of BU_ID is null, it has BU_ID = ? with variable binding.
    Is there a reason why it would hard code the BU_ID is null in the WHERE clause in the SQL, and how to overcome this to achieve my requirement.
    Just a further update due to character limit of the original description,
    The "Owner Organization Specifier" property on the table S_EVT_ACT is blank (not sure if its related to anything though)
    The user i'm using belongs to "Org 1" for both the employee's Organization and its Position's Organization
    Thanks

    This is exactly what I'm looking for...I just can't make it work. I have 2 tables (database and schema). They are related via a database_id column. My code is below if you are willing to help.
    HTML Header
    <script>
    function get_select_list_xml1(pThis,pSelect){
    var l_Return = null;
    var l_Select = html_GetElement(pSelect);
    var get = new htmldb_Get(null,html_GetElement('pFlowId').value,
    'APPLICATION_PROCESS=CASCADING_SCHEMA',0);
    get.add('P7_DATABASE',pThis.value);
    gReturn = get.get('XML');
    if(gReturn && l_Select){
    var l_Count = gReturn.getElementsByTagName("option").length;
    l_Select.length = 0;
    for(var i=0;i<l_Count;i++){
    var l_Opt_Xml = gReturn.getElementsByTagName("option");
    appendToSelect(l_Select, l_Opt_Xml.getAttribute('value'),
    l_Opt_Xml.firstChild.nodeValue)
    get = null;
    function appendToSelect(pSelect, pValue, pContent) {
    var l_Opt = document.createElement("option");
    l_Opt.value = pValue;
    if(document.all){
    pSelect.options.add(l_Opt);
    l_Opt.innerText = pContent;
    }else{
    l_Opt.appendChild(document.createTextNode(pContent));
    pSelect.appendChild(l_Opt);
    </script>
    Application Process
    BEGIN
    OWA_UTIL.mime_header ('text/xml', FALSE);
    HTP.p ('Cache-Control: no-cache');
    HTP.p ('Pragma: no-cache');
    OWA_UTIL.http_header_close;
    HTP.prn ('<select>');
    HTP.prn ('<option value="' || 0 || '">' || '- All Schemas -'
    || '</option>'
    FOR c IN (SELECT schema, schema_id
    FROM (SELECT schema, schema_id, database_id
    FROM schema_lookup
    WHERE database_id = :cascading_selectlist_item_1)
    LOOP
    HTP.prn ('<option value="' || c.schema_id || '">' || c.schema || '</option>');
    END LOOP;
    HTP.prn ('</select>');
    END;
    P7_DATABASE_ID Form Element Attribute
    onchange="get_select_list_xml1(this,'P7_SCHEMA_ID');
    P7_SCHEMA_ID LOV
    select SCHEMA d, SCHEMA_ID v from SCHEMA_LOOKUP
    where DATABASE_ID = :P7_DATABASE_ID
    order by 1

  • Parent-Child Hierarchy in Informatica

    Can anyone please tell me the solution for the below scenario in Informatica. I have seen this scenario in folkstalk.com Take a look at the following tree structure diagram. From the tree  structure, you can easily derive the parent-child relationship between  the elements. For example, B is parent of D and E.    The above tree structure data is represented in a table as shown below. SOURCE TABLE:  C1C2C3C4ABDHABDIABENULLACFNULLACGNULL  Here in this table, column C1 is parent of column C2, column C2 is parent of column C3, column C3 is parent of column C4. Design a mapping to load the target table with the below data. Here you  need to generate sequence numbers for each element and then you have to  get the parent id. As the element "A" is at root, it does not have any  parent and its parent_id is NULL. TARGET TABLE Seq_IDELEMENTParent_ID   1    A   NULL   2    B   1   3    C   1   4    D   2   5    E   2   6    F   3   7    G   3   8    H   4   9    I   4  Both Source and Target are Oracle tables.Please help me how to acheive this in Informatica.

    AA선릉야구장 역삼풀싸롱 OlO 4314 6363 강북풀싸롱, 명동풀살롱MM명동룸싸롱위치+가격++문의 한예슬실장 BEST EVENT로 화끈하게!~     AA선릉야구장 역삼풀싸롱 OlO 4314 6363 강북풀싸롱, 명동풀살롱MM명동룸싸롱위치+가격++문의 한예슬실장 BEST EVENT로 화끈하게!~     AA선릉야구장 역삼풀싸롱 OlO 4314 6363 강북풀싸롱, 명동풀살롱MM명동룸싸롱위치+가격++문의 한예슬실장 BEST EVENT로 화끈하게!~     AA선릉야구장 역삼풀싸롱 OlO 4314 6363 강북풀싸롱, 명동풀살롱MM명동룸싸롱위치+가격++문의 한예슬실장 BEST EVENT로 화끈하게!~     AA선릉야구장 역삼풀싸롱 OlO 4314 6363 강북풀싸롱, 명동풀살롱MM명동룸싸롱위치+가격++문의 한예슬실장 BEST EVENT로 화끈하게!~     AA선릉야구장 역삼풀싸롱 OlO 4314 6363 강북풀싸롱, 명동풀살롱MM명동룸싸롱위치+가격++문의 한예슬실장 BEST EVENT로 화끈하게!~     AA선릉야구장 역삼풀싸롱 OlO 4314 6363 강북풀싸롱, 명동풀살롱MM명동룸싸롱위치+가격++문의 한예슬실장 BEST EVENT로 화끈하게!~     AA선릉야구장 역삼풀싸롱 OlO 4314 6363 강북풀싸롱, 명동풀살롱MM명동룸싸롱위치+가격++문의 한예슬실장 BEST EVENT로 화끈하게!~     AA선릉야구장 역삼풀싸롱 OlO 4314 6363 강북풀싸롱, 명동풀살롱MM명동룸싸롱위치+가격++문의 한예슬실장 BEST EVENT로 화끈하게!~     AA선릉야구장 역삼풀싸롱 OlO 4314 6363 강북풀싸롱, 명동풀살롱MM명동룸싸롱위치+가격++문의 한예슬실장 BEST EVENT로 화끈하게!~     AA선릉야구장 역삼풀싸롱 OlO 4314 6363 강북풀싸롱, 명동풀살롱MM명동룸싸롱위치+가격++문의 한예슬실장 BEST EVENT로 화끈하게!~     AA선릉야구장 역삼풀싸롱 OlO 4314 6363 강북풀싸롱, 명동풀살롱MM명동룸싸롱위치+가격++문의 한예슬실장 BEST EVENT로 화끈하게!~     AA선릉야구장 역삼풀싸롱 OlO 4314 6363 강북풀싸롱, 명동풀살롱MM명동룸싸롱위치+가격++문의 한예슬실장 BEST EVENT로 화끈하게!~     AA선릉야구장 역삼풀싸롱 OlO 4314 6363 강북풀싸롱, 명동풀살롱MM명동룸싸롱위치+가격++문의 한예슬실장 BEST EVENT로 화끈하게!~     AA선릉야구장 역삼풀싸롱 OlO 4314 6363 강북풀싸롱, 명동풀살롱MM명동룸싸롱위치+가격++문의 한예슬실장 BEST EVENT로 화끈하게!~     AA선릉야구장 역삼풀싸롱 OlO 4314 6363 강북풀싸롱, 명동풀살롱MM명동룸싸롱위치+가격++문의 한예슬실장 BEST EVENT로 화끈하게!~     AA선릉야구장 역삼풀싸롱 OlO 4314 6363 강북풀싸롱, 명동풀살롱MM명동룸싸롱위치+가격++문의 한예슬실장 BEST EVENT로 화끈하게!~     AA선릉야구장 역삼풀싸롱 OlO 4314 6363 강북풀싸롱, 명동풀살롱MM명동룸싸롱위치+가격++문의 한예슬실장 BEST EVENT로 화끈하게!~     AA선릉야구장 역삼풀싸롱 OlO 4314 6363 강북풀싸롱, 명동풀살롱MM명동룸싸롱위치+가격++문의 한예슬실장 BEST EVENT로 화끈하게!~

  • EJB 3, OneToMany that Acts As Tree, or Parent Child relationship support?

    (Sorry for the RoR reference)
    I first searched the forum and found this post that came close, but not exactly what I'm needing since my table doesn't reference the PK:
    http://forum.java.sun.com/thread.jspa?forumID=13&threadID=767913
    I have a table called Folder that represents a folder hierarchy. It has a 'Path' field and a 'Parent' field, and of course 'ID'. Each Folder knows its parent by the 'Parent' field, which references 'Path', not* 'ID'. Both are Strings.
    To find all the children of a Folder, the sql for a PreparedStatment might look something like this (shared for clarity of the situation):
    SELECT * FROM Folder
    WHERE Parent = ?Question:
    What are the proper annotations in EJB 3 / JPA to allow this kind non-primary key parent/child relationship mapping?
    Can I specify a named query that handles the logic and then reference it in the OneToMany annotation? Other cool tricks?
    Here is what I am trying (no runtime errors, but no results either). (Example simplified)
    @Entity
    @Table(name = "Folder")
    @NamedQueries(value = {@NamedQuery(.......)})
    public class Folder implements Serializable {
        @Id
        @Column(name = "ID", nullable = false, updatable = false)
        private Integer folderID;
        @Column(name = "Path", nullable = false)
        private String path;
        @Column(name = "Parent")
        private String parent;
        // v Here's the kicker v
        @OneToMany(cascade={CascadeType.ALL}, fetch=FetchType.EAGER)
        @JoinTable(name="Folder",
            joinColumns={@JoinColumn(name="Parent")},
            inverseJoinColumns={@JoinColumn(name="Path")})
        private List<Folder> children;
        // getters and setters ....
    }Thanks!

    It looks like the relationship is bi-directional.
    Will this work...
    // Parent.java
    @Entity
    public class Parent implements java.io.Serializable {
    @Id
    public Long parentId;
    @OneToMany(cascade=CascadeType.PERSIST,mappedBy="parent")
    public Collection<Child> children;
    // Child.java
    @Entity
    public class Child implements java.io.Serializable {
    @Id
    public Long childId;
    @ManyToOne
    public Parent parent;  // target of mappedBy
    }Then, in your code (a session facade?), you'll create the parent first, create the children, then add the children to the parent. Your code is also responsible for maintaining the reference back to the parent.
    Parent p = new Parent();
    for(int i=0; i<10; i++) {
      Child c = new Child();
      p.children.add(c);
      c.parent = p;
    em.persist(p);

  • Parent child dim build error??

    Hi,
    I'm loading members using parent child refernce method. My requirement is to load only level 0 members of already existed membesr from the outline.If data file has any new parent ,Essbase should kick out the new parent but should not load to the outline. Do we have any property for this in rule file or anywhere in EAS?
    Im using EAS 11.1.1.3

    To echo Glenn, you could use other approaches to pull dimensionality out of Essbase -- Applied OLAP's Outline Extractor, MaxL's export outline, etc.. get that output into a table, and then write SQL to do the tests. There's nothing in a Load Rule that will do what you want. ODI is fine as well (I am a fan of the tool) but it isn't the only approach and at the end of the day, you will be writing SQL in ODI to do this test.
    Regards,
    Cameron Lackpour

  • Loading to Parent -Child Tables simultaneously

    I have a requirement to populate parent-child tables in a single interface simultaneoulsy. I couldnt find anyway to add multiple targets and am wondering why this key feature is absent in ODI. The same thing is easily achievable in BPEL.
    Could some one please advice a work around for this.
    Your help is much appreaciated

    ODI 11g does come with a new IKM 'IKM Oracle Multi Table Insert'. This does allow multi table inserts, but will require more than one interface.
    Oracle Multi-Table Inserts
    A new Integration KM for Oracle allows populating several target tables from a single source, reading the data only once. It uses the INSERT ALL statement.
    COMPONENT NAME: IKM Oracle Multi Table Insert
    COMPONENT VERSION: 11.1.2.4
    AUTHOR: Oracle
    COMPATIBILITY: ODI 11.1.1.3 and above
    DESCRIPTION:
         - Integrates data from one source into one to many Oracle target tables in append mode, using a multi-table insert statement (MTI).
    REQUIREMENTS:
         - Oracle Database 9iR1 or above
         - See BASIC CONFIGURATION section
    BASIC CONFIGURATION
         - This IKM must be used in integration interfaces that are sequenced in a Package:
              - The first interface of the Package must have a temporary target and the KM option DEFINE_QUERY set to YES.
              This first interface defines the structure of the SELECT clause of the multi-table insert statement (that is the source flow).
              - Subsequent integration interfaces must source from this temporary datastore and have the KM option IS_TARGET_TABLE set to YES.
              - The last interface of the Package must have the KM option EXECUTE set to YES in order to run the multi-table insert statement.
              - Do not set "Use Temporary Interface as Derived Table(Sub-Select)" set to true on any of the interfaces.
         - If large amounts of data are appended, consider to set the KM option OPTIMIZER_HINT to /*+ APPEND */.
    OPTIONS (Refer to the Option descriptions for more information on each option)
         - DEFINE_QUERY: Set to Yes if this interface describes the source query (SELECT clause of the statement). This interface must have a temporary target.
         - IS_TARGET_TABLE: Set to Yes this interface using the source query to load one of the target tables. This interface must source from an interface with a temporary target using this IKM and having the KM option DEFINE_QUERY set to YES.
         - EXECUTE: Set to Yes for the last interface in the Package. This interface will run the multi-table insert statement.
         - COMMIT: Commit transaction. This applies only to the last interface in the Package.
         - TRUNCATE: Set to Yes to truncate this interface target table.
         - CREATE_TARG_TABLE: Create target table? May only be used on target interfaces, but not on source interfaces (defining the source data).
         - OPTIMIZER_HINT: Hint for the multi-table insert statement.
    RESTRICTIONS:
         - This KM can only be used in integration interfaces that are part of a Package.
         - All source and target datastores need to reside on same data server.
         - Journalized source data is not supported.
         - Temporary indexes are not supported.
         - Flow/static control is not supported.
         - The TRUNCATE option cannot work, if the target table is referenced by another table (foreign key).

  • Converting numeric level identifier into Parent/Child format to load.

    I am unable to receive meta data in parent child format from a ERP source system and need to load these into Planning through ODI. Each member is identified with a numeric level indicator. Is there any wasy to convert this into Parent/Child format using the level indicator?
    Thank you.

    If you are using oracle you could look into using the "Connect by prior" function.
    Cheers
    John
    http://john-goodwin.blogspot.com/

  • Find parent/child relationships At More Than 2 Levels

    Hello,
    Does anyone have a solution to find parent/child relationship for data more than 2 levels deep?
    I have a solution when there's a simple parent-child relationship but not when there's a grandparent-parent-child relationship or deeper.
    Ex. I have a table company_parent_child that stores the relationship betwen a company and it's direct parent.
    create table TEMP_COMPANY_PARENT_CHILD
    PARENT_ID NUMBER(10),
    COMPANY_ID NUMBER(10)
    insert into TEMP_COMPANY_PARENT_CHILD values (1, 10);
    insert into TEMP_COMPANY_PARENT_CHILD values (1, 11);
    insert into TEMP_COMPANY_PARENT_CHILD values (1, 12);
    insert into TEMP_COMPANY_PARENT_CHILD values (2, 13);
    insert into TEMP_COMPANY_PARENT_CHILD values (10, 100);
    insert into TEMP_COMPANY_PARENT_CHILD values (10, 101);
    insert into TEMP_COMPANY_PARENT_CHILD values (10, 102);
    insert into TEMP_COMPANY_PARENT_CHILD values (11, 103);
    1->
    ___10->
    ______100,101,102,
    ___11->103
    Companies 100, 101 and 102 are under parent 10 and grandparent 1.
    I need to create such a view or another temp table so that when I pass the parent ID, I will pull all the children on all levels. In addition, and this is the tricky part, when I join this new temp table or view to another data table without any parameters, the data should not be duplicate, ie. each company ID should appear only once.
    create table TEMP_JOIN
    company_id number(10),
    order_id varchar2(10)
    insert into TEMP_JOIN values (100, 'a');
    insert into TEMP_JOIN values (101, 'b');
    insert into TEMP_JOIN values (102, 'c');
    insert into TEMP_JOIN values (103, 'd');
    insert into TEMP_JOIN values (10, 'e');
    insert into TEMP_JOIN values (11, 'f');
    insert into TEMP_JOIN values (12, 'e');
    insert into TEMP_JOIN values (13, 'f');
    Thanks.

    start by learning CONNECT BY/START WITH. once you've
    written a query to read the grandparent-parent-child
    relationship, then come back with more questionsYes. we did look heavily into connect by/start with, in fact along with "connect_by_iscycle","connect_by_isleaf","connect_by_root" as well.
    Our dilemma is that when a joint is made between those two tables mentioned above TEMP_COMPANY_PARENT_CHILD and TEMP_JOIN, we are not able to create a view that would contain distinct company_ids, each mapped to a unique order id.
    The problem is we cannot have this type of joint when there are "n" level relationship between companies (or company_id). Basically, I think we should have our unique order id mapped to a unique key. This unique key should be a specialized key that we can know at anytime the entire path of the ancestry which we can know by sys_connect_by_path(company_id,'/') path.
    How do we know which path to take. The best bet is to "connect_by_isleaf" and just have the distinct "deep" path which form the specialized unique key. If you need help on this let me know. (A hint, sort by LEVEL and then do a rank after partitioning by company id and then filter the records by rank = 1, try this one!!!)
    So, we will eventually have a joint (say Table X) like
    PATH ORDER_ID
    /1/10/100 a
    /1/10/101 b
    /1/10/102 c
    /1/10 e
    /1
    /1/11/103 d
    /1/11 f
    I think this is the best view we can have to maintain a joint with no repetition along PATH as well as ORDER_ID. If you have any other thoughts, let me know.
    Then you query by path using INSTR to pull records by company_id.
    for example, if you want to get all the children for company_id "10" you would just say
    select * from X where INSTR(PATH,10,1,1) <> 0
    or if you want to get all the children for company_id "11" you would just say
    select * from X where INSTR(PATH,11,1,1) <> 0
    What do you think? Has anyone used the path information for traversing the tree? Or is there any article that tells us how to make effective use of sys_connect_by_path(company_id,'/') path.
    Thank you. Hope it made sense!

Maybe you are looking for

  • How to Increase the 15 Minute Idle Timeout?

    I saw some similar posts to increasing the EM timeout, but they didn't seem to relate to the idle timeout period. I need to increase the idle timeout from 15 minutes to something more like 30 minutes. A lot of times, I'll be editing a package with 10

  • How do I get Logic to stop looking for a specific .wav file?

    I recently imported a project I started in GarageBand into Logic Pro.  Once in Logic, I edited and added to the project then saved it as a Logic project file.  I deleted the original project from GarageBand.  Now, when I open the Logic file, Logic is

  • Title Logo in Dreamweaver CS3

    How can i upload title logo in Dreamweaver Cs3

  • New iOS 4.1 is a battery KiLLER!

    As i bought my iPhone 3Gs I used the normal 3. ... iOS versions .Some weeks later i updated the iOS 4. Ok! nothing to say. But with 4.1 my battery is down on 55% after play 40 minutes, 30 minutes of music and 5 min at 3G internet. Also on Standby Mod

  • SQL Query to get Date Range Values

    Hi, The database is Oracle11i. I am looking for a way to generate list of dates from a fixed date in the past (could be hardcoded) to current day (sysdate). That is, if the fixed date is 19 June 2011 and assuming that today is 24 June 2011 the SQL sh