EJB Finder View Links and CMR

Hi,
Can someone please give me some input on the following warning in the JDeveloper online help!
"Warning: You cannot create an EJB finder view link that expresses the same relationship as a CMR."
I'm new to EJB, BC4J and JDeveloper. I created container managed entity beans with local interfaces only to represent my data and relationships. No problems with the mapping so far.
To test the beans I used Session Facades with remote interfaces and build a sample test client.
Now I thought I could create EJB Entity Facades, EJB Finder View Objects, EJB Finder View Links and EJB Application Modules to make use of the BC4J framework in order to speed up programming clients (JSP and JClient).
So I've started studying the JDeveloper online help (which seems to be very useful) and found the above mentioned warning.
Well, better a warning than nothing at all, but some more explanations would have been even better.
Is there no need to use view links with CMR?
How to achieve the same functionality (synchronizing two view objects in a master-detail-relationship) with CMR?
Do you know any examples? I couldn't find any examples using EJB entity facades in the "sample code" area on OTN.
Any comments about other (better) architectures are also welcome. Would it be better to use BMP entity beans in conjunction with BC4J?
Many thanks for your help!
Regards,
Eric

Steven,
thank you for your reply and suggestions - I'll count on that. If I find time I'll read this book. It seems to be very interesting.
For educational purposes I'd like to look at both persistence implementation strategies. I agree that it looks definitly easier to use entity objects. Certainly it's also performancewise a better choice.
Anyhow, could you give me some useful tips for cmp entity beans and finder view objects?
Is there something which works completely different if I use BC4J on top of it?
How to implement a master-detail relationship in JClient (Swing) for example?
What about writing an ejbfinder which doesn't return all, but all data where the foreign key is equal to a parameter passed to the finder method and use this as the source for a detail view object. This could be the primary key of the selected master. Well, I don't know whether this is doable. But that's what comes to my mind spontaneously.
Would this be a solution? I'm still thinking about the aforementioned warning in the online help regarding view links.
I guess the problem is that the foreign key is not part of the entity bean as it's not a cmp-field. Instead you have accessor methods to retrieve a related object or a collection of objects.
I'm sure my questions are not too complicated to answer. It's only hard for a beginner to get an overview.
I'm quite confident that I'll manage this if I give my best and get some help from knowledgeable people like you Steven.
Regards,
Eric

