One-to-many relationship - remove item from collection problem

The ArrayCollection keeps folders tree - subtree of folder is kept in children property and is also ArrayCollection. This collection is fed by 'folders' custom assembler defined like this:
Assembler works with adding and deleting top level objects of collection.
Also, when I add new object to children property LCDS issues createItem for new object and then updateItem for children property of parent so everything is fine - new object is persisted and relationship is correct.
When I remove item from children collection ONLY updateItem on assembler is issued, so object is not deleted from repository. Why this managed reletionship works for adding new object to children collection but doesnt work for deleting?

Hi;
A simple way may be create a view on referenced tables:
Connected to Oracle Database 10g Express Edition Release 10.2.0.1.0
Connected as hr
SQL>
SQL> drop table resources;
Table dropped
SQL> create table resources(id number, name varchar2(12));
Table created
SQL> insert into resources values(1,'Doc....');
1 row inserted
SQL> insert into resources values(2,'Img....');
1 row inserted
SQL> drop table documents;
Table dropped
SQL> create table documents(id number, resource_id number,type varchar2(12));
Table created
SQL> insert into documents values(1,1,'txt');
1 row inserted
SQL> drop table images;
Table dropped
SQL> create table images(id number, resource_id number,path varchar2(24));
Table created
SQL> insert into images values(1,2,'/data01/images/img01.jpg');
1 row inserted
SQL> create or replace view vw_resource_ref as
  2    select id, resource_id, type, null as path from documents
  3      union
  4     select id, resource_id, null as type, path from images;
View created
SQL> select * from resources r inner join vw_resource_ref rv on r.id = rv.resource_id;
        ID NAME                 ID RESOURCE_ID TYPE         PATH
         1 Doc....               1           1 txt         
         2 Img....               1           2              /data01/images/img01.jpg
SQL> Regards....

