BC4J - Many-to-Many Question

I have modeled in a bc4j project a many to many relationship between AUTHOR and BOOK using an association table BOOK_AUTHOR.
My BC4J objects to model this are:
- 3 entity objects (BOOK,AUTHOR,BOOK_AUTHOR)
- 1 many-to-many association (book_author_association)
- 2 view objects (book_view,author_view)
- 1 many-to-many viewlink (BookAuthorViewLink)between book_view and author_view.
- 1 app_module with all the correct vo/viewLinks added.
- I have also created the row/vo interfaces for all of my client methods.
So my questions are:
(1)What is the best way to add an author to a book?
I’ve tried doing it in the bc4j tester and it only adds to the author table not the association table. I’ve also tried the following code in my BookViewRowImpl:
public AuthorViewRow createEmp(String name) {
          AuthorViewRow newAuthor = (AuthorViewRow) getAuthorView().createRow();
          getAuthorView().insertRow(newAuthor);
          newAuthor.setAuthorNam(name);
          return newAuthor;

I've had the same problem.
I'solved it using three different views. In your case there is a view "AuthorsView", a "BooksView" and a "AuthBookRelationsView", all of them connected with the appropriate one-to-many Associations and ViewLinks.
Creating a new many-to-many Association means first creating or selecting the corresponding rows in "BooksView" and "AuthorsView" and then inserting the correspondig row into the "AuthBookRelationsView".
The many-to-many association or the many-to-many view can only be used for reading, but not for creating a new many-to-many association.
Don't know if this is the best way to do, but however, it works! I think that BC4J might have been a little bit smarter here...
By the way, I'm using a cascading delete constraint on both associations to the intersection table. This results in both associations being composite associations, which itself is a source of a lot of trouble with BC4J. But however, it is quite useful as I do not have to bother with maintaining the intersection table once one of the master entities is deleted. Please ask, if you need more details...

Similar Messages

  • Many-to-many mapping question

    Hi,
    I'm working with two classes Car and Customer. The Car class has a Vector of Customers and the Customer class has a Vector of Car. Both are related by a many to many mapping.
    I have noticed that I have to set one of the vector to read only to avoid the error message "More than one writable many-to-many mapping can not use the same relation table" in the mapping workbench.
    I can understand that but is there a way to work around, I mean to be able to add a car to a customer and add a customer to a car with the both vectors?
    Is there something to do with the cache?
    I use Vector for the collection or Map class, have I to do otherwise?

    Hello Vladislav, I understand your first question in this thread, but I'm not sure I follow the rest, so let me respond to your first post:
    "I have noticed that I have to set one of the vector to read only to avoid the error message "More than one writable many-to-many mapping can not use the same relation table" in the mapping workbench.
    I can understand that but is there a way to work around, I mean to be able to add a car to a customer and add a customer to a car with the both vectors?"
    The issue here is that with a Many to Many mapping the mapping is responsible for writing to the association table. So, you have a "CAR_CUST" association table. Imagine you add a Car "101" to a customer "501" and the requisite customer "501" to that car "101" in your object model. Then the association table should only be updated once, with an entry of "101, 501". But since the M-M is mapped in both directions, you need to tell TopLink which of these to consider as the "master" when updating the database.
    If you didn't make one of the M-M mappings "read only", then TopLink would insert "101, 501" twice in the association table, and then at a later date you would see that the customer 501 had two 101 cars!
    We do have a feature that allows for TopLink to maintain bidirectional relationships such that if you add or remove a target from one relationship, TopLink will automatically add/remove it from the opposite direction. In my opinion this is lazy programming! A good Java developer should insist on keeping his model up to date on his own. This feature was added because it's part of the EJB spec, not necessarily because it's a good idea ;)
    - Don
    Is there something to do with the cache?
    I use Vector for the collection or Map class, have I to do otherwise?

  • CMR Many-to-Many Question

    Hi,
    I am doing an applicatiion using CMP. I have 2 tables in my database that have a many-to-many unidirectional relationship. Consequently, I have created a link table that takes the primary key value from both tables. It is the standard way for doing it in a relational databse. I have setup CMR fields in my appropriate bean class. My question is, will that link table be updated by the container when I create a new relationship?
    I have looked at the folowing code from the IBM website. I think it is a good example.
    The addRole() adds a role to a UserBean as follows:
    public void addRole(String email, String roleName){
        LocalUser user = userHome.findByPrimaryKey(email);
        LocalRole role = roleHome.findByPrimaryKey(roleName);
        Collection roles = user.getRoles();
        roles.add(role); The author the says "Thus, when a role gets added to the roles collection, the EJB container updates the datastore. Thus, the code that inserts the relationship in the datastore is the interface of the Collection class."
    Does he mean that a link table will be updated?
    If anyone has tried this could they please let me know.
    Thanks,
    Chris.

    Yeh I know I don't have to write to the database, but when I create my CMP bean I didnt map it to my link table. Therefore I'm not sure if the container will update the link table in my database.

  • Many "many-to-many-" questions ;)

    Hello everyone,
    1 - I am trying to use two many-to-many transactions on the same page. Everything seems to be working except that the supplemental fields are not inserting or updating into the database. No error is being returned.
    2 - Is there a way to validate the data that is being entered via these supplemental fields? I want to check that any item that is checked actually has a cost entered for it.
    Thanks for any help you can provide.
    A Read

    OK.. so I have figured out the problem with the first part of my question.<br /><br />It seems that there is a bug in the ADDT many-to-many wizzard when there are more than one of them in a form.<br /><br />The first transaction is referred to in all of the code as mtm_<whatever the fields are>, subsequent fields are referred to as mtm1_<whatever the fields are>, mtm2_<whatever the fields are>, etc.<br /><br />It seems that the wizzard does a good job of re-numbering all of these EXCEPT when it comes to the form's boxes name and id for any supplemental fields.  I had to re-number them from mtm_<blah blah> to mtm1_<blah blah> and now they work...<br /><br />Now onto the second part of my question.<br /><br />A Read

  • Many-to-many question

    Just asking for some help with some search terms, as I know that this topic has been argued out somewhere. I just haven't been able to find it:
    If I'm setting up a cross-reference/junction table in order to fulfill a many-to-many requirement, should I create a technical key as a primary key with a unique index on the combined foreign keys? Or should I make the combination of the foreign keys the primary key?
    Our newest standards force a technical key on all tables, and one of the Developers is asking why that's necessary on a cross-reference table. I've searched on "cross reference table primary key", "junction table primary key". Most answers suggesting a technical key are due to database performance issues that can be solved with it (not suggested for that reason for Oracle that I've found yet).
    --=Chuck

    >
    If I'm setting up a cross-reference/junction table in order to fulfill a many-to-many requirement, should I create a technical key as a primary key with a unique index on the combined foreign keys? Or should I make the combination of the foreign keys the primary key?
    >
    Assuming that each of your foreign keys is a surrogate key and not an actual data value, I have to agree with Dan on this one.
    The two primary attributes that a key value should have are: 1) it should be unique and 2) it should have no inherent meaning.
    By 'no inherent meaning' I mean it should NOT be a data value or have any meaning whatsoever attached to its value. If the value were to change it would have no impact at all on the actual data though naturally the value has to be changed the same everywhere it is used.
    A classic example in the U.S. is social security number. It should NOT be used as a key even though it might be considered a 'natural' key.
    The value is a data item that has meaning and is subject to change if for no other reason than typographical error. It is the problems involved in making changes to data items used as keys that surrogate keys are intended to prevent.
    A surrogate key (even a sequence) has no inherent meaning. If a value of 2 is being used in a system and, unknown to you, someone changes the value to a 3 everywhere in your system that it is used you will never notice it.
    I have seen no standard suggesting that multi-column surrogate keys are inappropriate. Your intersect table can use the combination of the foreign keys as the primary key and fulfill the contract of using surrogate keys.
    Sven suggested this
    >
    For example you later discover that you want a detail table for your joined table. Then the detail table would need only one column as a foreign key constraint, instead of two (which can have major performance implications).
    >
    If if was desired to meet that future requirement by using one column you can easily do so by adding a new column specifically for that purpose without any impact whatsoeve on the existing system.
    As for this possible architecture change
    >
    Or you add some third column to include into the uniqueness logic.
    >
    Well that requirement is a fundamental change to your existing one. The existing requirement is that the combination of the two foreign keys should be unique. It is not clear if Sven was suggesting that that requirement is no longer valid or if rather suggesting that there is no an ADDITIONAL requirement that those two values as well as a third should also be unique.
    If you need to implement uniqueness for the two values you currently have as well as for those combined with a third value that would be better implemented by creating yet another INTERSECT table specifically for that purpose and leave the existing intersect table in place. That architecture approach expands the data model without disrupting the existing one.
    The main design goal, in my opinion, should always be to produce a design which most easily meets current requirements without foreclosing the ability to meet unknown future requirements.

  • BC4J many-to-many relationship

    I tried out the how to "Create Many-to-Many Associations and View Links".
    In the Business Component Browser I can only browse the data, but I can't assign a new detail to a master (e.g. a product to a warehouse).
    In an real-world application I want to assign details to masters, specify attributes of the intersection table (in the how to: inventories.quantity_on_hand) and have triggers and sequences for the id columns.
    How to create Associations and View Links for that?
    Bye
    Holger

    Does anyone have details on how to do this? I had the same problem recently and my "solution" was to create a new VO for the intersection table and then insert/remove rows directly to that to manage the relationships. It seems rather redundant to have to do it this way.

  • Many-to-many relationship question

    Hello,
    Could you please provide an EXAMPLE of sun-cmp-mappings.xml with many-to-many relations (using a secondary table).
    Thanks.

    I think it is important to make the distinction between the mapping of many-to-many relations (join tables) and secondary tables.
    There is a many to many mapping in the samples. The roster sample has it. You can read through the sun-cmp-mappings.xml file for that to see how to do a join table. The fields that you want to look at are Player's teams field and Team's players field.
    The secondary table allows you to map columns from multiple tables into a single entity bean. For example:
    I may have an Address bean with the usual fields; street, city, state, and postal/zip code.
    I may need to map this Bean onto a database with the following tables
    ADDR
    STRT_KEY,
    ZIP_KEY
    and
    STRT
    STRT_KEY,
    STRT_STRING
    ZIP
    ZIP_KEY,
    CITY_STRING,
    STATE_STRING
    In my mapping for the Address bean's zip field, the mapping would need to look like:
    <entity-mapping>
    <ejb-name>Address</ejb-name>
    <table-name>ADDR</table-name>
    <cmp-field-mapping>
    <field-name>city</field-name>
    <column-name>ZIP.CITY_STRING</column-name>
    </cmp-field-mapping>
    <secondary-table>
    <table-name>ZIP</table-name>
    <column-pair>
    <column-name>ADDR.ZIP_KEY</column-name>
    <column-name>ZIP.ZIP_KEY</column-name>
    <column-pair>
    </secondary-table>
    The secondary table element defines join between the two tables, so the field can resolve to a single value.

  • QUESTION:  HOW TO WRITE QUERY  WITH MANY TO MANY RELATIONSHIPS

    Could someone help me out here?
    I was sitting here looking at some tables ie table_name and synonyms and wondering.
    If a table can belong to many synonyms and a synonym can belong to many tables how would one write a query where I would like to know which tables belong to each synonym or on the other hand which synonym belongs to what tables?
    Would I try to develop an outside join for this, a corrolated query or a query with a subquery or would there be another format that would work better?
    What would be the best method of attack on this?
    Thanks for your thoughts on this.
    al

    Actually, the relationship is not many to many. A table can have many synonyms, but a synonym within a namespace (i.e. a PUBLIC synonym, or a private synonym created by a user) can only point to one table. The xxx_synonmys tables already contain the information about the table_name and table_owner.
    John

  • New User Question : Many to Many relationship Association

    Hi
    I am trying to code a many to many relationship between two entities. One of my entity is named View and the other is Column.
    I am trying to use the @JoinTable annotation and for the table property in the annotation I am specifying a table column_view (which I have created in the database).
    My associative table has other fields, apart from the primary key of view and column entities. This makes me feel that my current way of using @JoinTable would not work under this condition and I have to create two onetomany mappings like
    Column -> OnetoMany -> ColumnView <- OnetoMany <- View.
    Am I right in my approach or is there anyother way out to represent such manytomany relationships.

    Why other fields are required in your relationshipt table?
    have only two columns and perform @ManyToMany.
    @JoinTable has to be used only on owning side.
    user (mappedBy ) on the other side
    thanks

  • Many to Many Relationships in ejb.....Urgent Pls help

    hi all,
    Am working in EJB.Now we are coding for many to many relationship.
    Company and Salary register
    One Company can have many salary register and More than one company can have one salary register
    Companyand Salary register are the two tables having details of it.And the intermediate table having pk of company and salary register is Company_salary_register table,I want to add the value in this table having seperate interface.
    How to model it? I have given the add method of this company_salary_register table in company bean.I am getting the value of this one as collection.But it is asking me to add the values as the instance of LocalSalary(interfaceand entitybean).If i type cast it as Local Salary Class castexception occurs
    Please help me.Even Material of Modelling Many to Many relationship in EJB is enough.
    thanx in advance,

    THaaaaaanks alottt for the quick reply...
    I used the first way to insert the document and i was successful...
    but thing is that..
    when i do
    SQL>desc message_type
    message_type is NOT FINAL
    Name Null? Type
    SYS_XDBPD$ XDB.XDB$RAW_LIST_T
    to VARCHAR2(4000 CHAR)
    from VARCHAR2(4000 CHAR)
    subject VARCHAR2(4000 CHAR)
    body VARCHAR2(4000 CHAR)
    i can see the structure...
    and when i
    select count(*) from messages
    it says count is 1.
    so how to know where the data is ..like below in the data :
    'to' it has '[email protected]'
    and for 'from' it has '[email protected]'..and so on..
    <message>
    <to>[email protected]</to>
    <from>[email protected]</from>
    <subject>Question</subject>
    <body>Does this demo work?</body>
    </message>
    so what is the command to get that data...
    because when i do
    select * from message_type..it says
    select * from message_type
    ERROR at line 1:
    ORA-04044: procedure, function, package, or type is not allowed here
    Plss help me outt.......this will be my final step...
    Thankssssssssssssssss

  • Creating data in a many-to-many-relationship

    Hello,
    we really have problems in implementing a JClient dialog based on BC4J for creating data in a many to many relationship - especially with cascade delete on both sides.
    Simplified our tables look like:
    create table A_TABLE
    A_ID VARCHAR2(5) not null,
    A_NAME VARCHAR2(30) not null,
    constraint PK_A_TABLE primary key (A_ID),
    constraint UK_A_TABLE unique (A_NAME)
    create table B_TABLE
    B_ID VARCHAR2(5) not null,
    B_NAME VARCHAR2(30) not null,
    constraint PK_B_TABLE primary key (B_ID),
    constraint UK_B_TABLE unique (B_NAME)
    create table AB_TABLE
    A_ID VARCHAR2(5) not null,
    B_ID VARCHAR2(5) not null,
    constraint PK_AB_TABLE primary key (A_ID, B_ID),
    constraint FK_AB_A foreign key (A_ID) references A_TABLE (A_ID) on delete cascade,
    constraint FK_AB_B foreign key (B_ID) references B_TABLE (B_ID) on delete cascade
    Could JDev Team please provide a BC4J/JClient sample that performs the following task:
    The dialog should use A_TABLE as master and AB_TABLE as detail. The detail displays the names associated with the IDs. Next to AB_TABLE should be a view of B_TABLE which only displays rows that are currently not in AB_TABLE. Two buttons are used for adding and removing rows in AB_TABLE. After adding or removing rows in the intersection the B_TABLE view should be updated. The whole thing should work in the middle and client tier. This means no database round trips after each add/remove, no posts for AB_TABLE and no query reexecution for B_TABLE until commit/rollback.
    This is a very common szenario: For an item group (A_TABLE) one can select and deselect items (AB_TABLE) from a list of available items (B_TABLE). Most of JDeveloper4s wizards use this. They can handle multi/single selections, selections from complex structures like trees and so on. Ok, the wizards are not based on BC4J - or? How can we do it with BC4J?
    Our main problems are:
    1. Updating the view of B_TABLE after add/remove reflecting the current selection
    2. A good strategy for displaying the names instead of the IDs (subqueries or joining the three tables)
    3. A JBO-27101 DeadEntityAccessException when removing an existing row from AB_TABLE and adding it again
    Other problems:
    4. We get a JBO-25030 InvalidOwnerException when creating a row in AB_TABLE. This is caused by the composition. We workaround this using createAndInitRow(AttributeList) on the view object (instead of create()). This is our add-Action:
    ViewObject abVO = panelBinding.getApplicationModule().findViewObject("ABView");
    ViewObject bVO = panelBinding.getApplicationModule().findViewObject("BView");
    Row bRow = bVO.getCurrentRow();
    NameValuePairs attribList = new NameValuePairs(
    new String[]{"BId"}, new Object[]{bRow.getAttribute("BId")});
    Row newRow = abVO.createAndInitRow(attribList);
    abVO.insertRow(newRow);
    5. After inserting the new row the NavigationBar has enabled commit/rollback buttons and AB_TABLE displays the row. But performing a commit does nothing. With the following statement after insertRow(newRow) the new row is created in the database:
    newRow.setAttribute("BId", bRow.getAttribute("BId"));
    Please give us some help on this subject.
    Best regards
    Michael Thal

    <Another attempt to post a reply. >
    Could JDev Team please provide a BC4J/JClient sample
    that performs the following task:
    The dialog should use A_TABLE as master and AB_TABLE
    as detail. The detail displays the names associated
    with the IDs. Next to AB_TABLE should be a view of
    B_TABLE which only displays rows that are currently
    not in AB_TABLE. Two buttons are used for adding and
    removing rows in AB_TABLE. After adding or removing
    rows in the intersection the B_TABLE view should be
    updated. The whole thing should work in the middle
    and client tier. This means no database round trips
    after each add/remove, no posts for AB_TABLE and no
    query reexecution for B_TABLE until commit/rollback.
    This is a very common szenario: For an item group
    (A_TABLE) one can select and deselect items
    (AB_TABLE) from a list of available items (B_TABLE).
    Most of JDeveloper4s wizards use this. They can
    handle multi/single selections, selections from
    complex structures like trees and so on. Ok, the
    wizards are not based on BC4J - or? How can we do it
    with BC4J?
    Our main problems are:
    1. Updating the view of B_TABLE after add/remove
    reflecting the current selectionYou should be able to use insertRow() to insert the row into proper collection.
    However to remove a row only from the collection, you need to add a method on the VO subclasses (and perhaps export this method so that the client side should see it) to unlink a row from a collection (but not remove the associated entities from the cache).
    This new method should use ViewRowSetImpl.removeRowAt() method to remove the row entry at the given index from it's collection. Note that this is an absolute index and not a range index in the collection.
    2. A good strategy for displaying the names instead
    of the IDs (subqueries or joining the three tables)You should join the three tables by using reference (and perhaps readonly) entities.
    3. A JBO-27101 DeadEntityAccessException when
    removing an existing row from AB_TABLE and adding it
    againThis is happening due to remove() method on the Row which is marking the row as removed. Attempts to add this row into another collection will throw a DeadEntityAccessException.
    You may 'remove the row from it's collection, then call 'Row.refresh' on it to revert the entity back to undeleted state.
    >
    Other problems:
    4. We get a JBO-25030 InvalidOwnerException when
    creating a row in AB_TABLE. This is caused by the
    composition. We workaround this using
    createAndInitRow(AttributeList) on the view object
    (instead of create()). This is our add-Action:
    ViewObject abVO =
    O =
    panelBinding.getApplicationModule().findViewObject("AB
    iew");
    ViewObject bVO =
    O =
    panelBinding.getApplicationModule().findViewObject("BV
    ew");
    Row bRow = bVO.getCurrentRow();
    NameValuePairs attribList = new NameValuePairs(
    new String[]{"BId"}, new
    String[]{"BId"}, new
    Object[]{bRow.getAttribute("BId")});
    Row newRow = abVO.createAndInitRow(attribList);
    abVO.insertRow(newRow);This is a handy approach. Note that Bc4j framework does not support dual composition where the same detail can be owned by two or more masters. In those cases, you also need to implement post ordering to post the masters before the detail (and reverse ordering for deletes).
    >
    5. After inserting the new row the NavigationBar has
    enabled commit/rollback buttons and AB_TABLE displays
    the row. But performing a commit does nothing. With
    the following statement after insertRow(newRow) the
    new row is created in the database:
    newRow.setAttribute("BId",
    d", bRow.getAttribute("BId"));This bug in JDev 903 was fixed and a patch set (9.0.3.1) is (I believe) available now via MetaLink.
    >
    >
    Please give us some help on this subject.
    Best regards
    Michael Thal

  • Many-to-Many CMR

    hi all,
    i defined two entity beans, Quiz and Question, with many-to-many cmr and
    a table named Quiz_questions_Question_quizesTable is created in the database after deployment process. the formed table columns consist of primary key of Quiz and primary key of Question, as expected. what i want to do is adding one more column to this table that shows the sequence number of the related question in the related quiz. is it possible? and how? or what should i do?
    thanks in advance..

    "what i want to do is adding one more column to this table that shows the sequence number of the related question in the related quiz."
    Makes sense, but then the association table is no longer just an association table.
    Perhaps a way to get you in the right frame of mind is, "how would you model this with just objects?"
    Basically a CMR just represents an association between two objects. You would see in your revised object model that you do not have a simple n-to-n association between a Quiz objects and a Question objects.[Quiz](0..n)---->(1..n)[Question]The above (bastardized UML) model does not represent the enumeration of Question objects within the scope of a single Quiz object.
    Perhaps the following is more accurate:[Quiz](1)---->(1..n)[QuizQuestion](0..n)---->(1)[Question]or                     [Question]
                              A
                              |
                              |
    [Quiz](1)---->(1..n)[QuizQuestion]It is only after you have your object model that you should worry about the entity bean stuff.

  • Many to many relationship mapping.

    Hi
    I have a basic question on how to create a good java class model (POJOs) based on the database model.
    I Have to follwing tables
    Table1 with columns as
    ID1
    name
    description
    Table2 with columns as
    ID2
    dateCreated ..etc.
    Since there is a many to many relationship between table1 and table2
    So to map that we have a table3 with columns
    ID3
    ID1 // fk table1
    ID2 // fk table2
    browserName
    startTime
    endTime
    So when I create Java classes:
    // corresponding to table 1
    Class MyTable1
    private Integer ID1;
    private List ID2; // to map with the table2
    // corresponding to table 2
    Class MyTable2
    private Integer ID2
    private List ID1; // to map with table 1
    In this way I can create my classes. Is this the best way to put it together.
    And where to put the attributed specific to table3. Like the BrowserName and the StartTime and the EndTime.
    Any suggestion please.
    Thanks.

    Your names leave a lot to be desired. Let's start with an example. Suppose I have a problem involving employees and the tasks assigned to them. An employee may have any number of tasks assigned to them and a task can be assigned to any number of employees. The assignment itself has more attributes: when it was assigned, its priority and so on.
    public interface Employee {
        Long getId(); //etc...
        Set<Assignment> getAssignments();
        void setAssignments(Set<Assignment> assignments);
    public interface Task {
        Long getId(); //etc...
        Set<Assignment> getAssignments();
        void setAssignments(Set<Assignment> assignments);
    public interface Assignment {
        Long getId(); //etc...
        Employee getEmployee();
        void setEmployee(Employee employee);
        Task getTask();
        void setTask(Task task);
    }This assumes you want to navigate in all directions: from an employee to their assignments, from a task to its assignments and from an assignment to it employee and task.

  • [ADF] Adding/deleting entries in a many-to-many relationship

    I am using JDeveloper 10.1.3 and the ADF BC / ADF Model / ADF Faces / JSF technology stack.
    For this question, I am using the SRDemo application as an example, specifically the many-to-many relationship between USERS and PRODUCTS (the Staff Expertise relationship), outlined in red in this schema diagram: Image Link
    Users may have any number of product expertise areas and many users may have the same product expertise area. For the purposes of this example I have added two reference fields from the PRODUCT table into the ExpertiseAreas VO (Name and Description), outlined in red in this data control palette section: Image Link
    I have created a page which shows the details of a user (1), along with a table showing the expertise areas the user has (3), and a table of all the products available (2), numbered on this design page: Image Link and corresponding to the numbered data controls on this data control palette section: Image Link, where 1 is rendered as an ADF Read-only Form, 2 is an ADF Read-only Table with a tableSelectMany element in the selection facet, and 3 is also an ADF Read-only Table.
    What I am trying to do is have the tableSelectMany element reflect which of the products are linked to the current user in the expertise areas relationship (by having the checkbox for currently linked products checked), and when you check or uncheck a product's checkbox, it should add or remove the row in the EXPERTISE_AREAS intersection table, respectively (asume for this example that there are default values for Expertise Level and Notes).
    So far I have been following the process used in section 19.8 of the ADF Developer's Guide for Forms/4GL Developers, which describes how to set up a selectManyShuttle which implements the adding and deleting functionality. So I have a Client Interface method in the Application Module, updateSkillsForCurrentStaff (described in section 10.6.7.2), and I have a selection listener for the assignment table in the backing bean for the page, which calls the updateSkillsForCurrentStaff method:
    public void selectionChanged(SelectionEvent event)
      BindingContainer bc = getBindings();
      DCIteratorBinding productsIB = (DCIteratorBinding)bc.get("ProductListIterator");
      Set keys = getTable1().getSelectionState().getKeySet();
      Iterator iter = keys.iterator();
      List productIds = new Vector();
      while (iter.hasNext())
        String product = ((Key)iter.next()).toStringFormat(true);
        productsIB.setCurrentRowWithKey(product);
        ViewRowImpl productRow = (ViewRowImpl)productsIB.getCurrentRow();
        Number productId = (Number)productRow.getAttribute("Id");
        productIds.add(productId);
      OperationBinding ob = bc.getOperationBinding("updateSkillsForCurrentStaff");
      Map pm = ob.getParamsMap();
      pm.put("productIds", productIds);
      ob.execute();
    All of this works, but I can't work out how to link the selection state of the assignment table to the expertise areas that are linked to the user. Also I think the method listing above must be a bit of a hack, but I don't know enough about this to know if there's an easier way of doing it.
    Any help is appreciated.

    Have a look at this example I cooked up for you.
    http://radio.weblogs.com/0118231/2006/10/03.html#a739
    It might not be the first way one thinks to implement something, but it illustrates a very interesting, model-centric approach to the problem you propose.
    My feelings won't be hurt if you prefer a more view-centric approach, but I wanted to illustrate what was a maximally-model-centric solution (in fact, which doesn't even require a backing bean!) If you like a more view-centric approach, I can help you figure out what's wrong with your key-handling above. For one, I would probably start by passing the Set of Key's directly to the middle tier application module method to eliminate client-side code.
    Check it out and let me know what you think. Try it directly in the Business Components Tester to appreciate one of the benefits a model-centric solution can bring.

  • Help needed on Many to Many Parent Child Relationship (PL/SQL)

    Friends,
    Please help me.
    I have table where in two columns are having many to many parent child relation ship. It means child can have multiple parents.
    Table strucuture and sample records given below. Here 334059 is GRAND PARENT of all child records.
    PARENT     CHILD     LEVEL     Usage
    334059     380499     1     This Level has 2 childs
    334059     334730     1     
    334730     335629     2     This level too has 2 childs where in 380499 is child of 334730 & 334059 also.
    334730     380499     2     
    380499     380497     2     This level has 3 childs and 88888 is having further child.
    380499     334730     2     
    380499     88888     2     
    88888     99999     3     It has one child 99999 and has further child 10101.
    99999     10101     4     It has one child 10101 and has further child 11111.
    10101     11111     5     It has one child 11111 and has no further child. I.e leaf node.
    11111     0     6     leaf node
    What I want is records in same level above. I am using below code but its implementing only UPTO 2nd LEVEL given above.
    Further its not going i.e 3,4,5,6 level. Could you please help me?
    DECLARE
    CURSOR main_pc(p_child pc.child%type) IS
    SELECT CHILD
    FROM pc where parent = p_child;
    CURSOR main_dw(p_child dw_exrdbo.exr_parent_child.child_fund%type,
    p_level NUMBER) IS
    SELECT DISTINCT CHILD_FUND,LEVEL_NUMBER FROM dw_exrdbo.exr_parent_child
    where parent_fund = p_child
    and parent_fund <> child_fund
    and level_number = p_level;
    v_next_parent pc.child%type;
    v_level NUMBER := 1;
    v_grand_parent dw_exrdbo.exr_parent_child.parent_fund%type := 334059;
    v_parent dw_exrdbo.exr_parent_child.parent_fund%type;
    vDone BOOLEAN;
    v_xyz dw_exrdbo.exr_parent_child.parent_fund%type;
    v_cnt NUMBER := 0;
    BEGIN
    DELETE FROM dw_exrdbo.exr_parent_child;
    COMMIT;
    INSERT INTO dw_exrdbo.exr_parent_child
    SELECT PARENT, CHILD, 'INVONE', 12345, 'P',0,1
    FROM pc where parent = v_grand_parent
    AND NOT EXISTS (select 'x' from dw_exrdbo.exr_parent_child where parent_fund = v_grand_parent);
    COMMIT;
    FOR i IN (select distinct child FROM pc WHERE parent = v_grand_parent) --334059
    LOOP
    DBMS_OUTPUT.PUT_LINE('Next Parent is '||v_parent);
    FOR x IN main_pc(i.child)
    LOOP
    INSERT INTO dw_exrdbo.exr_parent_child
    (parent_fund, child_fund, source_application, valuation_date_sid, parent_child_flag, child_count, level_number)
    VALUES(i.child, X.CHILD, 'INVONE', 12345, 'C',0,1+1);
    COMMIT;
    END LOOP;
    END LOOP;
    END;
    Thanks in advance!!!
    Regards,
    Jigger

    Hi, Jigger,
    Sorry, I can't tell what you want.
    Whenever you have a question, please post CREATE TABLE and INSERT statements for your sample data, and the results you want from that data.
    Explain, using specific examples, how you get those results from that data.
    Always say what version of Oracle you're using.

Maybe you are looking for

  • How can we split the image when its added dynamically ?

    Hi Experts, I have an image where i'm calling a DAL in Entry tab Data section under section level properties.As you know that will execute during Entry process.In that DAL i'm Adding an image based on the user choice during entry. When image added th

  • How to install BR1310 for WLC

    Hello all, I have a project ahead and I need to clarify some things before starting this project. I will install a new WLC 5508 and I have 8 AIR-BR1310G-A-K9-R, so Im wondering if I can use them. - Can this model be converted to LAP?, right now they

  • Issue with HFM installation

    Hi friends, I am using iss 6.0 for web server and tomcat as application server during installation.WE are using 2 systems t1-windows xp t2- windows 2003 server I am aware that iis5.1 in windows xp is not suppoted as per the support matrix.Initially i

  • Rollover images stop working when image lies on top

    Hello, I am trying to place a PNG image over my menu bar. This is a swoosh which overlaps certain areas on the menu bar, the swoosh is a PNG file with no BG. It seems that the swoosh retaining box, stops the rollover buttons from working. They work u

  • Edit Responsive Design template using Adobe Contribute

    Hi, I am creating a website which is based on responsive design layout. I am using HTML5 and CSS3 for the framework. It has 5 static pages e.g. "About US", "FAQ", "Contact US" My customer wants to edit the content of the page using Adobe Contribute.