Similar Messages

  • View Link  and HGrid - Urgent

    Hi,
    The hierarchy in HGrid can be constructed using the view link and a view object.
    If I want to associate a "Where" condition with the child rows of my "root Row", I need to relate the source view object with destination view object.
    How do I independently associate a where clause with the child rows ?
    I am working on this for a long time and finding nobody to help me on HGrid complexities.
    Can anybody please help ? Does anybody suggest raising a TAR for this, to Oracle ?
    Thanks,
    Amit

    Amit,
    You would have to build runtime VL in that case, because only then you would be able to first set where clause of child VO and then get filtered rows by runtime VL.
    --Mukul                                                                                                                                                                                                                                                                                                                                                                                                   

  • Error with view link and ADF table Tree

    Hello
    ( Note: View objects are created based on static data but not from database tables)
    I created two view objects "SuiteViewObject" and "FamilyViewObject" which are based on static data( stored in collection) but not on database entity. A veiw link "SuiteFamilyViewLink" is created from the above two view objects. An ADFTreeTable is created from the above view objects and view link. When run the jspx page containing ADFTreeTable, following error is occured in the browser.
    JBO-30003: The application pool (staticviewobjects.staticappLocal) failed to checkout an application module due to the following exception:
    oracle.jbo.JboException: JBO-29000: Unexpected exception caught: oracle.jbo.InvalidOperException, msg=JBO-26016: Cannot set user query to view "FamilyViewObj2" because it is a destination in a view link
    Any help on the above error message.?
    Thanks in Advance
    Kristi
    Bangalore
    Message was edited by:
    user576892

    Hello
    The above error is coming becuase view link's SQL query expects tables. But in my case I dont have tables, view objects are created from static data source(collection).
    How to create a view link from view objects which are created based on static data source(collection)?

  • View Links and Associations

    hi all,
    What is the difference between view links which is based on associations and view links which is not based on associations?
    yours,
    Bassam

    Hi,
    associations is what you can use on the EO to resolve a relation between two EntityObjects. You can e.g use this in code to access parent or detail information.
    ViewLinks provide you the same on the ViewObject layer. You can base a ViewLink on an association in which case you don't need to know about what actually the relation is build upon.
    Frank

  • How to extend VO which is use in VIEW LINK and VL is created dynamically.

    Hi All,
    I wants to extend VO.
    This VO is used in VIEW LINK.
    This VL name set dynamically, conditionally in one of the controller of page.
    i.e if some condition satisfied than xyz VL will use otherwise abc VL will use.
    Now,
    I have extend VO as well as VL and substitute both, but I am getting null value for some of the field and also I am not able to insert/update new value.
    So,
    I have created VORowImpl class file which extend VOROWImpl of seeded file and chage the row class of VO.xml file to new class. i.e. modified seeded .xml code and achieve what I want.
    But Is this correct way ?
    Is there any other way ?
    --Tushar Topiwala                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

    Hi pratap,
    thanx for your reply.
    intially i've done that also. i.e. extend only VO and substitute it but i'm getting null values in some field as well as nt able to insert/update new value.
    the error is related to VL.
    --tushar topiwala                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

  • View Link and and navigate between pages problem...

    Hi, everyone! Hope someone can help with my problem. In DB I have one table with informationa about Employees and Jobs. From this one table I made one EO from which I made 2 VO - EmployeeVO and JobsVO. I link these two VO with ViewLink - EmpJobVL (1 to 1 realtionship).
    Then I created 2 .jspx pages. In one page I droped EmployeeVO but in second page I droped JobsVO. In page template I put button with which I can navigate between these two pages.
    The problem is... when I run my employee page and navigate to correct record with "next" button and then try to navigate to jobs page then in jobs page I can't see correct record. I always see there first record. Why it is so and what can I do?
    Hope that someone helps me,
    Best regards, Debuger!

    Hi Debuger,
         No probs, U can keep ur Jspx as such u just need to clean up ur PageDefs..... Dont struggle more urself its such a easy job...
         Delete all ur page def entries and then have a copy of ur jspx coding in a notepad and delete that too....
    make ur jspx and page def a fresh one re-drag ur VOs and paste ur jspx codings again
    Ur VOs will get binded automatically......... :)
    Regards,
    Suganth.G

  • How to Refresh View Link and Associations

    hi all,
    How can I Refresh my viewlink and Association.
    Nani:)

    Can you provide your use-case, your query seems to be very generic

  • How can I show shipping costs in my search results? Where is "Customize view" link?

    Ebay has this help page: http://pages.ebay.ca/help/search/questions/shipping-column.html It says "Click the 'Customize view' link located at the top of your search results." I can't find the "Customize view" link, and there call center person wasn't much help.  Does the ability top see the shipping cost in the search results still exist? 

    quixotix wrote:
    Ebay has this help page: http://pages.ebay.ca/help/search/questions/shipping-column.html It says "Click the 'Customize view' link located at the top of your search results." I can't find the "Customize view" link, and there call center person wasn't much help.  Does the ability top see the shipping cost in the search results still exist?  Are you viewing on a mobile device or desktop? My search results on a desktop computer shows shipping on a line under the price for the item. 

  • View links / Associations best practices

    Hello,
    I have a little question on how to use view links and associations in an optimal way.
    The situation is the following:
    I have 2 tables: one master and one detail, I have therefore the following default classes:
    Entities: MasterImpl, DetailImpl,
    Views: MasterViewImpl, MasterViewRowImpl,
    View Rows: DetailViewImpl, DetailViewRowImpl,
    Association: FkMasterHasDetailAssoc
    View Link: FkMasterHasDetailLink
    I also hav an application module which I can use as a container faor all these.
    I need to process a series of rows from the Master view. Of course the process includes screening the corresponding detail rows.
    I'd like to know which one of the following solutions will give the best results in terms of performance, or maybe there is no difference:
    1/ Write a process() method in the MasterViewRowImpl view Row class, which uses the view link to retrieve the corresponding detail View rows. Then loop through the MasterView, calling process() on each row.
    2/ Write a process() method in the MasterImpl Entity class, which uses the Association's RowIterator to retrieve the corresponding detail entities. Then loop through the MasterView, calling process() on each row's underlying entity.
    3/ Include both views, linked by the view link, in the application module and implement a AppMod.process() method which loops through the MasterView and the DetailView.
    Which one will make best use of the resources, or execute the smallest number of queries? Or maybe there will be no difference at all?
    Thanks in advance for any answer
    Remi DEH
    Oops, before I forget: I'm using JDev3.1 / 8.1.6, both on NT and I'm developping, with BC4J, an application meant to run as a series of EJB, deployed either in JServer or OAS/iAS.
    null

    KeepItSimple,Stupid!
    That is, just because there are neat things like drop-down
    text, marquees, and such, doesn't mean you should use them.
    Stick to the basic HTML fonts and colors (use the
    w3schools web site for all
    things HTML and CSS.
    Instead of styles, create your lists by selecting Normal
    paragraphs and formatting with the Bullet and Number toolbar
    buttons.
    Keep your tables as simple as possible (try not to nest them
    and have all sorts of row and column spans, and try to avoid lists
    and figures, if you can). Also, break up very long tables into
    functional groupings with introductory headings.
    Use
    Peter Grainge's web
    site and
    Rick
    Stone's web site for all the best workarounds and diagnostics.
    Good luck,
    Leon

  • Af:tree Using View Links

    Hi
    I have created two af:tree components. Based on similar conditions but on different database tables.
    I have no issues in displaying one tree. I am able to expand the tree and go to second level and so on.
    But for my second tree component when i try to expand the top most level, I am not seeing any values.
    I have enabled debug logs in my JDev to see the query that gets run and found out that the bind variable is getting a junk value.
    The bind variable should typically get the id of the value that i am trying to expand. I am able to see values correctly being passed in my earlier tree (the one that is working fine).
    I have tried to compare both the VOs and View links and could not find any.
    Please help me in resolving this issue.
    Thanks
    Kamal

    Hi Frank
    Sorry for not being clear.
    Let me explain my issue clearly.
    I have a table with columns and values as below:
    LEVEL_ID | FILTER | CODE1 | CODE2
    1     | | A     | B
    2     | A | A1 | A2
    2     | B | B1 | B2
    I want the above table to be shown as below tree structure
    A
    |__A1
    |__A2
    B
    |__B1
    |__B2
    For this implementation, i created a View object that returns all the codes at level_id 1 (VO1) and a View Object that returns all the codes at level_id 2(VO2).
    I have a view link between these two where i bind the CODE1 of VO1 to FILTER of VO2. VO1 is the parent and VO2 is the child.
    Using VO1 i have created the tree (drag and drop) and in the edit tree binding dialog box i have added the rules appropriately.
    When i run my page, with debug logs enabled, I can see the A,B values coming properly in the UI. But, when i try to expand any of them, I do not see the A1,A2 or B1,B2 values.
    In the debug logs, I can see a junk value being passed when i try to expand rather than 'A' or 'B'.
    I have done a similar implementation with another tree component and it works fine as i can see proper values in the debug logs.
    I do not understand why the junk values are passed.
    Hope this explanation gives a clear idea about my issue.
    I am currently using JDev 11.1.1.3 version.
    Thank you
    Kamal

  • View Link on two programmatic view objects

    Hello,
    I use Build JDEVADF_11.1.1.1.0_GENERIC_090615.0017.5407
    I have two programmatic View Objects with data from other sources (an ArrayList in my example).
    Now I would like to create a View Link on it. How can I do this?
    I'm quite new on Java and ADF...
    I know it is possible because I already found Steve's example 132 here [http://blogs.oracle.com/smuenchadf/examples/|http://blogs.oracle.com/smuenchadf/examples/]
    But could somebody create a simple example based on my example classes below (which is understandable for a newbie like me ;-) ?
    Has been asked already here, but I did not found a solution as yet.
    Error with view link and ADF table Tree
    This is my example code for the view objects:
    Employee.java:
    private Number empno;
    private String ename;
    private Number dept;
    with getters and setters...
    Department.java
    private Number deptno;
    private String dname;
    with getters and setters...
    public class StaticDataDepartmentsImpl extends ViewObjectImpl {
    int rows = -1;
    private List<Department> departments = new ArrayList<Department>();
    protected void executeQueryForCollection(Object rowset, Object[] params,
    int noUserParams) {
    // Initialize our fetch position for the query collection
    setFetchPos(rowset, 0);
    super.executeQueryForCollection(rowset, params, noUserParams);
    // Help the hasNext() method know if there are more rows to fetch or not
    protected boolean hasNextForCollection(Object rowset) {
    return getFetchPos(rowset) < rows;
    // Create and populate the "next" row in the rowset when needed
    protected ViewRowImpl createRowFromResultSet(Object rowset,ResultSet rs) {
    ViewRowImpl r = createNewRowForCollection(rowset);
    int pos = getFetchPos(rowset);
    populateAttributeForRow(r, 0, departments.get(pos).getDeptno());
    populateAttributeForRow(r, 1, departments.get(pos).getDname());
    setFetchPos(rowset, pos + 1);
    return r;
    // When created, initialize static data and remove trace of any SQL query
    protected void create() {
    super.create();
    // Setup string arrays of codes and values from VO custom properties
    initializeStaticData();
    rows = (departments != null) ? departments.size() : 0;
    // Wipe out all traces of a query for this VO
    getViewDef().setQuery(null);
    getViewDef().setSelectClause(null);
    setQuery(null);
    // Return the estimatedRowCount of the collection
    public long getQueryHitCount(ViewRowSetImpl viewRowSet) {
    return rows;
    // Subclasses override this to initialize their static data
    protected void initializeStaticData() {
    Department d1 = new Department();
    d1.setDeptno(new Number(10));
    d1.setDname("IT");
    Department d2 = new Department();
    d2.setDeptno(new Number(20));
    d2.setDname("HR");
    departments.add(d1);
    departments.add(d2);
    // Store the current fetch position in the user data context
    private void setFetchPos(Object rowset, int pos) {
    if (pos == rows) {
    setFetchCompleteForCollection(rowset, true);
    setUserDataForCollection(rowset, new Integer(pos));
    // Get the current fetch position from the user data context
    private int getFetchPos(Object rowset) {
    return ((Integer)getUserDataForCollection(rowset)).intValue();
    public class StaticDataEmployeesImpl extends ViewObjectImpl {
    int rows = -1;
    private List<Employee> employees = new ArrayList<Employee>();
    protected void executeQueryForCollection(Object rowset, Object[] params,
    int noUserParams) {
    // Initialize our fetch position for the query collection
    setFetchPos(rowset, 0);
    System.out.println("in executeQueryForCollection");
    super.executeQueryForCollection(rowset, params, noUserParams);
    // Help the hasNext() method know if there are more rows to fetch or not
    protected boolean hasNextForCollection(Object rowset) {
    System.out.println("in hasNextForCollection. Rows:" + rows);
    return getFetchPos(rowset) < rows;
    // Create and populate the "next" row in the rowset when needed
    protected ViewRowImpl createRowFromResultSet(Object rowset,ResultSet rs) {
    ViewRowImpl r = createNewRowForCollection(rowset);
    int pos = getFetchPos(rowset);
    System.out.println("in createRowFromResultSet. Pos=" + pos);
    populateAttributeForRow(r, 0, employees.get(pos).getEmpno());
    populateAttributeForRow(r, 1, employees.get(pos).getEname());
    populateAttributeForRow(r, 2, employees.get(pos).getDept());
    setFetchPos(rowset, pos + 1);
    return r;
    // When created, initialize static data and remove trace of any SQL query
    protected void create() {
    super.create();
    // Setup string arrays of codes and values from VO custom properties
    initializeStaticData();
    rows = (employees != null) ? employees.size() : 0;
    System.out.println("in create(). Rows=" + rows);
    // Wipe out all traces of a query for this VO
    getViewDef().setQuery(null);
    getViewDef().setSelectClause(null);
    setQuery(null);
    // Return the estimatedRowCount of the collection
    public long getQueryHitCount(ViewRowSetImpl viewRowSet) {
    return rows;
    // Subclasses override this to initialize their static data
    protected void initializeStaticData() {
    Employee e1 = new Employee();
    e1.setEmpno(new Number(2333));
    e1.setEname("Emp1");
    e1.setDept(new Number(10));
    Employee e2 = new Employee();
    e2.setEmpno(new Number(1199));
    e2.setEname("Emp2");
    e2.setDept(new Number(20));
    Employee e3 = new Employee();
    e3.setEmpno(new Number(3433));
    e3.setEname("Emp3");
    e3.setDept(new Number(10));
    Employee e4 = new Employee();
    e4.setEmpno(new Number(5599));
    e4.setEname("Emp4");
    e4.setDept(new Number(20));
    Employee e5 = new Employee();
    e5.setEmpno(new Number(5676));
    e5.setEname("Emp5");
    e5.setDept(new Number(10));
    Employee e6 = new Employee();
    e6.setEmpno(new Number(7867));
    e6.setEname("Emp6");
    e6.setDept(new Number(20));
    employees.add(e1);
    employees.add(e2);
    employees.add(e3);
    employees.add(e4);
    employees.add(e5);
    employees.add(e6);
    // Store the current fetch position in the user data context
    private void setFetchPos(Object rowset, int pos) {
    if (pos == rows) {
    setFetchCompleteForCollection(rowset, true);
    setUserDataForCollection(rowset, new Integer(pos));
    // Get the current fetch position from the user data context
    private int getFetchPos(Object rowset) {
    return ((Integer)getUserDataForCollection(rowset)).intValue();
    Who can help?
    Thnx in advance!
    Rolf

    Rolf,
    I guess when we try to do it for you, we end up with almost the sample code provided by Steve Muench.
    So there from my point of view it doesn't make sense to do it all over.
    Take some time and study the sample code, run it without changes and after that try some changes which suits your use case better.
    If you don't understand what's going on in the sample post the question here and we try to help you.
    Timo

  • View links in multi table relations

    Is it advisable (in terms of performance e. g.), to create view links and view objects as local variables in multi table relations?
    examle: the jdev online help says to use
    such multi table relations like this:
    // A (one) -> B (many) -> C (many)
    ViewLink a2b = appMod.findViewLink("AtoB");
    ViewLink b2c = appMod.findViewLink("BtoC");
    ViewObject aV = a2b.getSource();
    ViewObject bV = a2b.getDestination();
    ViewObject cV = b2c.getDestination();
    while(aV.hasNext())
    Row aR = aV.next();
    while(bV.hasNext())
    Row bR = cV.next();
    while(cV.hasNext())
    Row cR = cV.next();
    I would rather keep everything concerning
    a, b, c together, especially when more
    tables (d, e, ...) are added, like this
    ViewLink a2b = appMod.findViewLink("AtoB");
    ViewObject aV = a2b.getSource();
    while(aV.hasNext())
    Row aR = aV.next();
    ViewLink b2c = appMod.findViewLink("BtoC");
    ViewObject bV = a2b.getDestination();
    while(bV.hasNext())
    Row bR = cV.next();
    ViewObject cV = b2c.getDestination();
    while(cV.hasNext())
    Row cR = cV.next();
    Is there anything to say against this approach (in term of performance for example). I am not sure to remeber,
    if this was the approach used in the HotelResevationSystem example.
    Thanks.
    Rx
    null

    For this to work you have to either build a view based on the entities from which you need attributes (joined by the FK) or build a ViewObject with the sql statement giving you all the attributes you need.
    The first case enables you the edit the attributes, the second gives you read only access to the attributes.
    What you try to do isn't a master-detail connection, you are doing a join of some tables.
    Timo

  • TP4 ADF BC [BUG] view link are not updated after database synchronization

    I have a table with a recursive relationship.
    By mystake, I created a recursive foreign key for the same attribute (deptid->deptid instead of deptid->parentdeptid).
    I generated entity, view and application module from this schema.
    When compiling, errors was produced indicating the problem.
    I corrected the problem in offline database, generate the changes into the database successfully.
    I ask to synchronize the entity with the database, the changes was identified correctly and a new association was created.
    First remark: the old one still there and it was necessary to delete it and rename the new generated one (to be consistent with other name). May be an option to overwriting the old one will be more pleasant, may be asking if the new one has to replace an existing one and show a list of existing ones.
    Regenerating the association was correct and one error was removed when compiling again. The error on the view link still there.
    I would like to delete the assoc and recreate it from the entity assoc but it was not possible easily because the view link is used in the application module !!!!
    It will be nice to permit to regenerate an existing view link from an entity association without deleting it.
    May be it is a better way to synchronize ? I would be very interesting to know how to achieve it as the best !

    Was the inability to have the synchronization remove the key specific to the existing association's being self-referential, or if your initial association was from DeptId to some other attribute (which you then corrected) would the synchronize have fixed the problem?
    The simplest way to achieve what you want given existing features would be to have delete the view link instance, view link, and association, follow by resynchronizing (I believe), then recreating the viewlink and adding back the view link instance.

  • Advanced Table in Table View Link

    Hello All,
    I have an advanced table in advanced table. The detail record is associated with the master record through a view link. Within the master table, whenever I click on the details column (hide/show) link for the first time, I will get the corresponding detail record for that master row. For any subsequent clicks on the hide show link in different rows, all detail records will be the same as whatever detail record was shown first. How do I get the view link and detail VO to refresh based on the row I have just selected the hide/show link on?
    Thanks in Advance!

    Make sure that the key attribute is set for the master and detail VOs

  • Eo association,View Link

    hi,
    please explain Eo association,View Link and in what situation they are used with an example
    Regards,
    Pk

    Shay,
    Thank you for your reply. I will take a look at your links.
    Use Case:
    Application will have different BC for different IT Assets (like Monitor, Keyboard, Servers etc), which will basically hold records for all available Assets (like Display Resolution, screen size etc for all monitor in Monitor BC).
    I want to give user; the ability to create, for e.g., the sub-class of Monitor to store more specific attribute-values in different table (which will be linked Parent BC). For e.g.: They may want to care about holding CRT and LCD Monitor records in separate new database table -- Application will ask user what all attributes/Columns they want to see for LCD which is specific to this type AND which is not present in already existing out-of-box Monitor BC/Table - e.g. - "Viewing Angle" Attribute).
    With that said, I can write code to create database table on fly (having 1-to-1 foreign key reference to parent table) but writing ADF part seems difficult. I also wanted application to automatically generate new page for newly added VO BC. E.g.: LCD-Monitor.JSPX inheriting all attributes from monitor (parent VO) in the same structure as Monitor.JSPX file is having with extra LCD-specific Attributes in separate panel tab (which again UI developers can customized it).
    Too much to expect huh !
    I am going to start building the application so If not above way, any other suggestion to achieve the requirement ?
    Edited by: Anandsagar Sah on Aug 29, 2011 9:23 PM

Maybe you are looking for