Similar Messages

  • Using data from one-to-many relationship

    Hi,
    i have an one-to-many relationship among two tables similar to the structure as in the below reference:-
    [One-to-many-reference|http://docs.oracle.com/cd/E23507_01/Platform.20073/RepositoryGuide/html/s1204repositoryexamplefonetomanymappi01.html]
    taking this as an example, i have the city's name with me. using this data in the addr_tbl in the 'address' item-descriptor, i need to get the value of the 'name' in the usr_tbl in the 'user' item descriptor. i will have the list of 'city' with me which i have to iterate and display the corresponding 'name'.
    will i be able to perform this in the jsp itself or does it have to be done in java? a sample code snippet or reference for doing this will be of much help.
    thank you.

    Thanks a lot, Sheik.
    if i have to do the reverse, ie for the 'name' in the usr_tbl of user item-descriptor i have to fetch the 'city' values in the addr_tbl, will it suffice if i do the following?
    <dsp:droplet name="/atg/dynamo/droplet/RQLQueryForEach">
    <dsp:param name="queryRQL" value="name=\"sirius\""/>
    <dsp:param name="repository"
    value="/com/MyRepository"/>
    <dsp:param name="itemDescriptor" value="user"/>
    <dsp:oparam name="output">
    <dsp:valueof param="element.address.city"/>
    </dsp:oparam>
    </dsp:droplet>

  • Need help mapping one-to-many relationship

    [Sorry, inadvertently cross-posted]
    Hello,
    I have a one-to-many mapping question that's probably a no-brainer for the
    experts of the group out there. My problem is that I can't get a collection
    of Items for a given Theme to be populated and I don't know if it's a
    problem in my system.jdo or in my classes (or both). For example, for Theme
    10,
    I want a collection of two Items, item_ids 1 and 2.
    I have db tables named ITEM and THEME with the following layouts:
    ITEM
    |==========================================================|
    | item_id(pk) | item_name | item_number | theme_id(fk) |
    |==========================================================|
    | 1 | This is Item1 | 1234 | 10 |
    | 2 | This is Item2 | 2954 | 10 |
    | 3 | This is Item3 | 2094 | 17 |
    | 4 | This is Item4 | 946 | 11 |
    | ... |
    |==========================================================|
    THEME
    |=======================================|
    | theme_id(pk) | theme_description |
    |=======================================|
    | 4 | Space |
    | 10 | Town |
    | 11 | Train |
    | 17 | Pirate |
    | ... |
    |=======================================|
    I have two PersistenceCapable classes that map to the above tables:
    package com.lego.data;
    public class Item
    public int item_id;
    private String item_number;
    private String item_name;
    private int theme_id;
    public Theme theme;
    public String toString()
    return
    item_number+":"+item_name+":"+theme.getCode()+":"+theme.getDescription();
    package com.lego.data;
    import java.util.*;
    public class Theme
    public int theme_id;
    public String theme_description;
    public Collection items;
    public String toString()
    return theme_id+":"+theme_description;
    and here is my system.jdo file:
    <?xml version = "1.0" encoding = "US-ASCII"?>
    <jdo>
    <package name="com.lego.data">
    <class name="Item" identity-type="application"
    objectid-class="com.lego.data.IntOId">
    <extension vendor-name="kodo" key="table" value="item"/>
    <extension vendor-name="kodo" key="lock-column" value="none"/>
    <extension vendor-name="kodo" key="class-column" value="none"/>
    <field name="item_id" primary-key="true">
    <extension vendor-name="kodo" key="data-column" value="item_id"/>
    </field>
    <field name="item_number">
    <extension vendor-name="kodo" key="data-column" value="item_number"/>
    </field>
    <field name="item_name">
    <extension vendor-name="kodo" key="data-column" value="item_name"/>
    </field>
    <field name="theme_id">
    <extension vendor-name="kodo" key="data-column" value="theme_id"/>
    </field>
    <field name="theme">
    <extension vendor-name="kodo" key="theme_id-data-column"
    value="theme_id"/>
    </field>
    </class>
    <class name="Theme" identity-type="application"
    objectid-class="com.lego.data.ThemeKey">
    <extension vendor-name="kodo" key="table" value="theme"/>
    <extension vendor-name="kodo" key="lock-column" value="none"/>
    <extension vendor-name="kodo" key="class-column" value="none"/>
    <field name="theme_id" primary-key="true">
    <extension vendor-name="kodo" key="data-column" value="theme_id"/>
    </field>
    <field name="theme_description">
    <extension vendor-name="kodo" key="data-column"
    value="theme_description"/>
    </field>
    <field name="items">
    <collection element-type="Item"/>
    <extension vendor-name="kodo" key="inverse" value="theme"/>
    </field>
    </class>
    </package>
    </jdo>
    Thanks in advance for the help.
    -Tim

    Abe White wrote:
    The first thing to check is that you are always setting the "theme" field in
    your Items. If you add an Item i to the "themes" collection of a Theme t, but
    forget to also set i's "theme" field to t, then the change will never get
    written to the database.
    Next, make sure that whenever you set the "theme" field of an Item, you also
    set
    its "theme_id" field. You map both of these fields to the same column, so you
    better be sure they stay in synch.
    On a related note, you might try making the "theme_id" field non-persistent if
    things still aren't working for you. Mapping two fields to the same column
    might be causing trouble. It would be safer to make theme_id non-persistent
    anyway, and to always grab the id from the Theme stored in your "theme"
    field.
    Better OO programming and all that, though I can see that you might have
    performance issues in mind when doing it your way.
    Anyway, if you find that it works when you make theme_id nonpersistent, let us
    know and we'll see why the double-mapping of the column is causing problems,
    and hopefully find a fix.Abe,
    Thanks for the response but I'm still confused. I failed to mention that
    the Item and Theme tables are in an existing schema, so as you saw in my
    system.jdo, I am specifying application identity.
    Since this is an existing schema, the Item table has theme_id as the
    foreign key to the Theme table. So are saying that it is a problem to map
    the both theme_id as a data column and a Theme object in the Item at the
    same time?
    I guess what I don't understand is exactly what my system.jdo should look
    like to map a one-to-many relationship. In my case, from Theme (1) to Item
    (many). (See my system.jdo in previous post).
    Thanks
    -Tim

  • How to insert data in a one-to-many relationship

    How do you insert data into the client, my model entity beans have a one-to-many relationship.
    PARENT ENTITY BEAN
    PARENT-ID
    PARENT-NAME
    The ejbCreate(Integer parentID,String name)
    CHILD ENTITY BEAN
    CHILD-ID
    CHILD-NAME
    PARENT-ID(foreign key of PARENTID).
    ejbCreate(Integer parentID,String name,String foreignparentID)
    In a jsp page i collect the parent details and 3 corresponding chld details in a text box.
    Can you please tell me how do i proceed from here...
    ie. how to i insert data into the entity beans..
    Do i pass the child as a collection, and within parents ejbCreate() method do i lookup for the childs home interface and insert one -by -one from the collection.
    1. Considering the above example, can some one pls tell how the ejbCreate() mehod signatures, for the parent and child entity beans should be.
    2. Pls also show some sample client code as to how to make an insertion.
    3. In case you are passing a collection of child data, then in what format does one have to insert into a collection and also how does the container know how to insert the values in the child table , bcoz we are passing as a collection.
    4.In case collections cannot be inserted do we need to iterate into the collection in parent's ejbCreate() method, and manually insert into the database of the childtable, thereby creating child entity beans.
    Thanks for your time and support...
    regards
    kartik

    Hi,
    3. In this case of course child's ejbCreate(and postCreate) looks like
    ejbCreate(Integer childID,String name,ParentLocal parent) {
    setId(Id);
    setName(name);
    ejbPostCreate(Integer childID,String name,ParentLocal parent) {
    setParent(parent);
    Here you don't need IDs, but it happens only using Locals, not Remotes, if I'm not wrong. Container does it itself.
    1. Of course, if you have parent.getChildren() and parent.setChildren() then you don't need any loops, but it should be done anyway in postCreate, because in ejbCreate there no parent exists yet.
    Once more 3: example - I'm using JBoss 3.2.5 as EJB container. It has tomcat inside and EJB and JSP+Struts use the same jvm. It means for me that I don't need to use remote interfaces, just locals. And in this case I can implement ejb-relations. So, a have the abstract method parent.getChildren() which returns Collection of ChildLocal - s and method parent.setChildren(Collection childrenLocals) which creates/modifies children by itself.
    I have not used remotes for a long time, but as I remember it was not possible to implement ejb-relations using remotes.
    regards,
    Gio

  • Newbie: one to many relationship SQL error

    Greetings all-
    This is probably a slam dunk for you JDO experts. I'm a JDO newbie, working
    with an existing schema in MySQL. I have a one to many relationship between
    two tables:
    Table "company":
    Fields:
    company_id: int(11) -- primary key
    name : varchar(64)
    division : varchar(64)
    Table "company_products"
    Fields:
    company_id: int(11) -- foreign key to table company
    product_name: varchar(64)
    product_description: varchar(64)
    So, I created the corresponding classes:
    public class Company {
    private int companyID;
    private String company_name;
    private String division;
    // Array of CompanyProduct
    private ArrayList companyProducts;
    // .. methods omitted
    public class CompanyProduct {
    private int companyID;
    private String productName;
    private String productDesc;
    // Methods omitted
    Then I created the "package.jdo" file:
    <?xml version="1.0"?>
    <jdo>
    <package name="com.packexpo.db">
    <class name="Company">
    <extension vendor-name="tt" key="table" value="company"/>
    <extension vendor-name="tt" key="pk-column" value="company_id"/>
    <extension vendor-name="tt" key="lock-column" value="none"/>
    <extension vendor-name="tt" key="class-column" value="none"/>
    <field name="companyID">
    <extension vendor-name="tt" key="data-column" value="company_id"/>
    </field>
    <field name="name">
    <extension vendor-name="tt" key="data-column" value="name"/>
    <extension vendor-name="tt" key="column-length" value="64"/>
    </field>
    <field name="division">
    <extension vendor-name="tt" key="data-column" value="division"/>
    <extension vendor-name="tt" key="column-length" value="64"/>
    </field>
    <field name="companyProducts">
    <collection element-type="com.packexpo.db.CompanyProduct"/>
    <extension vendor-name="tt" key="inverse" value="companyID"/>
    </field>
    </class>
    <class name="CompanyProduct">
    <extension vendor-name="tt" key="table" value="company_product"/>
    <extension vendor-name="tt" key="pk-column" value="company_id"/>
    <extension vendor-name="tt" key="lock-column" value="none"/>
    <extension vendor-name="tt" key="class-column" value="none"/>
    <field name="companyID">
    <extension vendor-name="tt" key="data-column" value="company_id"/>
    </field>
    <field name="productName">
    <extension vendor-name="tt" key="data-column" value="product_name"/>
    <extension vendor-name="tt" key="column-length" value="64"/>
    </field>
    <field name="productDesc">
    <extension vendor-name="tt" key="data-column"
    value="product_description"/>
    <extension vendor-name="tt" key="column-length" value="64"/>
    </field>
    </class>
    </package>
    </jdo>
    Enhancement works fine. I successfully query and retrive Company objects
    from the database, but as soon as I try to get the list of CompanyProducts,
    I get an SQL Error:
    javax.jdo.JDODataStoreException: [SQL=SELECT company.COMPANYPRODUCTSX FROM
    company WHERE company.company_id = 82061]
    E0610 Error in executeQuery()
    E0606 executeQuery() error --
    E0701 Error in getResult().
    E0708 Command results in error - 1054 Unknown column
    'company.COMPANYPRODUCTSX' in 'field list'
    NestedThrowables:
    com.solarmetric.kodo.impl.jdbc.sql.SQLExceptionWrapper: [SQL=SELECT
    company.COMPANYPRODUCTSX FROM company WHERE company.company_id = 82061]
    E0610 Error in executeQuery()
    E0606 executeQuery() error --
    E0701 Error in getResult().
    E0708 Command results in error - 1054 Unknown column
    'company.COMPANYPRODUCTSX' in 'field list'
    I know i have probably set up the package.jdo file incorrectly, but I'm at a
    loss for what I did wrong.
    Any suggestions?
    Thanks!
    -Mike

    Hi,
    915766 wrote:
    I need to write sql for below requirement:
    table structure is
    serial no LPN
    1 4
    2 4
    3 6
    4 6
    5 6
    6 3
    7 3
    8 3
    9 1
    I have to pick distinct 'LPN' like below:That sounds like a job for "GROUP BY lpn".
    (any serial no can be picked for the distinct LPN)It looks like you're displaying the lowest serial_no for each lpn. That's easy to do, using the aggregate MIN function.
    results needs to be as below:
    serial no LPN
    1 4
    3 6
    6 3
    9 1
    Please suggest with sql.Here's one way:
    SELECT    MIN (serial_no)   AS serial_no
    ,         lpn
    FROM      table_x
    GROUP BY  lpn
    ORDER BY  lpn     -- if wanted
    I hope this answers your question.
    If not, post a little sample data (CREATE TABLE and INSERT statements, relevant columns only), and also post the results you want from that data.
    Explain, using specific examples, how you get those results from that data.
    Always say which version of Oracle you're using (e.g., 11.2.0.2.0).
    See the forum FAQ {message:id=9360002}

  • Summarizing data in a one-to-many relationship

    Post Author: Bob Amiral
    CA Forum: General
    I use an order tracking system that has a one to many relationship between the main order information file and the line items file.  For each order, there can be one or more items in the items file.  I am having no luck trying to summarize data in such a way that shows selected information from the order file with only a summary from the item file on one line.  Instead, the reports expands by adding a line for each and every entry from the item file that relates to the order.
    How can I summarize data from the item file to show only one line of item data in the same line as the order data?

    Post Author: Charliy
    CA Forum: General
    Group by Order #
    Suppress the Detail (and possibly the Group Header, depending on how you want it to look)
    Put Running Totals in the Group Footer that reset on change of group.

  • One to many relationship leads to recursion?

    Hi,
    I've created a web services function which returns an object retrieved from a database using the persistence api (the class was generated by the Netbeans 5.5 "Entity Class from Database" feature.
    I can successfully return an object which has no foreign keys. However, when I try to retrieve an entity which is on either side of a 1:N relationship, I receive a stackOverflowError.
    Here's my sample schema (I'm using Derby bundled with SJAS 9 for testing)
    create table Address (
       Id int not null,
       StreetName varchar(255),
       City varchar(255),
       PostalCode varchar(255),
       Party int,
       primary key (Id)
    create table Party (
       Id int,
       Name varchar(255),
       primary key(Id)
    alter table Address add constraint foreign key (Party) references Party;So as you can see, one Party might have many addresses.
    I can retrieve either an Address or Party from the database using something like:
    em.createNamedQuery("Party.findById")
       .setParameter("id", 1)
       .getSingleResult();When I try to return it, I get a stackOverflowError in the server log. I'm using the default Toplink provider so enabling full logging on this, I can see the SQL.
    When retrieving an address, it selects all of the address fields and correctly binds the supplied Id value. It then performs a select on the Party table using the Address.Party value. This in turn causes it to attempt to retrieve an Address. After three queries, the error is thrown.
    I can't see why the above schema should cause this problem. Where an Address is requested, I would expect it to retrieve the address fields, including the value of the Party field but not the Party object itself. On the other hand. when a Party is retrieved, I would expect it to recurse through and return a collection of Address objects.
    Have I misunderstood this or am I missing some fundamental point about JAX-WS?
    Thanks for your help,
    -Phil

    You have to set both sides of the relations...
    for example to do this in a more seamless manner:
    public UserProfile
         public void addLog (UserActivityLog activity)
              logs.add (activity);
              if (!equals (activity.getUserProfile ()))
                   activity.setUserProfile (this);
    Now this is the most primitive of ways to maintain two sided relations.
    There are a lot of other patterns to get around this.
    If you want to set the UserActivityLog to a specific UserProfile without
    having a firm reference to ther UserProfile, you should get the object
    from the database/persistenceManager... as you are using application
    identity, you can do something like pm.getObjectById.
    JDO does not do magic references. If you set something to null, it will
    remain null until you set it.
    Srini wrote:
    Hi Guys
    I am trying to create a one to many relationship between 2 JDOs.
    UserProfile - User JDO having user info
    UserActivityLog - JDO having user log info
    UserProfile -- UserActivityLog
    1 many
    UserProfile - has a collection of UserActivityLog objects
    UserActivityLog - has a reference to UserProfile
    Qn 1:
    I created a UserProfile along with a collection of 2 UserActivityLog
    objects.
    Navigation:
    Now given a UserProfile object,i am able to get the UserActivityLog objects.
    But given a UserActivityLog object ,i get a NULL UserProfile object.
    Issues:
    Why this is happening???Do i need to set the reference for "UserProfile" in
    UserActivityLog before inserting???
    If so,then how do i add a UserActivityLog to an existing
    UserProfile???cos,if i create a UserActivityLog with reference to
    UserProfile ,then it will throw a Duplicate Key violation for UserProfile as
    it is already persisted in DB.
    It will be great if you can direct me to some one to many relationship
    examples already implemented.
    Thanks
    Srini
    Stephen Kim
    [email protected]
    SolarMetric, Inc.
    http://www.solarmetric.com

  • One-to-many relationship within one bean

    hello all,
    Does S1 support a container managed one-to-many relationship to itself?
    I used the verifer to verify my DD and the error is reported. (this prototype is migrated from weblogic6.1 and I use the S1 migration tool for the DD generation)
    -----------------database schema-----------------
    CREATE TABLE t_class_a
    c_name VARCHAR2(255),
    one_class_a_for_ma2918_id VARCHAR2(32), /* untruncated name: one_class_a_for_many_class_a_id */
    object_id VARCHAR2(32) NOT NULL
    CREATE UNIQUE INDEX t_class_a_id_PK ON t_class_a ( object_id );
    ALTER TABLE t_class_a ADD ( CONSTRAINT t_class_a_id_PK PRIMARY KEY ( object_id ) USING INDEX );
    ALTER TABLE t_class_a ADD ( CONSTRAINT FK_0 FOREIGN KEY ( one_class_a_for_ma2918_id ) REFERENCES t_class_a ( object_id ) );
    ---------------------------ejb-jar.xml------------------
    <abstract-schema-name>ClassABean</abstract-schema-name>
    <cmp-field>
    <field-name>objectId</field-name></cmp-field>
    <cmp-field>
    <field-name>name</field-name></cmp-field>
    <primkey-field>objectId</primkey-field>
    <relationships>
    <ejb-relation>
    <ejb-relation-name>manyClassA_oneClassA</ejb-relation-name>
    <ejb-relationship-role>
    <description>optional</description>
    <ejb-relationship-role-name>OneClassA-in-manyClassA_oneClassA</ejb-relationship-role-name>
    <multiplicity>One</multiplicity>
    <relationship-role-source>
    <ejb-name>ClassAEJB</ejb-name></relationship-role-source>
    <cmr-field>
    <cmr-field-name>manyClassAsForOneClassA</cmr-field-name>
    <cmr-field-type>java.util.Collection</cmr-field-type></cmr-field></ejb-relationship-role>
    <ejb-relationship-role>
    <description>optional</description>
    <ejb-relationship-role-name>ManyClassA-in-manyClassA_oneClassA</ejb-relationship-role-name>
    <multiplicity>Many</multiplicity>
    <relationship-role-source>
    <ejb-name>ClassAEJB</ejb-name></relationship-role-source>
    <cmr-field>
    <cmr-field-name>oneClassAForManyClassA</cmr-field-name>
    </cmr-field>
    </ejb-relationship-role>
    </ejb-relation>
    </relationships>
    -----------sun-cmp-mapping.xml--------
    <sun-cmp-mapping>
    <schema>mySchema</schema>
    <entity-mapping>
    <ejb-name>ClassAEJB</ejb-name>
    <table-name>T_CLASS_A</table-name>
    <cmp-field-mapping>
    <field-name>objectId</field-name>
    <column-name>OBJECT_ID</column-name></cmp-field-mapping>
    <cmp-field-mapping>
    <field-name>name</field-name>
    <column-name>C_NAME</column-name></cmp-field-mapping>
    <cmr-field-mapping>
    <cmr-field-name>manyClassAsForOneClassA</cmr-field-name>
    <column-pair>
    <column-name>T_CLASS_A.OBJECT_ID</column-name>
    <column-name>T_CLASS_A.ONE_CLASS_A_FOR_MA2918_ID</column-name></column-pair></cmr-field-mapping></entity-mapping></sun-cmp-mapping></sun-cmp-mappings>
    I beleive the migration tool missing the cmr-filed mapping for the oneClassAForManyClassA relation role.
    but even if I add this mapping it still can't pass the verifiy.
    So do I miss any thing or I can conclude S1 not support this one-to many self relation?
    Any hint would be welcome.

    It does.
    There is a known problem with parsing self-referenced relationship info - the one side (with <multiplicity> Many) must be the first in the <ejb-relation> entry.
    Regards,
    Marina

  • Persisting an instance of the many side of a in one to many relationship

    It seems as if most books only tell you how to setup the relationship for a one to many relationship but seems to fail to tell you the appropriate way to persist in this relationship. So, I have a parent class with many child classes. Also, I am using services and so I am converting from Entities to Dtos and visa versa.
    First, i want to insert a new child for the parent. Do I just convert the child Dto to a child entity and then persist the child entity with the reference to the parent? Then do I find the parent and add the child to the parents children so the entities are consistent?
    Or do I do a find on the parent and add the child to the parents children list and the child. Will the child be persisted automatically?
    With this said, what about updating a child? Do I remove the existing child and add a new one? or do I somehow find the child in the parents children set and update the info there and then somehow the child is persisted automatically? And since I am using Dto to entity, do I use a find to find the parent and then iterate through that parents children til I reach the child I modified by id somehow.
    What about Many to Many relationships? With a middle join table? How does JPA know to remove a join if I change the child reference? Does it remove the old and insert the new? Or do I have to do it myself somehow. Which if the later then I really can not have a parent child Dto I really need a parent childlink table where the child is referenced by the linktable? The book I have been reading has not made this very clear.

    Hello,
    The relationships cascade settings determine what should happen. I would not recommend persisting a new entity that references a non-managed entity. Instead either persist the child then make the associations or find the parent, make the associations then persist the child. In the second case, you do not need to explicietly persist the child if the parent->child relationship is marked cascade persist, since it will be found on flush or commit.
    Since you are using DTOs, updates require you merge the changes. You can directly merge the child, and if it has a link to its parent, modify the parent to add the child on the managed child that gets returned.
    As for ManyToMany, you must modify the side that controls the relationship. So if the parent owns it, then you must modify or merge the changes into the parent for the changes to be persisted to the database. If it is bi-directional, you must modify both sides so that the cache remains consistent with the database. This should be transparent to your application, and you only need an entity for the relation table if you want to map more complex information that doesn't fit into the JPA ManyToMany options. Otherwise, JPA should handle inserting and deleting enteries to the relation table for you.
    Best Regards,
    Chris

  • Merge Two Reports in Excel Analyzer - One To Many Relationship

    I want to show AR Data with CO Data - e.g. a bill + Income and it's associated account ssignemnt on the FI/CO side. I want the report to be able to show a cost centre manager to be wary of the income credited to their cost centre when a debtor has been raisedaas they may not fully pay the bill. To do this I'm using the standard DSO for AR & GL line items. Fisrtly I run a query on GL line item data where the user can select from a cost centre variable to look at credits to their cost centre. This produces a list of source documents that are used (via replacement path variable) in a second query. The second GL Query gives me a list of the allocation numbers for those line items. Had to be two queres as there are two GL postings that needed linking (this is because the cost assignment comes from a ceratin acc type and the debtor information comes from another acc type). I then use the allocation number (again via a replacement path variable) to run a third query on the AR data that shows all bills and payments linked to that allocation number. It seems to work ok.
    However I have put these three queries in an Excel Analyzer workbook. All the user does is enter a cost centre when running the report. Each query is on a different sheet but what I'd like to do is merge the data on to the one sheet. I want to see the bill and it's payments from the AR data matched up with the cost assignment from the FI/CO data. This would be a one to many relationship e.g. one bill may have it's cost assignment split over more than one cost centre. Is there anyway to do this using simple excel functionality?
    So I'd like to see:
    Allocation No. 12345 Bill £100 Revenue £50 Cost Centre 1234 £25
                                                                           Cost Centre 2345 £25
    Anybody any ideas?

    Hi,
    Thanks for your answers.
    I did explore using infosets but really struggled with joining the data and getting a sensible output. For example where a bill was done in installments I was getting 12 lines (e.g. one for each month) rather than just one. THis meant it looked liked they'd paid twleve times as much etc.
    I did also try report to report. Which to my mind worked ok. Except the customer wanted it all in "One" report rather than having to drill down to see data.
    I'll try a multiprovider but I'm worried that I'll end up with similar issues as I had when using the infoset.
    Cheers
    Joel

  • Techniques to eliminate ripple loading in one to many relationships

    Hi,
    In my domain model, I have a class O that has a one to many relationship with class M. The relationship is mapped in TOPLink as a one to many from O to M, and a one to one from M to O.
    An end user logs into our application that has an otherwise cold TOPLink cache and executes a use case that will render several to many aspects of each O instance, and there are many O instances to render a majority of the time.
    The first time a question is asked of an O instance that requires its M instances to answer the question, TOPLink will detect the unstubbing of that ValueHolder, and cause a SQL query to pull in the necessary M instances for that O instance.
    One technique to combat this ripple load is to mark the relationship between O and M to "useBatchReading". I am motivated to attempt a different technique in the particular scenario I am experiencing though.
    Another technique would seem to be to fetch all of the M instances for all of the O instances to be rendered, compute the relevant Collection of M instances for each O instance and then call mValueHolder.setValue(readCollectionOfMs) on each O instance. Is this technique feasible? Seems like it doesn't align with the intent of the TOPLink API.
    Are there any other techniques that can be used to solve this issue as well?
    Thanks,
    Doug

    Doug,
    What I believe you want is join and batch reading configured on the queries of your specific use case. That gives you much finer control then configuring these on the mappings.
    With TopLink you should have your use cases issue a fixed quantity of SQL statements irrelevant of the # of objects returned from the root query.
    Have you taken a look at the performance tuning chapter in the documentation?
    I hope this helps,
    Doug

  • What types of containers need to be used for one-to-many relationships

    While looking at toplink examples, I noticed that synchronized containers only are being used for one-to-many relationships even though it's not required by the documentation.
    Is it required?
    Also how does merge affect it? I'm gettning concurrent modification exceptions from time to time, while using iterators for containers from these relationships.
    Does it mean that I have to use enumeration on vectors only and toplink merge isn't atomic? So there is no isolation when toplink merges the data from unit of work into identity maps?
    There is nothing about thread-safety and threading aspects of accessing containers for CollectionMapping based relationships. Please advise.

    Non synchronized containers can be used but may require some extra code to handle concurrent access. If you are accessing the objects from the shared cache (not cloned in a UnitOfWork) then you will need to isolate your iteration within a synchronized block, synchronized on the collection itself, or handle the ConncurrentModificationException if they happen rarely.
    Because these are shared instances of these collections other threads may be writing to them while they are being read from.
    --Gordon

  • ONE-to-MANY relationship between tables and forms in APEX

    I recently started using APEX and I have run into an issue.
    I have a ONE-TO-MANY relationship between two tables, A1 and A2, respectively.
    A1:
    A1_ID
    Item
    A2:
    A2_ID
    SubItem
    A1_ID
    I have 2 forms (lets call it F1 and F2) that I use to capture data for A1 and A2.
    On F2, I have the following fields that are setup to capture data:
         A2.A1_ID
    **A1.Item (this is a drop down that is populated using a SELECT statement where the select uses A1.Item field)
         A2.SubItem (user would enter SubItem)
    Note: A2.A2_ID is populated using a SEQ
    Everytime I pick **A1.Item on F2, is there a way to link to A1 table and display A1.A1_ID for every **A1.Item selected on F2?
    If so, I want to store the value captured in F2 for the A1_ID field into A2 table to maintain my 1-to-MANY relationship.
    If this will work, how do I go about implementing this solution?
    Can someone help me?

    I think it sounds like you are asking for a Master-Detail form. Try that and see what you get.
    chris.

  • How do you remove items from the assets panel that are duplicated?

    How do you remove items from the assets panel that are duplicated?

    If you add an item to a slideshow, you'll usually see 2 entries for that image in the assets panel - one represents the thumbnail, and the other represents the larger 'hero' image.
    It sounds like you may have added the same image to your slideshow twice. You can select one of the hero images or thumbnail images in your slideshow and use the delete key to remove it. Then the extra 2 entries in the assets panel should disappear.

  • How can i remove items from list that have been deleted when i click on them it keeps showing empty

    how can i remove items from the list that have been deleted when i click on them it keeps showing folder empty

    Actually, Reader SHOULD keep showing documents that no longer exist, I disagree. It's no big deal, and people will quickly realise why they can't open the file. They open more files, the old ones move off.
    The REASON why it should not check is that checking whether a file exists can take a long time when things aren't good. For instance if a file server goes down, or a memory card is unplugged. That in turn would mean delays opening the File menu, and I've seen some software that can sit there for several minutes. That would really give people something of which to complain...

Maybe you are looking for