ADF BC Entity Associations

I have two Entities that have an association/relationship. When the parent entity is created it gets a DB sequence as its primary key. When the child entity is created it also gets a DB sequence as its primary key (different DB sequence). The child key has a foreign key/attribute that needs to be set referencing the primary key of the parent entity.
In the ADF BC EntityImpl, both entities expose their accessor methods of the association. When I attempt to retrieve the primary key of the parent entity through the associated entity, it returns null.
The following snipet is from the child entity:
protected void create(AttributeList AttributeList) {
super.create(AttributeList);
DBTransaction dbTrans = getDBTransaction();
SequenceImpl seq = new SequenceImpl("ID_SEQ", dbTrans);
setTherapyId(seq.getSequenceNumber().toString());
setIDFromParent(getEntityAuth().getAuthorizationNum()); // This returns null pointer error
How do I go about retrieving the primary key of the parent entity from the child entity?
Any help would be appreciated.
/**Gets the associated entity EntityAuthImpl
public EntityAuthImpl getEntityAuth() {
return (EntityAuthImpl)getAttributeInternal(ENTITYAUTH);
}

I am still unable to access the source EntityImpl from the destination EntityImpl.
From the the destination entity there is a source EntityImpl. But, when I attempt to access any methods/attributes of the source implementation, it returns null.
Just a follow-up: I have two entities that have an association. Both entities have overridden the Create method so that I can retrieve separate db sequences. I create the source entity first and all goes well, then the destination entity is created.
When I create the destination entity I am attempting to access the associated source EntityImpl and set an attribute in the destination entity to a source entity attribute value.
The destination EntityImpl does provide getter/setter methods for the source EntityImpl. But, again when I attempt to use the getter method it returns null.
Can I actually access the source EntityImpl from the destination EntityImpl or I am mislead?
Any help appreciated.

Similar Messages

  • Determine all entity associations used in application module?

    Hi,
    ADF 11.1.1.2.0, ADFBC.
    I want to create a JUNIT testcase to loop through all entity associations and compare them with the relations in the Oracle database.
    to get all view objects of the AM I use following method:
    am.getViewObjectNames(true,true);
    How to get all entity associations used in an AM?
    regards
    Peter

    Hi,
    did you try
    View Object --> Entity --> EntityDefImpl --> getAssociationDefImpls() ?
    Frank

  • Getting a oracle.jbo.NoDefException: JBO-25002:Entity Association not found

    On using VO.createRow I get an exception that say
    Caused by: oracle.jbo.NoDefException: JBO-25002: Definition <Association package> of type Entity Association is not found.
    The Exception logs shows that the error is created in a EO which does not have any direct connection with the Association in question
    so the create method is fired in Entity1 but this error comes for an association between Entity2 and Entity3. There is however an association between Entity1 and Entity2.
    Entity1 and Entity2 are in the same project as the assoc between E2 and E3
    E3 is in another project, but I have tried refreshing the library dependencies and clean all + rebuild.

    Refer JBO-25002: Definition {1} of type {0} is not found.
    http://docs.oracle.com/cd/E24382_01/core.1112/e22506/chapter_jbo_messages.htm

  • Entity Associations

    All,
    we use JDeveloper 9.0.3.10.35 with j2sdk1.4.2 on WindowsXP.
    We have a very urgent problem.
    We want to go into production in 4 weeks, so we need to have this solved. (In other words, PLEASEHELP_).
    Here is a short decription of our situation:
    1. We have 3 entities A, B and C. A&B are master entities and C is just a helper to join them.
    They look like
    A : A_attr0 : seq (PK)
    A_attr1 : ....
    B : B_attr0 : seq (PK)
    B_attr1 : ....
    C : C_attr0 : Seq (PK)
    C_attr1 : ASeq (FK) Association with Entity A (0..1 to 1)
    C_attr2 : BSeq (FK) Association with Entity B (0 ..1 to 1)
    There are three possible constellations:
    i) A & B are connected thru C: Then 3 entities exist with C_attr1 = A_attr0 and C_attr2 = B_attr0
    ii) A is not connected to any B: Then 2 entities exist with C_attr1 = A_attr0 and C_attr2 is null
    iii) B is not connected to any A: Then 2 entities exist with C_attr1 is null and C_attr2 = B_attr0
    2. We have a View XView consisting of the 3 updateable entities A, B and C. Obviously A&B are outer joined to C
    3. The setAttribute-methods of XViewImpl look like this:
    public void setC_attr1(Number value)
    System.out.println("C->A " + getC().getA());
    if (getC_attr1() == null && value != null)
    getC().setA(getA());
    System.out.println("C->A " + getC().getA());
    setAttributeInternal(C_ATTR1, value);
    System.out.println("C->A " + getC().getA());
    We make sure that we call this methods whenever data for A is entered (and therefore a new entity needs to be created and linked).
    4. The postChanges-method of the C-entityImpl looks like this:
    public void postChanges(TransactionEvent e)
    System.out.println("Post Changes C");
    System.out.println("C " + this);
    System.out.println("A " + getA() );
    System.out.println("B " + getB() );
    if (null != getA())
    getA().postChanges(e);
    if (null != getB())
    getB().postChanges(e);
    return;
    So we make sure that A and B (if any) are posted before C
    5. If the user enters data for both entities (A & B) using that view, we automatically create a C entity that has the links set correctly.
    If the user enters just data for one ( A or B ) of the entities, the respective other entity is left unused.
    Scenario:
    1a. The user creates a new row in XView
    1b. User sets an attribute in A for the first time
    Output of setC_attr1 (111111)
    <--- snip --->
    C->A null
    C->A [oracle.jbo.Key[111111 ]]
    C->A [oracle.jbo.Key[111111 ]]
    <--- snip --->
    1c. User sets an attribute in B for the first time
    Output of setC_attr2 (222222)
    <--- snip --->
    C->B null
    C->B [oracle.jbo.Key[222222 ]]
    C->B [oracle.jbo.Key[222222 ]]
    <--- snip --->
    1d. User commits
    Output of postChanges
    <--- snip --->
    Post Changes C
    C [oracle.jbo.Key[333333 ]]
    A [oracle.jbo.Key[111111 ]]
    B [oracle.jbo.Key[222222 ]]
    <--- snip --->
    The data is posted, everything is fine.
    2a. The user creates a new row in XView (again!)
    2b. User sets an attribute in A for the first time
    Output of setC_attr1 (111112)
    <--- snip --->
    C->A null
    C->A [oracle.jbo.Key[111112 ]]
    C->A [oracle.jbo.Key[111112 ]]
    <--- snip --->
    2c. No attributes in entity B
    2d. User commits
    Output of postChanges
    <--- snip --->
    Post Changes C
    C [oracle.jbo.Key[333334 ]]
    A [oracle.jbo.Key[111112 ]]
    B null
    <--- snip --->
    The data is posted, everything is fine.
    For those still reading, here's the beef!
    3a. The user creates a new row in XView
    3b. User sets an attribute in A for the first time
    Output of setC_attr1 (111113)
    <--- snip --->
    C->A null
    C->A [oracle.jbo.Key[111113 ]]
    C->A [oracle.jbo.Key[111113 ]]
    <--- snip --->
    3c. User sets an attribute in B for the first time
    Output of setC_attr2 (222224)
    <--- snip --->
    C->B null
    C->B null
    C->B null
    <--- snip --->
    3d. User commits
    Output of postChanges
    <--- snip --->
    Post Changes C
    C [oracle.jbo.Key[333333 ]]
    A [oracle.jbo.Key[111111 ]]
    B null
    <--- snip --->
    The attribute C_attr2 is set to 222224, but the entity association is not set at all.
    The data cannot be posted because of database integrity constraint violations in C.C_attr2.

    Hi Mike,
    first of all thank you very much for reply. I know this is a very complicated case and my description maybe not the best one.
    Now to your questions :
    a. This is not a copy-and-paste error. I mean that if we do the same thing with case 2 between we get different results.
    b. yes, my test did not include "user just creates B". But this give the same result if (and now it will be a bit more complex) the user in step 3 creates the Entity A as the first one of A and B.
    Because sometimes you do not get the error due BC4J posts itself the A and B before C and so you don't get the DB error but the links between entities are not set as i described in original message.
    c. Sofar i can evaluate the associations are symmetric ( I have checked all respective XML-files. Moreover the associations are generated automatically by BC4J from DB-constraints and they are symmetric too). As i said above we get the same problem if we left Entity A in setp 2 unused (just with violation of other DB constraint).
    I try with a more interesting example from our code.
    Situation :
    Assume we are in step 3 and we left an A Entity in step 2 unused and the user enters for first time data for Entity A. Before set this attribute in Entity our EntityBaseClass sets the seq of Entity C and the seq of the Entity A
    (In our super class for all entities we set all general attributes (like seq if exists, modify indicator etc.) and default values only after the user enter data for a attribute first time. So we ensure that unused entities are in PostState=INITIALIZED and will make no trouble while posting etc.
    Now in the class XViewRowImpl we try to connect A and C.
    <-- snip -->
    AEntityImpl aFromViewRow = getA();
    AEntityImpl aFromCach = ((AEntityImpl) getA().getMyEntityDef().findByPrimarykey(((XViewImpl)getViewObject()).getDBTransaction(),
    new Key(new Object[] {getA().getSeq()}));
    System.out.println("A from Row = " + aFromViewRow);
    System.out.println("A from cach = " + aFromCach);
    System.out.println("A in C = " + getC().getA());
    getC().setA(aFromViewRow);
    System.out.println("A in C = " + getC().getA());
    <-- snip -->
    The output is :
    A from Row = [oracle.jbo.Key[333333 ]]
    A from cach = [oracle.jbo.Key[333333 ]]
    A in C = null
    A in C = null
    we observe that after call getC().setA(aFromViewRow) the FK attribute of C is set to PK attribute of A (i.e. 333333 ) but if you ask the entity about his A it returns with null!!! and this cause the exception in postChanges cycle because the postchanges() of C relies on correct links between entities if the Fks are set.
    I think it must be related to the unused entity in step 2. As you saw above the EntityCach can find the new Entity A but the entity C can not.
    Actually we have the same problem if we only do step 2 and 3. I just added the step 1 to prevent someboby may think we may have general problems setting all three entities.
    We can repeat step 1 n-times without any error.
    we can repeat step 2 n-times without any error.
    Once you left one entity (A or B) in previous step unused you can not set the new one in C in next step.
    Additionally i must say that in a test case i reexcute XView after step 2 (just to see what happens) but got the same error.
    I fear that this message is not less complex than the first one but i hope it helps a little bit more
    Thanks in advance
    Masoud

  • [ADF BC] How to create an entity association to get one child

    I have two entities in a one-to-many relationship (say Employees and Employee_History). Each employee has one or more history entries.
    What I would like to do is have an Employee view that contains all the attributes from the Employee entity and also an attribute (or many attributes) from the latest entry in the Employee_History entity.
    Is there a way I can model this with ADF Business Components?
    Things I've tried:
    - adding SQL in the one-to-many association to ensure only one row is returned (does work, but affects other operations like creating a new employee record)
    - creating a one-to-one association between the two entities (still returns more than one record)

    Thank you Steve, that works great for the hire date, but what about when you need another column from the same record as that hire date.
    Would you have to use a query like this?:
    select DEPTNO, DNAME, LOC, (select max(firstname) from emp e where e.hiredate = (select max(hiredate) from emp where deptno = Dept.deptno) and e.deptno = Dept.depno)) as LAST_EMP_HIRED_NAME from dept DeptAt the moment I've been able to get it working like I want to (as far as I can tell) by referencing the child entity in the parent view and using a where clause in the view's SQL to reduce the rows returned, like this (using the example of departments and employees):
    SELECT Dept.DEPTNO,
           Dept.DNAME,
           Dept.LOC,
           Emp.DEPTNO AS DEPTNO1,
           Emp.HIREDATE,
           Emp.FIRSTNAME
    FROM DEPT Dept, EMP Emp
    WHERE Dept.DEPTNO = Emp.DEPTNO AND Emp.HIREDATE = (SELECT MAX(HIREDATE) FROM EMP WHERE DEPTNO = Dept.DEPTNO)Testing this with the business components tester, it seems to work.

  • Multiple cursors opened when following BC4J Entity Association in a loop

    I am using BC4J in JDeveloper 9.0.4.1.1 Build 1436 against a 9.0.2 database.
    (Note the BC4J project was originally created in a 9.0.3 JDeveloper release)
    In the BC4J project, I have a "Contract" Entity that has a 1-to-1 Association with an "Estimate" Entity.
    From my ViewObject, I iterate over a set of Contracts.
    For each Contract, I follow the Association to obtain the Estimate and read a few attributes.
    Occassionally I am running out of cursors in the database whilst using this.
    It seems that each time I access an Estimate using the Association, a new cursor is opened to retrieve the Estimate. These cursors remain open until I complete the loop and the cursor for the VO is closed.
    Therefore, the maximum number of rows returned by the ViewObject is limited to the number of available cursors in the database at the time.
    Why do the cursors remain open after the Entity object has been retrieved?
    Am I using the association incorrectly?

    I wouldn't surprise me if there was a bug in the association code like this.
    For the time being you could just set the where clause and do the query yourself manually on the child vo....

  • ADF BC Entity Object read security

    hi
    Please consider the example application in this blog post by Andrejus Baranovskis:
    "ADF Security 11g and ADF Business Components"
    http://andrejusb.blogspot.com/2008/10/adf-security-11g-and-adf-business.html
    What is the "read" operation used for in the Security section of the "Jobs" Entity Object configuration?
    I modified the example application and checked the enabled checkbox for the "read" operation on the "Jobs" Entity Object. After that, using the "Edit Authorization..." dialog (from the context menu on the "Jobs" Entity Object in the Structure Panel), I checked the "Read" checkbox for the "clerk" role.
    This looks to me like a configuration from which one could expect that only a "clerk" can read.
    After that I run the "HrModule" Application Module and authenticate as a "developer" (user "steve"), which has no privileges granted, and I can still read all the attributes for the rows in the "JobsView1" View Object instance (which is based on the "JobsView" View Object for which all the attributes come from the "Jobs" Entity Object).
    How can this be explained?
    many thanks
    Jan Vervecken

    Thanks for your reply Brenden.
    Yes, my question seems to be the same as in the forum thread you refer to,
    "11g ADF BC security - read operation?".
    In that thread Frank Nimphius points out "this seems to be malfunctioning and will be bugged",
    and also Chris Muir writes "... the documentation is a little misleading then ...".
    regards
    Jan

  • [EJB3 - ADF Faces] entity bean design

    Hello,
    I have an existant application that use database view (very complex) to retrieve and display values from some tables.
    I have to reproduce the same thing with EJB3 ans ADF Faces in a web application.
    What is for you the best way to design entities beans ?
    1. Create some buisness objects (entity beans) and feed them with a query thru the database view ?
    2. Create a unique entity bean with only attributes who are used by the db view ?
    In this case, the entity bean will be used only for this query.
    3. ?
    I think the best solution is the first one.
    But in this case, how to display the result of the query in an ADF Faces table?
    With the 2nd solution the query returns a list of object which will be used by the adf table. That would be much easier.
    Thanks for your help.

    The popup dialog is used for looking up a value of fields on the form. I have fields "location id" and "sub location id", the popup has cascading drop down lists where I choose which ones I want, then return those values from the popup and display the selection in readonly text inputs. Other inputs also exist on the form. Together they all make the input parameters to the session facade's query.

  • Bug:  ADF BC Entity Object entity level validator on dates

    Hi JDev team
    I'm having an issue getting the ADF BC EO entity level compare validator to work on Date columns in JDev 11g TP and suspect a bug.
    Steps to reproduce:
    1.     Create EO based on table with 2 Date attributes, eg. StartDate and EndDate both domain Date.
    2.     In the EO editor, under General tab, select create button for Validation Rules.
    3.     In Validation Rule dialog.......
    4.     Select Compare Validator
    5.     Select StartDate as attribute
    6.     Select LessOrEqualTo as operator
    7.     Select Entity Attribute as compare with
    8.     Select EndDate in Select Entity Attribute list
    9.     Change to Validation Execution tab
    10.     StartDate should already by in Selected Attributes list
    11.     Also move EndDate to Selected Attributes list
    12.     Change to Failure Handling tab
    13.     Ensure Error is selected for Validation Failure Severity
    14.     Enter an error message in the Message Text field
    15.     Select ok button.
    Within Business Components Browser for an existing record, setting the StartDate >= EndDate then commit does not raise an error. I'm guessing we should see an error.
    I've attempted the same with 2 Number domain attributes and the error is correctly raised, so I suspect the error is with the Data domains.
    Regards,
    CM.

    Can no longer reproduce this bug in the JDEVADF_MAIN_GENERIC_070607.0749.4562 build I have on my machine today, so it has been fixed post-JavaOne tech preview.

  • May I know how to confighure the ADF views,Entity to load while startup

    Hi,
    I want to load some lookup tables i.e adf views/entities while starting server. May I know how I can confighure that in oc4j?
    Thanks,

    user528306,
    You might be able to use startup classes, or a startup servlet.
    Good Luck,
    Avi.

  • How to get master key for strong composition detail

    Hi all,
    My Offline Database Diagram that I have drawn with JDeveloper uses the cascading delete option in foreign keys. When the master will be deleted, its details should be deleted as well. This has resulted in strong composition relationships between master and details.
    These relationships are covered by ADF BC Entity Associations and View Links.
    But what strikes me is that both AppModule tester and the JHeadstart first-cut application are not able to insert a new detail? They respond with:
    JBO-25030: Failed to find or invalidate owning entity
    I found an article of Steve Muench discussing this topic with a bare BC4J Java sample. How do I get this in my master/details Entity Impl's context? How can I get the key of the selected master in the create() method of the detail (Steve Muench selects the first row in the table)?
    I can't get rid of the strong association relationship in the Entity Association. It is automatically switched on when I switched it off.
    Anyone to help?
    thanks in advance,
    Martijn Peters

    Hi Markus,
    Thanks for your reply. Your hints describe how to manually set up a master-detail relationship at the View Objects level.
    Does this also work for master-detail entity objects that have a strong composition through CASCADE DELETE on the foreign keys in the database?
    What surprises me is that the BC4J wizard uses different approaches for creating a master with details with or without CASCADE DELETE.
    I would not expect different behavior for the create() operation in BC4J. I would only expect different behavior for remove() operations.
    Moreover it is strange that the generated View Objects can not be altered and that we depend on a workaround you described.
    Is their no risk for BC4J corruption when the master is deleted with the BC4J tester and that the database CASCADE deletes the details?
    JDeveloper 10.1.2 provides a pretty tool for designing and maintaining a database schema though an Offline Database Diagram.
    It shows the CASCADE DELETE option on foreign keys as a strong composition in an object oriented fashion.
    The ADF BC wizard is very powerful in making an object oriented abstraction of the database schema.
    However it seems to me that ADF BC does not seamlessly fit regarding compositions.
    Switching on CASCADE DELETE in the database causes master-details pages in JHeadstart to disfunction.
    Need this be improved in BC4J or am I wrong in the implied concepts?
    What Java code can I add in the create() methods of my Entity Object subclasses to get the same behavior of regular master-detail objects creation?
    Martijn Peters

  • Problem in Deploying ADF Application - development Mode

    hi Experts,
    i have jdev11.1.1.5.0 in a combination with weblogic 10.3.5.
    my application is working fine, while running on integrated wls (just give right click and on my jspx page - auto deploying).
    if i going with manually deploying option on same intergrated wls or standalone wls means
    i can able to get my login page, if i login means it doesnt re-direct to my index page what it would be problem? (it doent replicate this kind of intergrated wls (auto deploying))
    Details of my Application
    am not using any adf security. my login page is in session scoped bean , index page - backing bean scoped.
    my log shows, your username and password is correct. that means it can able to access my Application Module.
    am using adfc - config for redirecting
    <control-flow-rule id="__5">
        <from-activity-id id="__6">loginPage</from-activity-id>
        <control-flow-case id="__7">
          <from-outcome id="__13">error</from-outcome>
          <to-activity-id id="__8">loginPage</to-activity-id>
        </control-flow-case>
        <control-flow-case id="__14">
          <from-outcome id="__16">success</from-outcome>
          <to-activity-id id="__15">Indexpage</to-activity-id>
        </control-flow-case>
      </control-flow-rule>This Same project Doesnt behave like this Olden days.
    i maked out sample for deplying an adf application in both Integrated wls and standlone wls. it's fine.
    can anyone guide me where am?
    any one had a idea?
    while am deploying manually i got dialog "deployment configuration" to deploy.
    i got this in my log.
    [01:07:44 PM] Entering Oracle Deployment Plan Editor
    [01:07:46 PM] No metadata repositories found on target server. Using values found in adf-config.xml. //show this red collor

    + info,
    sometimes, i had another problem while login
    if i go with manual deployment on integrated wls/ standlone wls
    JBO-25002: Definition com.x.x.model.associations.xLogAS of type Entity Association is not found.i had viewlink named "xxxLogVL" in my model layer that viewlink mapped a association named "xLogAS".
    both are looking safe while running Business Component broswer and running intragrated wls(auto deploying).
    i checked the myApplicationModule.xml no warning on right hand gutter. so what would be the problem.?
    somtimes i had this? how can i fix this?
    cant come to conclusion? with to two different problem in same project.

  • Database constraints propagated to entity

    I'm trying to determine which database constraints are propagated to an entity when the entity is generated from a table.
    From what I can tell, it looks like
    <ul><li>primary key</li>
    <li>not null</li>
    <li>unique key</li>
    <li>precision</li>
    <li>foreign key (via
         associations)</li>
    </ul>
    are honored in the entity.
    <ul><li>check constraints</li>
    <li>default values</li>
    </ul>
    are not carried over.
    However, even though some constraints are carried over, does this mean they are enforced (or validated)?
    It looks like the following Validation rules are created:
    <ul><li>Not Null constraints --&gt; Database Constraint - Mandatory</li>
    <li>Precision constraints --&gt; Database Constraint - Precision</li>
    </ul>
    Do the rest--even the Primary Key constraint-need to be created as Validation rules in the entity? The documentation is not very clear on this.
    Thanks.

    Please read under Unique Key Validator
    http://one-size-doesnt-fit-all.blogspot.com/2007/08/jdev-11g-new-features-adf-bc-entity.html
    Unique Key Validator - has changed somewhat and now allows you to define validation on primary and unique keys defined for the EO (indirectly derived from the underlying table). In addition you may define multiple Unique Key Validators against the one EO where the 10.1.3 release limited this to one.
    In summary the 10.1.3 release introduced the basic declarative validators against Entity Objects in ADF Business Components. Within the 11g release this has given the JDeveloper team the opportunity to go beyond the obvious validation requirements and give sophisticated declarative business rule validation still with the advantage of minimal to no coding required.

  • Commit both parts of a "references" association together

    I'm running JDev 11.1.2.3.0.
    I have an Entity Association between TABLE_A and TABLE_B Entities in a 0..1 -> * references relationship. I will either be creating just a record in TABLE_B or records in both TABLE_B and TABLE_B.
    When creating records in both Entities I want both records to form an atomic transaction; either commit both or rollback. The problem is that if I try to commit both at the same time, the child record won't insert because the parent PK has changed from the temporary negative number. If I set the Association to be a Composite Association, committing both records together works, but I am then unable to commit a single record in TABLE_B on it's own.
    What is the recommended solution for this situation?
    Many thanks

    The referencing field in the "child" table isn't mandatory. This is why I really want to use a references association, I just couldn't get it working so I tried the composition association.
    The relationship is TABLE_A 0..1 -> * TABLE_B. The two are independent; I'm either going to insert into both tables or just TABLE_B.
    What I'm trying to do is the equivalent of:
    INSERT INTO TABLE_A()
    VALUES()
    RETURNING ID INTO TABLE_A_ID_VAR;
    INSERT INTO TABLE_B(TABLE_A_ID)
    VALUES(TABLE_A_ID_VAR);
    COMMIT;
    or just
    INSERT INTO TABLE_B()
    VALUES;
    COMMIT;
    I don't understand how one does the two table insert with TABLE_B referencing TABLE_A in ADF. If I try to do that with just a "references" association, I see TABLE_B FK is initially populated with the temporary negative ID of TABLE_A, but isn't updated on COMMIT with the actual ID.

  • ADF BC: Polymorphism and relations

    Hi,
    I'm building an ADF 11g application. In our data model, we have a table that contains four different types of transactions, all with the same attributes (columns). One column contains the transaction type and is the discriminator column. We also have customers, and each customer can have different types of transactions. In the database there is a foreign key relation between customers and transactions.
    In the user interface, there is a separate screen for each type of transaction. We added each type of transaction as a separate View Usage in the application module and used View Criteria to show only transactions of one kind. But now we want to have some default values set on the transactions and the default values depend on the type of transaction. Since default values are set on Entity Objects, I thought I'd need Entity polymorphism to accomplish this. There is a section on this topic in the [Fusion Developers Guide|http://download.oracle.com/docs/cd/E12839_01/web.1111/b31974/bcadveo.htm#sm0327]. I figure I also need polymorphic view rows, [as described in another section of the dev guide|http://download.oracle.com/docs/cd/E12839_01/web.1111/b31974/bcadvvo.htm#sm0515].
    But what I can't find anywhere on the internet is how to use polymorphism with Entity Associations and View Links. I don't want to define links for every sub type. I'd think that it should be enough to define the assocation/link on the top level. But I can't find any documentation on this. Another thing is that it seems that there is no way to have an "abstract" Entity or View Object. We have four types of transactions, let's call them A, B, C and D. On the Entity side, I'd like to have an abstract TransactionEO and four concrete Transaction+X+EO's. (Where X is one of the four types.) But it seems ADF BC forces me to use one of the four types as the default type and use that default type as the super class. Am I missing something here?
    To summarize, I'd like the following questions to be answered:
    <ol><li>How to use polymorphism in conjunction with Entity Associations and/or View Links?</li>
    <li>Is it right that I have to use one of my discriminator values as a default and use that default on the super type? (IOW: Is it right that there cannot be an abstract super Entity?)
    </li>
    <li>I noticed that a search on "polymorphism" on this forum returned zero results. Does that say anything about how much polymorphism is used in real life projects?</li>
    </ol>
    Thanks in advance for any help!
    Best regards,
    Bart Kummel

    I'm building an ADF 11g application. In our data model, we have a table that contains four different types of transactions, all with the same attributes (columns). One column contains the transaction type and is the discriminator column. We also have customers, and each customer can have different types of transactions. In the database there is a foreign key relation between customers and transactions.If you want all types of customers to be related to all types of transactions, then:
    * Create a BaseCustomer EO, defining its CustomerType attribute as descriminator and leaving the default value NULL for that discriminator attribute. It is not important that any row in the CUSTOMER table actually have a NULL value for the discrminator.
    * Create a BaseTransaction EO, defining its TransactionType attribute as descriminator and leaving the default value NULL for that discriminator attribute
    * Associate them
    Then any subtypes of BaseCustomer and any subtypes of Customer inherit this association, and any common code/attributes that are relevant to all customers and all transactions can live in this base class. It's not formally marked as "abstract" in the metadata, but for all intents and purposes it is your abstract EO if there never exists any row in the CUSTOMER table with CustomerType of NULL or any row in the TRANSACTION table with TxnType of NULL.
    In the user interface, there is a separate screen for each type of transaction. We added each type of transaction as a separate View Usage in the application module and used View Criteria to show only transactions of one kind. But now we want to have some default values set on the transactions and the default values depend on the type of transaction. Since default values are set on Entity Objects, I thought I'd need Entity polymorphism to accomplish this. There is a section on this topic in the [Fusion Developers Guide|http://download.oracle.com/docs/cd/E12839_01/web.1111/b31974/bcadveo.htm#sm0327].
    You'll need a view object with polymorphic entity usages, and will need to use the CreateWithParameters built-in operation to supply the discriminator attribute value at row create time so the framework knows what EO subtype you'd like the new view row to have.
    I figure I also need polymorphic view rows, [as described in another section of the dev guide|http://download.oracle.com/docs/cd/E12839_01/web.1111/b31974/bcadvvo.htm#sm0515].
    You would typically need this if either of the following is true:
    * Different view row subtypes will be exposing different sets of attributes
    * Different view row subtypes will require different sets of exposed client custom methods (or subtype-specific implementations of common view row custom methods inherited from the base)
    In that case, you'd viewlink the base VO's together, and the subtype VO's inherit those view links.
    But what I can't find anywhere on the internet is how to use polymorphism with Entity Associations and View Links. I don't want to define links for every sub type. I'd think that it should be enough to define the assocation/link on the top level. But I can't find any documentation on this. Another thing is that it seems that there is no way to have an "abstract" Entity or View Object.I mentioned above the closest thing we have to an "abstract" EO or VO. A base component whose discriminator attribute default value never actually occurs in row data (I used NULL above, but it could be any non-occurring value)
    We have four types of transactions, let's call them A, B, C and D. On the Entity side, I'd like to have an abstract TransactionEO and four concrete Transaction+X+EO's. (Where X is one of the four types.) But it seems ADF BC forces me to use one of the four types as the default type and use that default type as the super class. Am I missing something here?See my suggestion above.
    Let us know if any other questions pop up trying to implement the suggestions above.

Maybe you are looking for

  • ABAP Proxy synchronous interface - access to payload

    Hi, I have a scenario from ABAP Proxy -> XI -> Web Service. On occassion, there is an issue with calling the Web Service (unavailable for instance) and an exception is returned to the ABAP Proxy for a SystemError. I am able to catch this exception in

  • Loading external swf files

    I have a Flash presentation where the chapters are made of seperate swf files. How can I link them, so they play in the correct order automatically? I will also need to make a clickable version. Any help greatley appreciated. Thanks D.

  • Calling multiple forms from main form

    Hi, I have a two-part question regarding calling forms from a main form. I have created a push button (on my main form) with the intention of calling one of two different forms by clicking it. Both forms will be used to search either a person's name

  • Members rejected during dimension load

    Hi, I am trying to deploy an application from Essbase studio. It loads few members and rejects few members. And it does not load any member to scenario and Version dimensions. I have the source in Parent, child relationship and the top most parent be

  • InDesign CS4 Trial Installation

    I just downloaded (for the 3rd time at about 1 hour dowload time each) the trial version of InDesign CS4 and it will not execute.  The setup file is either corrupt or incomplete, because I get an error message that the setup file is incomplete or mis