No refresh in many-to-many relation (UIX)

Views:
SentenceView
id, content
SentenceHumanView (intersection table)
id, sentence_id, human_id
HumanView
id, content
Associations:
SentenceHumanMNAssoc(* to *):
Sentence.id - SentenceHuman.sentence_id and
SentenceHuman.human_id - Human.id
where Sentence is source, SentenceHuman is intersection and Human is Destination
ViewLinks:
SentenceHumanViewLink(* to *) based on SentenceHumanMNAssoc assocciation
SentenceTableViewLink(0..1 to *) based on (Sentence.id - SentenceHuman.sentence_id)
Module:
SentenceView1
- HumanView1 via SentenceHumanViewLink1
- SentenceHumanView1 via SentenceTableViewLink1
UIX:
page1. presented SentenceView as Read-Only Table where I can select a row and go to page2.
page2. presented SentenceView - HumanView (via SentenceHumanViewLink) as One-to-Many (Sentence is master and Human is detail) where I can select a row with human content and go to create/modify page3
page3. presented SentenceHumanView (via SentenceTableViewLink) as Input Form (only one field: "human_id" droped as MessageLovInput)
In this page I can create or modify a row in intersection table SentenceHuman which contains foreign keys sentence_id and human_id and return to page2. If I create new row or modify existing, after returning via commit to page2, I should see new or modified row in Human (detail) table, but nothing happens. I can see them only after restarting bc4j server.
If this is a question of refreshing view, then which view should I refresh and why?
Any thoughts about this?

Up!
Could someone help?

Similar Messages

  • Many-to-Many relation sample in ADF

    I have a requirement to implement a screen
    Three tables 1) Users 2) Access 3) Documents
    The Access table contains both the references DocId and UserId and acts as the intersection table.
    Users table is related to Documents through the Access table which acts as the intersection table and vice versa. I need to create a screen gui which will show all the documents a user has. Secondly also show all the users who has permission to a particular document. Is there any sample adf application which implements a simple many-to-many relation.
    I am planning to create three entity objects - UsersEO, AccessEO, DocumentsEO
    two view objects - UsersVO and DocumentsVO
    one view link -UsersDocumentVL
    Also which GUI components is best suited to address this. How many Entity Objects, View Objects and View Link should I create. Any simple sampe will help.
    Regards
    Thomas

    Thomas,
    There are of course many ways to implement your requirement. Try this exercise... forget about ADF for a moment; put your computer away (well, finish reading this first ;) ). Grab a pencil and paper.. assuming you could do anything, how would you like the screen to work? Draw it out on a piece of paper and describe how it works. You've just created a rudimentary specification. Now, come back to this thread and describe your specification - perhaps then we can help you implement your spec using ADF (or at least tell you "not possible" and describe why).
    Best,
    John

  • Problem in mapping a many to many relation to a list

    Hi,
    I have a problem with mapping a many to many relation to a list.
    I have a Many to Many relation in my database between tables baskets and products. This relation is implemented with a join table basket_products, which has two fields which correspond to the foreign keys to tables baskets and products. The join table need to have another one column "order", which defines the order of the products for the specific basket.
    In my mapping I have:
    @Entity
    @Table(name = "baskets", uniqueConstraints = {})
    public class Components implements java.io.Serializable {
    @ManyToMany(cascade = { CascadeType.ALL }, fetch = FetchType.LAZY)
         @JoinTable( name="baskets_products",
                             joinColumns=@JoinColumn(name="b_id", referencedColumnName="pr_id"),
                             inverseJoinColumns=@JoinColumn(name="pr_id", referencedColumnName="pr_id"))
            //This of course doesn't work!!
           //@OrderBy(value="order")
         public List<Products> getProductses() {
              return this.productses;
         public void setProductses(
                   List<Products> productses) {
              this.productses = productses;
    @Entity
    @Table(name = "products", uniqueConstraints = { })
    public class Products implements java.io.Serializable {
    @ManyToMany(cascade = { CascadeType.ALL }, fetch = FetchType.LAZY, mappedBy = "productses")
         public Set<Baskets> getBasketses() {
              return this.basketses;
         public void setBasketses(Set<Basket> basketses) {
              this.basketses = basketses;
         }In the EJB spec I read that :
    "The property or field name must correspond to that of a persistent property or field of the associated
    class."
    What to do if I want to use a field from the join table to do the ordering of the list??
    My problem is that the field "order", is not defined to the EJB container as a persistent field, so it cannot be used. But for my needs it is necessary that this field is included in the join table.
    I thought that I could use the secondary table annotation to map the join table to the Baskets class, as well, so that I can define the order field, but this solution seems to me as a really wrong one.
    Can anyone help me??
    Thanks,
    Elenh.

    Hi Martin-
    Can you please help me. Here are the details:
    We have created an AQ in Oracle DB which will have the following message Structure:
    CREATE OR REPLACE TYPE enqueue_payload AS OBJECT
    ( field1 VARCHAR2(100),
    field2 VARCHAR2(100),
    field3 DATE,
    field4 VARCHAR2(100),
    field5 NUMBER,
    payload CLOB,
    In the Payload field we are enqueing an XML message.
    We have to use a OSB proxy service to dequeue the message from the AQ, transform it to another format and send to a SOA Composite.
    We created a AQ Adapter in Jdeveloper 11g and imported the WSDL, XSD and .jca jca binding file into the OSB project. And configured the OSB proxy service using the WSDL imported.
    However in OSB proxy service message flow when I try to create an XQUERY transformation, I see that the Payload field does not expose the structure of the XML message that is being enqueued. I even changed the message structure definition to have the payload field as XMLType. But it didn't help.
    On analyzing the XSD created by AQ Adapter, I see that the payload is being defined as "string" in the XSD.
    Inputs Needed
    =========
    1. How can we parse the payload field defined as CLOB/XMLType in OSB so that I can see the structure of the XML message it holds ?
    2. Is there any in-built function in OSB to convert it to XML ?
    3. Any other inputs in order to transform the XML message coming in the payload field as CLOB/XMLType
    Please provide your inputs and I hope that I have clearly explained my use case.
    Thanks in advance for your time and help!!
    Regards,
    Dibya

  • Additional properties on Many-to-Many relation

    Hi,
    I've trawled through the archive and can't see if this is answered (nor can I find it in the documentation) so apologies if I've missed something obvious.
    I have a logical model with several many-to-many relationships. Clearly I can (and probably should) resolve them, but for a number of reasons I'd prefer, for now, to leave them as m:n.
    On at least one of the m:n I want to add additional (non-FK attributes) to the relationship. There is even a section of the Relation Properties dialog that looks like it should allow me to do so (Attributes) but this is only populated in a 1:m relationship.
    Is there any way of directly adding the non-FK attributes to the relationship? Or do I have to resolve the m:n and add the attributes to the new entity? Or is there some way in the transformation of adding the attributes?
    Thanks
    Ian

    Hi Ian,
    I want to add additional (non-FK attributes) to the relationshipIt's not possible in current release.
    It's better to resolve the relationship to entity and to add attributes there.
    Philip

  • Many-to-many relation

    Hi,
    There is a many-to-many relation defined for the following tables:
    Table T_PRICEAFFECTOR
    Name Type
    NAME VARCHAR2(100)
    ISACCUMULATIVE NUMBER(1)
    RATE NUMBER(10,10)
    PRICEAFFECTOR_ID NOT NULL NUMBER(10)
    CATALOG_ID NOT NULL NUMBER(10)
    UNITTYPE NOT NULL NUMBER(1)
    and
    Table T_PRICEAFFECTINGCHAIN
    Name Type
    PRICEAFFECTINGCHAIN_ID NOT NULL NUMBER(10)
    NAME VARCHAR2(100)
    ISDEFAULTFORSTORE NUMBER(1)
    CATALOG_ID NOT NULL NUMBER(10)
    There is also a third table defining the many-to-many relation:
    TABLE T_PRICEAFFECTORTOCHAIN
    Name Type
    PRICEAFFECTOR_ID NOT NULL NUMBER(10)
    PRICEAFFECTINGCHAIN_ID NOT NULL NUMBER(10).
    The classes defined are as follows:
    public class PriceAffectorsChain
         private Catalog catalog;
         private long priceAffectorsChainId;
         private String name;
         private boolean isDefaultForStore;
         private Collection priceAffectors = new HashSet ();
         private Collection products = new HashSet ();
    public class PriceAffector
         private long priceAffectorId;
         private long isAccumulative;
         private String name;
         private double rate;
         private Catalog catalog;
         private int unitType;
         private Collection priceAffectorsChains = new HashSet ();
    and these are defined in the jdo descriptor in the following way:
    <class name="PriceAffector" identity-type="application"
    objectid-class="jp.telewave.platpark.eis.dao.pk.PriceAffectorPK">
         <extension vendor-name="kodo" key="lock-column" value="none"/>
         <extension vendor-name="kodo" key="class-column" value="none"/>
         <extension vendor-name="kodo" key="table" value="T_PRICEAFFECTOR"/>
         <field name="priceAffectorId" primary-key="true">
              <extension vendor-name="kodo" key="data-column"
    value="PRICEAFFECTOR_ID"/>
         </field>
         <field name="isAccumulative">
              <extension vendor-name="kodo" key="data-column" value="ISACCUMULATIVE"/>
         </field>
         <field name="name">
              <extension vendor-name="kodo" key="data-column" value="NAME"/>
         </field>
         <field name="rate">
              <extension vendor-name="kodo" key="data-column" value="RATE"/>
         </field>
         <field name="unitType">
              <extension vendor-name="kodo" key="data-column" value="UNITTYPE"/>
         </field>
         <field name="catalog">
              <extension vendor-name="kodo" key="catalogId-data-column"
    value="CATALOG_ID"/>
         </field>
         <field name="priceAffectorsChains">
              <collection element-type="PriceAffectorsChain"/>
              <extension vendor-name="kodo" key="read-only" value="true"/>
              <extension vendor-name="kodo" key="inverse" value="priceAffectors"/>
              <extension vendor-name="kodo" key="table"
    value="T_PRICEAFFECTORTOCHAIN"/>
              <extension vendor-name="kodo" key="priceAffectorId-ref-column"
    value="PRICEAFFECTOR_ID"/>
              <extension vendor-name="kodo" key="priceAffectorsChainId-data-column"
    value="PRICEAFFECTINGCHAIN_ID"/>
         </field>
    </class>
    <class name="PriceAffectorsChain" identity-type="application"
    objectid-class="jp.telewave.platpark.eis.dao.pk.PriceAffectorsChainPK">
         <extension vendor-name="kodo" key="lock-column" value="none"/>
         <extension vendor-name="kodo" key="class-column" value="none"/>
         <extension vendor-name="kodo" key="table" value="T_PRICEAFFECTINGCHAIN"/>
         <field name="priceAffectorsChainId" primary-key="true">
              <extension vendor-name="kodo" key="data-column"
    value="PRICEAFFECTINGCHAIN_ID"/>
         </field>
    <field name="catalog">
              <extension vendor-name="kodo" key="catalogId-data-column"
    value="CATALOG_ID"/>
         </field>
         <field name="name">
              <extension vendor-name="kodo" key="data-column" value="NAME"/>
         </field>
         <field name="isDefaultForStore">
         <extension vendor-name="kodo" key="data-column"
    value="ISDEFAULTFORSTORE"/>
         </field>
         <field name="priceAffectors">
              <collection element-type="PriceAffector"/>
              <extension vendor-name="kodo" key="read-only" value="false"/>
              <extension vendor-name="kodo" key="inverse"
    value="priceAffectorsChains"/>
              <extension vendor-name="kodo" key="table"
    value="T_PRICEAFFECTORTOCHAIN"/>
              <extension vendor-name="kodo" key="priceAffectorsChainId-ref-column"
    value="PRICEAFFECTINGCHAIN_ID"/>
              <extension vendor-name="kodo" key="priceAffectorId-data-column"
    value="PRICEAFFECTOR_ID"/>
         </field>
         <field name="products">
         <collection element-type="Product"/>
         <extension vendor-name="kodo" key="inverse" value="priceAffectorsChain"/>
         </field>
    </class>
    =============================================================
    Ok. The problem with the mapping is that it works only one way. What I
    mean is that when I try to add new PriceAffectorsChain with many
    PriceAffector objects only the PriceAffectorsChain object is being
    persisted, and none of the PriceAffectors are persisted in the
    many-to-many table (T_PRICEAFFECTORTOCHAIN), even when the read-only
    extensions are set.
    That was not the case when I tried to add new PriceAffector with many
    PriceAfffectorsChain - everything worked.
    Any Ideas?
    -Ivan

    Abe White wrote:
    When you have a two-sided relation, you need to be maintaining both sides
    of the relation at all times. Whenever an A is added to a B, the B must
    be added to the A as well. Keep your in-memory Java objects consistent
    (just as if they were not persistent), and JDO will take care of the rest.Abe White wrote:
    When you have a two-sided relation, you need to be maintaining both sides
    of the relation at all times.
    Whenever an A is added to a B, the B must
    be added to the A as well. Keep your in-memory Java objects consistent
    (just as if they were not persistent), and JDO will take care of the rest.Ok. I agree.
    I think that I'm doing this or maybe I'm wrong. Below is the code that
    adds new price affectors chain with collection of price affectors (all of
    them already persistent). Each of the price affectors is being looked up
    and is consistent (this is what getObjectById is doing, isn't it?) and
    then the price affector chain is being persisted.
    =================================================================
    PersistenceManager pm = null;
    PriceAffectingChain newPriceAffectorsChain = null;
    HashSet priceAffectors = null;
    try {
    pm = persistenceManagerFactory.getPersistenceManager();
    // getting the catalog object
    long catalogId = priceAffectorsChain.getCatalog().getCatalogId();
    CatalogPK catalogPK = new CatalogPK(catalogId);
    Catalog newPriceAffectorsChainCatalog =
    (Catalog)pm.getObjectById(catalogPK, true);
    // making new price affecting chain
    newPriceAffectorsChain = new PriceAffectingChain(
    BeanHelper.getNextSequence(DBObjects.SEQ_PRICEAFFECTINGCHAIN),
    priceAffectorsChain.getName(),
         priceAffectorsChain.getIsDefaultForStore(),
         newPriceAffectorsChainCatalog);
    // retrieval of price affector objects for this chain
    System.out.println("the size of the price affectors is: " +
    priceAffectorPKs.length);
    if (priceAffectorPKs != null && priceAffectorPKs.length > 0) {
         priceAffectors = new HashSet(priceAffectorPKs.length);
    for (int i = 0; i < priceAffectorPKs.length; i++) {
              PriceAffectorPK currentPAPK = priceAffectorPKs;
              PriceAffector currentPA = (PriceAffector)pm.getObjectById(currentPAPK,
    true);
              priceAffectors.add(currentPA);
              System.out.println("The " + currentPA.getName() + " price affector was
    added");
    if (priceAffectors == null) {
         priceAffectors = new HashSet();
    System.out.println("size of priceAffectors: " +
    priceAffectors.size());
    newPriceAffectorsChain.setPriceAffectors(priceAffectors);
    pm.makePersistent(newPriceAffectorsChain);
    } catch {
    ===========================================================
    The problem is that the presistence works only for the table of
    PriceAffectingChain obejct and not for the relation table. I tried on
    purpose to add new price affectors with collection of price affecting
    chains and it worked for both tables (the one for PriceAffector object and
    the relation table.
    I have no idea what I can try next. Any advice or help are welcomed.
    Thanks.
    -Ivan

  • SQLIntegrityConstraintViolationException in a "many to many" related tables

    Hi, in an 11g adf application I have a “many to many” relationship between two tables A and B and an intermediate table C that relates them.
    The database has constraints that check for id existence in master tables before saving rows in C.
    When I’m trying to create a new entry in B’s UI form with relations to A I’m getting a:
    java.sql.SQLIntegrityConstraintViolationException: ORA-02291:
    the framework seems that tries to save the row in C before B. So there doesn’t exist the id in B.
    The same operation in A table’s UI form is executed properly. The framework first creates a row in A
    and then related it with B creating rows in C and no constraint violation is thrown.
    Why is this happening?
    Any comment will be helpful.
    Thanks

    Using BC Tester the save operation is executed properly without errors.
    The constraint you are asking is a classic referential constraint in intermediate table C that requires when creating new rows in C the foreign key refer to B to pre-exist in B table.
    So the sequence of save operation is important when creating new rows in B and C table.
    If I create a new row in B, save it and then create relations as new rows in C everything is fine.
    But if I concurrently create a new row in B with rows in C, the framework seems that tries to save firstly the rows in C and then in master table B so the referential integrity is violated.
    Is it possible in ADF to influence to order of saves in master detail tables and how is this specified?
    For example the same operation with same integrity constraints in UI form of A table is executed properly.

  • Many to Many relation problem

    Hi,
    JDeveloper 11.1.1.6
    3 tables, let's name them A, B and RelAB
    By default, there is a [1 to *] from A to RelAB and a [1 to *] from B to RelAB.
    Since I wanted to use a master-detail view on my web page, I didn't have the choice to modify these Associations and Links to a [* to *] from A to B, and as well from B to A.
    Now you test the whole thing by running the AppModule. Everything works like a charm.
    The problem is if I go into my A view object and then I change the SQL Mode from Normal to Expert inside the Query tab, the minute I run my AppModule, one of my many to many relationship breaks. Notice that I did not change anything else, just switch from Normal to Expert. Let's say that the A to B relation is working but not the B to A.
    If I put it back to Normal, it works again. You might want to ask, why bother with Expert Mode? It is just that I want to modify this query, I was just trying to identify the source of the problem.
    Anybody experience a similar problem with many-to-many relationships?

    I assume your question is on JAXB, correct?
    I think you need to make on side of the relationship transient, or remove it.
    James : http://www.eclipselink.org

  • What is the best way to implement writable many-to-many relations

    As everyone knows, the many-to-many associations provided by BC4J are quite good to read many-to-many associations, but they are not able to write such associations.
    There are other solutions using composite associations or cascading-delete foreign keys, but as I was tought now, they are also quite problematic. See thread Internal error: Entity.afterRollback.status_dead   -- What does this mean? for more details.
    So I ask you: What is the best way to implement writable many to many associations? Do you really have to manage them "by hand"?
    Thanks for your ideas
    Frank

    I'd appreciate any hint
    Thanks

  • A many-to-many relational problem (SQL and CFM)

    My question:
    How to get CFM to return a many-to-many relationship in one
    row using cfloop
    My table structure:
    Table A - Books
    BookID | BookName
    1 | Book One
    Table B -
    RelatingTable
    BookID | AuthorID
    1 | 60
    1 | 61
    Table C - Authors
    AuthorID | AuthorName
    60 | Bob
    61 | Joe
    My query:
    SELECT * FROM Books, RelatingTable, Authors AS a
    INNER JOIN Books AS b ON b.BookID = r.BookID
    INNER JOIN RelatedTable AS r ON r.AuthorID = a.AuthorID
    Output I am getting:
    b.BookID | b.BookName | r.BookID | r.AuthorID | a.AuthorID |
    a.AuthorName
    ---------|------------|----------|------------|------------|-------------
    1 | Book One | 1 | 60 | 60 | Bob
    1 | Book One | 1 | 61 | 61 | Joe
    I am using a UDF that turns my relationship into a comma list
    (authorlist), but the duplicates still return in CFM because the
    JOIN relationship
    The code I am using in CFM:
    <cfloop query="rsBooksQuery">
    #b.BookName#, written by #authorlist#
    </cfloop>
    How Coldfusion is displaying my output:
    Book One, written by Bob, Joe
    Book One, written by Bob, Joe
    How I want my output displayed:
    Book One, written by Bob, Joe
    I need this to work in cfloop and not cfoutput! I know that
    you can use group in CF output, but for the conditions I am using
    this query, it must be in a loop
    the reason why i keep the JOINs even though i have a UDF to
    create a comma list is that some of my CFM pages use variables
    passed to the qry to limit which books are displayed, for example
    &author=60 (which would display a list of Bob's books that
    include the comma list)
    If you can suggest anything to help me I will be very
    thankful

    I need this to work in cfloop and not cfoutput! I know that
    you can use
    group in CF output, but for the conditions I am using this
    query, it
    must be in a loop
    If you can suggest anything to help me I will be very
    thankful
    If you can not use <cfoutput...> with its group
    feature, you need to
    recreate the functionality with <cfloop...>. You can
    create nested
    <cfloop...> tags that keep track of the changing group
    value. It takes
    more code, but that's what happens when one sets outside the
    bounds of
    the built in functionality.

  • Many to Many Relations Problem

    I have following two classes with many-to-many case:
    public class Protocol {
    private long protocolId;
    private final Collection keyPersons = new ArrayList();
    public void addKeyPerson(Person person) {
    person.addKeyProtocol(this);
    public void removeKeyPerson(Person person) {
    person.removeKeyProtocol(this);
    public class Person {
    private long personId;
    private final Collection keyProtocols = new ArrayList();
    public void addKeyProtocol(Protocol protocol) {
    protocol.getKeyPersonsCollection().add(this);
    keyProtocols.add(protocol);
    public void removeKeyProtocol(Protocol protocol) {
    protocol.getKeyPersonsCollection().remove(this);
    keyProtocols.remove(protocol);
    The meta data is:
    <?xml version="1.0"?>
    <jdo>
    <package name="peacetech.nih.nhlbi.iasp.dao">
    <class name="Protocol" identity-type="application"
    objectid-class="peacetech.nih.nhlbi.iasp.dao.oid.ProtocolOid">
    <extension vendor-name="tt" key="table" value="protocol"/>
    <extension vendor-name="tt" key="pk-column" value="int_protocol"/>
    <extension vendor-name="tt" key="lock-column" value="none"/>
    <extension vendor-name="tt" key="class-column" value="none"/>
    <field name="protocolId" primary-key="true">
    <extension vendor-name="tt" key="data-column" value="int_protocol"/>
    </field>
    <field name="keyPersons">
    <collection element-type="Person"/>
    <extension vendor-name="tt" key="inverse" value="keyProtocols"/>
    <extension vendor-name="tt" key="table" value="KeyPersonnel"/>
    <extension vendor-name="tt" key="personId-data-column" value="PID"/>
    <extension vendor-name="tt" key="protocolId-ref-column"
    value="int_protocol"/>
    </field>
    </class>
    <class name="Person" identity-type="application"
    objectid-class="peacetech.nih.nhlbi.iasp.dao.oid.PersonOid">
    <extension vendor-name="tt" key="table" value="Personnel"/>
    <extension vendor-name="tt" key="pk-column" value="PID"/>
    <extension vendor-name="tt" key="lock-column" value="none"/>
    <extension vendor-name="tt" key="class-column" value="none"/>
    <field name="personId" primary-key="true">
    <extension vendor-name="tt" key="data-column" value="PID"/>
    </field>-
    <field name="keyProtocols">
    <collection element-type="Protocol"/>
    <extension vendor-name="tt" key="inverse" value="keyPersons"/>
    <extension vendor-name="tt" key="table" value="KeyPersonnel"/>
    <extension vendor-name="tt" key="protocolId-data-column"
    value="int_protocol"/>
    <extension vendor-name="tt" key="personId-ref-column" value="PID"/>
    </field>
    </class>
    The assignment works fine beetwen New Persistent Protocol and Persons, but
    when ever I try to add new assignment between existing protocol and person:
    void updateProtocol(PersistenceManager pm){
    Extent e = pm.getExtent (Person.class, true);
    Query query = pm.newQuery (Person.class, e, "fname == \"Alex\"");
    Collection collection = (Collection) query.execute();
    Iterator i = collection.iterator ();
    Person alex = (Person)i.next();
    System.out.println("Person to assign" + alex);
    e = pm.getExtent (Protocol.class, true);
    query = pm.newQuery (Protocol.class, e, "projectTitle == \"This is
    JDO test N1\"");
    collection = (Collection) query.execute();
    i = collection.iterator ();
    Protocol firstProtocol = (Protocol)i.next();
    try {
    pm.currentTransaction().begin();
    e = pm.getExtent (Person.class, true);
    query = pm.newQuery (Person.class, e, "fname == \"Brian\"");
    collection = (Collection) query.execute();
    i = collection.iterator ();
    while (i.hasNext ())
    firstProtocol.addKeyPerson((Person)(i.next()));/*Exception
    here!*/
    pm.currentTransaction().commit();
    } catch (Exception ex) {
    pm.currentTransaction().rollback();
    ex.printStackTrace(System.out);
    I have following exception:
    javax.jdo.JDOUserException: The given element "
    =======Person=======
    First Name: Brian
    Last Name: Agricola
    Phone: null
    Email: null
    ====================" does not meet the requirements for the container.
    at
    com.solarmetric.kodo.util.SecondClassObjects.checkValue(SecondClassObjects.j
    ava:224)
    at com.solarmetric.kodo.util.ProxyLinkedList.add(ProxyLinkedList.java:71)
    at peacetech.nih.nhlbi.iasp.dao.Person.addKeyProtocol(Person.java:176)
    at peacetech.nih.nhlbi.iasp.dao.Protocol.addKeyPerson(Protocol.java:147)
    at peacetech.nih.nhlbi.iasp.IASPTest.updateProtocol(IASPTest.java:142)
    at peacetech.nih.nhlbi.iasp.IASPTest.updateProtocol(IASPTest.java:110)
    at peacetech.nih.nhlbi.iasp.IASPTest.runTest(IASPTest.java:28)
    at peacetech.nih.nhlbi.iasp.IASPTest.main(IASPTest.java:22)
    I have the same problem also for one to many.
    Can you help me with it?
    Thanks,
    Kirill.

    I have following two classes with many-to-many case:
    public class Protocol {
    private long protocolId;
    private final Collection keyPersons = new ArrayList();
    public void addKeyPerson(Person person) {
    person.addKeyProtocol(this);
    public void removeKeyPerson(Person person) {
    person.removeKeyProtocol(this);
    public class Person {
    private long personId;
    private final Collection keyProtocols = new ArrayList();
    public void addKeyProtocol(Protocol protocol) {
    protocol.getKeyPersonsCollection().add(this);
    keyProtocols.add(protocol);
    public void removeKeyProtocol(Protocol protocol) {
    protocol.getKeyPersonsCollection().remove(this);
    keyProtocols.remove(protocol);
    The meta data is:
    <?xml version="1.0"?>
    <jdo>
    <package name="peacetech.nih.nhlbi.iasp.dao">
    <class name="Protocol" identity-type="application"
    objectid-class="peacetech.nih.nhlbi.iasp.dao.oid.ProtocolOid">
    <extension vendor-name="tt" key="table" value="protocol"/>
    <extension vendor-name="tt" key="pk-column" value="int_protocol"/>
    <extension vendor-name="tt" key="lock-column" value="none"/>
    <extension vendor-name="tt" key="class-column" value="none"/>
    <field name="protocolId" primary-key="true">
    <extension vendor-name="tt" key="data-column" value="int_protocol"/>
    </field>
    <field name="keyPersons">
    <collection element-type="Person"/>
    <extension vendor-name="tt" key="inverse" value="keyProtocols"/>
    <extension vendor-name="tt" key="table" value="KeyPersonnel"/>
    <extension vendor-name="tt" key="personId-data-column" value="PID"/>
    <extension vendor-name="tt" key="protocolId-ref-column"
    value="int_protocol"/>
    </field>
    </class>
    <class name="Person" identity-type="application"
    objectid-class="peacetech.nih.nhlbi.iasp.dao.oid.PersonOid">
    <extension vendor-name="tt" key="table" value="Personnel"/>
    <extension vendor-name="tt" key="pk-column" value="PID"/>
    <extension vendor-name="tt" key="lock-column" value="none"/>
    <extension vendor-name="tt" key="class-column" value="none"/>
    <field name="personId" primary-key="true">
    <extension vendor-name="tt" key="data-column" value="PID"/>
    </field>-
    <field name="keyProtocols">
    <collection element-type="Protocol"/>
    <extension vendor-name="tt" key="inverse" value="keyPersons"/>
    <extension vendor-name="tt" key="table" value="KeyPersonnel"/>
    <extension vendor-name="tt" key="protocolId-data-column"
    value="int_protocol"/>
    <extension vendor-name="tt" key="personId-ref-column" value="PID"/>
    </field>
    </class>
    The assignment works fine beetwen New Persistent Protocol and Persons, but
    when ever I try to add new assignment between existing protocol and person:
    void updateProtocol(PersistenceManager pm){
    Extent e = pm.getExtent (Person.class, true);
    Query query = pm.newQuery (Person.class, e, "fname == \"Alex\"");
    Collection collection = (Collection) query.execute();
    Iterator i = collection.iterator ();
    Person alex = (Person)i.next();
    System.out.println("Person to assign" + alex);
    e = pm.getExtent (Protocol.class, true);
    query = pm.newQuery (Protocol.class, e, "projectTitle == \"This is
    JDO test N1\"");
    collection = (Collection) query.execute();
    i = collection.iterator ();
    Protocol firstProtocol = (Protocol)i.next();
    try {
    pm.currentTransaction().begin();
    e = pm.getExtent (Person.class, true);
    query = pm.newQuery (Person.class, e, "fname == \"Brian\"");
    collection = (Collection) query.execute();
    i = collection.iterator ();
    while (i.hasNext ())
    firstProtocol.addKeyPerson((Person)(i.next()));/*Exception
    here!*/
    pm.currentTransaction().commit();
    } catch (Exception ex) {
    pm.currentTransaction().rollback();
    ex.printStackTrace(System.out);
    I have following exception:
    javax.jdo.JDOUserException: The given element "
    =======Person=======
    First Name: Brian
    Last Name: Agricola
    Phone: null
    Email: null
    ====================" does not meet the requirements for the container.
    at
    com.solarmetric.kodo.util.SecondClassObjects.checkValue(SecondClassObjects.j
    ava:224)
    at com.solarmetric.kodo.util.ProxyLinkedList.add(ProxyLinkedList.java:71)
    at peacetech.nih.nhlbi.iasp.dao.Person.addKeyProtocol(Person.java:176)
    at peacetech.nih.nhlbi.iasp.dao.Protocol.addKeyPerson(Protocol.java:147)
    at peacetech.nih.nhlbi.iasp.IASPTest.updateProtocol(IASPTest.java:142)
    at peacetech.nih.nhlbi.iasp.IASPTest.updateProtocol(IASPTest.java:110)
    at peacetech.nih.nhlbi.iasp.IASPTest.runTest(IASPTest.java:28)
    at peacetech.nih.nhlbi.iasp.IASPTest.main(IASPTest.java:22)
    I have the same problem also for one to many.
    Can you help me with it?
    Thanks,
    Kirill.

  • Master - detail block (many-to-many)

    Hello, , I have 2 tables:
    1-(parts)its primary key : p_id
    2-(suppliers)its primary key : s_id
    and they have many-to-many relationship between them .
    the table Resulted from the relationship is(part_supp)
    How can I create master-detail block Based on this relationship.In other words, which of tables will be the master and which of them well be detail.
    I am using form 6i ..
    please help.....

    M3ATH wrote:
    Hello, , I have 2 tables:
    1-(parts)its primary key : p_id
    2-(suppliers)its primary key : s_id
    and they have many-to-many relationship between them .Many to many relation between two table isn't a good database design. You have to a junction table between them.
    the table Resulted from the relationship is(part_supp)Is this your junction table(part_supp) ?
    >
    How can I create master-detail block Based on this relationship.In other words, which of tables will be the master and which of them well be detail.If part_supp is your junction table between parts and suppliers then, try this..
    Use the junction table as a hidden block, then establish a standard Forms relation between
    Parts and (hidden)part_supp then between part_supp and suppliersHope this helps

  • 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

  • ADF-Newbie.How can I create a many-to-many row from an action method?

    Hi all,
    First of all, this is my scenario:
    - JDeveloper 10.1.3.0.4
    - My application is running ADF + Faces + Toplink + EJB Facade
    - My database model includes some many-to-many relationships and some one-to-may relationships.
    I have developed several ADF pages displaying some CRUD operations over my master tables and my master-detail tables without any problem.
    I am now trying to implement some CRUDs over my many-to-many relationship tables.
    Lets call the tables involved as master1, master2, and relationship (the many-to-many table)
    Because usability reasons, my user wants me to implement an interface where he can:
    -Select a row from the master1 table
    -Select a row from the master2 table
    -Click a button called "Create relationship"
    I need to implement the code inside the action button to add my new record on the relationship table, and honestly, I have not found any clue.
    Please, give me some directions to solve my problem.
    Thank you in advance for your help...

    The key here is to work with the intersection table for your MtM relationship.
    The way I do it, is to have the user view Master Table I, and click on the add Relationship button, this button is a link to a add form for the Intersection Table. On the Add form, the MasterTable 1 Id is already filled in and I hide it. I then setup MasterTable 2 as an LOV on the page. The used selects the item from the LOV and clicks on the commit button. I refresh my many-to-many view and all is grand.
    Using ADF/JSF, I have made it even nicer by turning the add relationship page into a dialog page, that way the user can see the previous page while adding the new relationship.
    Kelly

  • Many-to-many relationship - show all values

    Hi,
    I'm building a cube in 2008R2 and have a many-to-many relationship through a bridging table but when displaying the results it is effectively an inner join and I would like to see a full outer join with the unknown rows set to "unknown".
    I've managed to achieve this by doing a full outer join in the view that creates my bridging table and having an unknown member in my dimensions but then when I added in a dimension that wasn't directly related to the bridging table the unknown rows
    were removed again. I was able to get past this by adding a row to my fact table with all the keys set to unknown and the metrics set to zero.
    Whilst this works it really does not seem like an ideal solution, especially as previously empty metrics are now returning a zero.
    Is there any way to achieve this in SSAS? Perhaps in the way unknown members are processed?
    Thanks,

    cccparkhill,
    What you did is the only way to achieve what you want.
    In cubes you connect Dimensions throw Facts. By definition dimensions are
    “How do business people describe the data that
    results from the business process?”
     and facts are “What are we measuring?”, noting the underlined
    we can understand that _normally and usually_ the relation between the dimensions and the facts represent incidents happened in the real world ... the way you approach, think, and deal with dimensions and facts in cubes is different than dealing with tables
    in normal relational transnational database.
    Personally I do what you did when I want to achieve "Left join"
    Please mark this reply as the answer
    or vote as helpful, as appropriate, to make it useful for other readers

  • Many to Many with Custom Objects 4 and up

    Hello,
    Pls. I need to define a new CO4 that will have a many to many relationship with Contact.
    From OD help pg.775 I understand that I should use another CO (f.ex. CO5) to be the intersection. Help file indicates how to rename the objects...and put them in the related info. section... but I don´t know what FIELDS (if any) I should define in the intersection CO5.
    Pls. Anyone could help ?
    Txs. a lot.
    Antonio

    Yes. You have to define them in CO5 Layout.
    You should see Name, Contact and Custom Object 04 (you may have renamed it). Not the Id field.
    Then when you add THE CO5 layout to Contact Related section, you can add new association between Contact and CO4.
    Don't forgot to enable the Access Profiles in Contact, CO4 and CO5.

  • 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.

Maybe you are looking for

  • CSV FILES DOESN'T LOAD WITH RIGHT DATA USING SQL LOADER

    Hi pals, I have the following information in csv file: MEXICO,Seretide_Q110,2010_SEE_01,Sales Line,OBJECTIVE,MEXICO,Q110,11/01/2010,02/04/2010,Activo,,,MEXICO MEXICO,Seretide_Q210,2010_SEE_02,Sales Line,OBJECTIVE,MEXICO,Q210,05/04/2010,25/06/2010,Act

  • Not able to see the name space in Message Interface

    I Have cXML.xsd,  I make a external  definition  for this. I am creating a message interface for this,  When I create message interface and referre to  exsternal definition, it  does not show the name space, Please let me know how to  do this. in xsd

  • IPhone synched with another library

    Had to restore my pc back to factory settings. Now iTunes is stating that my iPhone is synced with another iTunes library. If I do erase and synch with this library, will it erase my apps and photos or just music? Thanks

  • How do I download and reinstal word 2000

    how do I reinstall word 2000?

  • Oracle Projects scripts

    Hi, Does any one have Oracle Projects inbound and outbound scripts? Thanks and Regards, Anil.