ADF BC View Objects: Disappearing where clauses

Playing around with the 11g Technical Preview I find out that sometimes the where clauses - added to View Objects by means of the new "Join Type" field in the VO-editor UI - disappear.
I'm not able to reproduce exactly and "on demand", but it seems to happen when the sources of more than one View Object are open simultaneously and/or the XML definition of a View Object is edited directly on the Source-tab.

Today I succeeded in reproducing:
Two tables:
TAB_MASTER:
ID NUMBER NOT NULL
DESCRIPTION VARCHAR2 NOT NULL
TAB_DETAIL:
ID NUMBER NOT NULL
MASTER_ID NUMBER NOT NULL
DESCRIPTION VARCHAR2 NOT NULL
TAB_DETAIL.MASTER_ID is a foreign key referencing TAB_MASTER.ID.
Steps to reproduce:
1. Generate default ADF BC objects from database tables.
2. Open definition of TAB_DETAIL View Object.
3. Go to the Entity Objects tab
4. Add TAB_MASTER Entity Object to the Selected Entities Objects. Association and Join Type are filled in automatically.
5. Go to the Query tab and go to SQL tab in de Property Inspector. Where clause is filled.
6. Go to the Attributes tab and click Add from Entity...
7. Add TAB_MASTER.DESCRIPTION attribute.
8. Again, go to the Query tab and go to SQL tab in de Property Inspector. Where clause is still filled.
9. Go to the Attributes tab and select MASTER_ID attribute.
10. Click icon to add List Of Values
11. In List Of Values dialog add View Object TAB_MASTER and add the correct pairs of List Return Values for the ID and (MASTER) DESCRIPTION attributes.
12. After completing the List Of Values dialog go to the Query tab -> SQL tab again. The where clause added to join the Entity Objects (see step 5.) is cleared, resulting in a wrong SQL statement for the View Object.

Similar Messages

  • How To change the ADF View Object  query where-clause at RunTime?

    I am trying to create a simple display page which will display user data (username, assoc_dist_id, assoc_agent_id, status , etc). The User data is stored in a database table and i am using an ADF Read Only table based on the View Object to display the data on the JSF page.
    However, i want to display only the users that a particular person accessing the page has the AUTH LEVEL to see. e.g. If the person accessing the page is an 'ApplicationAdministrator' then the page should display all users in the table, If its a 'DistributorAdministrator' then the page should display only users associated with that Distributor (i.e. assoc_dist_id = :p_Dist_id ) and If its an 'AgentAdministrator' , then the page should display only users associated with that Agent ( i.e. assoc_agent_id = :p_Agent_id).
    Currently my af:table component displays all the users in the table because the query for the view object is (select * from users) . However, i want to use the same viewobject and just set the where-clause at runtime with the appropriate parameter to restrict the dataset returned.
    Do anyone knows how to accomplish this ?

    David,
    See the custom method initializeDynamicVariableDefaults() in the SRViewObjectImpl.java class in the FrameworkExtentions project in the SRDemoSampleADFBC sample application. You can find out how to install the demo if you haven't already from the ADF Learning Center at:
    http://www.oracle.com/technology/products/adf/learnadf.html
    This class is a framework extension class for view objects that adds a neat, generic feature to be able to dynamic default the value of named bind variables. You can read more about what framework extension classes are and how to use them in Chapter 25, "Advanced Business Components Techniques" of the ADF Developer's Guide for Forms/4GL Developers, also available at the learning center above.
    It is an example of generic framework functionality that "kicks in" based on the presence of custom metadata properties on a named bind variable. See section 25.3.3 "Implementing Generic Functionality Driven by Custom Properties" in the dev guide for more details. Using this sample code, if you add a bind variable to a view object, and define a custom metadata property named "DynamicDefaultValue" on that bind variable, and set this custom metadata property to the value "CurrentUser", then that bind variable will have its value dynamically defaulted to the name of the authenticated user logged in. If instead you set this custom property to the value "UserRole", then the bind variable will be set to the comma-separated string containing the list of roles that the authenticated user is part of.
    Once you've created a framework extension class for view objects like this, you can have the view objects you create inherit this generic functionality.See section 25.1.4 "How to Base an ADF Component on a Framework Extension Class" in the dev guide for more info on this.
    By adapting a technique like this (or some idea similar that better suits your needs) you can have your view object query contain bind variables whose values automatically take on the defaults based on something in the user-session environment.

  • Connecting ADF BC view object w/ param to a JSF Table?

    I'm brand new to JDev so this is probably an easy one, I'm still trying to grasp some of the concepts: I have created an application module that has one view object containing a simple parameterized query (page is a simple search form - user enters keywords - I pass keywords to database and return results.) This Data Control shows up in the Data Control Palette and I am able to associate this with a table on the JSF page. Where I'm struggling is how / where do I tell JDev to bind the query parameter? In the examples from the help files, they show in the Data Control Palette a method with parameters. My Data Control Panel just shows the application module labeled as a Data Control with no parameters? In the Application Module (where I have defined the parameterized SQL stmt), in the Client Interface menu item, there are no methods available. Do I need to create the method even if I don't want to override the default functionality? Any help appreciated.
    Also, many of the tutorial and examples look like they use the EJB/Toplink approach - are there good examples or tutorial for using ADF BC and ADF Faces?
    Thanks. BTW - this product looks awesome so far! I was using myEclipse - this product is light years ahead.

    This new 10.1.3-production JSF/ADFBC tutorial covers a lot of ground and includes an example of building the search page that you're trying to build, too :-)
    http://otn.oracle.com/obe/obe1013jdev/masterdetail_adf_bc/master-detail_pagewith_adf_bc.htm
    The trick is noticing that a View Object with named bind parameters includes an additional built-in operation in its "Operations" folder called ExecuteWithParams. Dropping this operation onto your page gives you the choice of creating a "Parameter Form" for your VO's bind variables. If you then drop the VO as a readonly table to the same page and run the page, you are done. :-)
    Try to do that in Eclipse in two drag-drop operations! ;-)
    It warms my heart to hear you say that about JDeveloper versus Eclipse... Really makes my day!

  • [SOLVED] ADF BC : View Object "second level" Entity reference issue

    hi
    If I insert a row in a View Object that uses "two levels" of Entity references, the attributes of the Entity on the "second level" don't get a value.
    Consider these tables:
    MY_ROW (MY_ROW_ID, MY_ROW_STUFF, MY_ROW_LU1_ID)
    MY_ROW_LU1 (MY_ROW_LU1_ID, MY_ROW_LU1_STUFF, MY_ROW_LU1_LU1_ID)
    MY_ROW_LU1_LU1 (MY_ROW_LU1_LU1_ID, MY_ROW_LU1_LU1_STUFF)
    Where MY_ROW.MY_ROW_LU1_ID is a "look-up" in MY_ROW_LU1 and MY_ROW_LU1.MY_ROW_LU1_LU1_ID is a "second level look-up" in MY_ROW_LU1_LU1.
    I created default Entities and Associations on these tables and a View Object that uses all 3 Entities (MyRow as Updatable, MyRowLu1 and MyRowLu1Lu1 as Reference).
    See example code in
    http://verveja.footsteps.be/~verveja/files/oracle/ViewObjectEntityReferenceIssue-v0.03.zip
    (contains no Java code, all out-of-the-box ADF BC)
    problem scenario:
    If run the MyRowService Application Module in the Oracle Business Component Browser and "open" the MyRowViewAll View Object instance, I get the rows and their related "look-up values".
    If I click the "Insert a new record" button and fill out values for MyRowId, MyRowStuf and MyRowLu1IdEntity, I only get "look-up" values for the "first level". While the "second level" stays empty.
    For example, a MyRowLu1IdEntity of "2003" gives a MyRowLu1Stuff value of "2003 stuff", but no value in MyRowLu1Lu1Stuff.
    What am I doing wrong? What should I change to also get a value in the "second level" MyRowLu1Lu1Stuff attribute?
    many thanks
    Jan Vervecken

    Jan,
    If you create a view object on Emp and Dept, with Dept as a reference entity, you might choose to build the view object to only include the:
    Emp.Empno (required, since it's the PK of Emp entity usage)
    Emp.Ename (included since you want to show the ename)
    Dept.Deptno (required, since it's the PK of the Dept entity usage)
    Dept.Dname (included since you want to show the dname)
    The wizard enforces the inclusion of the required attributes above.
    When you run this view object, a join is performed and you see the reference data.
    Now, if you want to allow the user to UPDATE the reference data, you need to add one more attribute to the list of attributes:
    Emp.Empno
    Emp.Ename
    Emp.Deptno (To allow user to change Deptno employee belongs to)Dept.Deptno
    Dept.Dname
    At this point, not only is the join performed for you, but the ADF BC reference mechanism reacts to any modification of the Emp.Deptno attribute, correctly showing the reference information for that new foreign-key-referenced department (even before commiting and requerying, at which time the SQL join would pickup that correct, related information).
    The "second level" problem you describe in this thread is simply the same issue described here as a master/first-level-detail situation, taken to its logical next step. If you want the end-user to be able to change the second-level detail to which the first-level-detail is associated, you need to include the first-level-detail's foreign key attributes in the view object's select list. Otherwise, there is no foreign key attribute whose value-change event the framework can react to in order to coordinate the related reference data in the row.
    I've blogged a link to a working example of a four-level reference information view object here:
    http://radio.weblogs.com/0118231/2007/05/09.html#a818
    based on the HR schema.

  • ADF Join View Object

    we have a Join View Object joining Customer and Order tables. The Output in ADF table is like this
    CustomerName------------OrderID
    John------------------------------------1
    John------------------------------------2
    John------------------------------------3
    Tom------------------------------------80
    Tom------------------------------------81
    Tom------------------------------------82
    We need to show the out but as
    CustomerName------------OrdersPlaced
    John------------------------------------1,2,3
    Tom------------------------------------81,82,83
    Please suggest how we can acheive this
    Thanks
    Edited by: user11922045 on Oct 19, 2010 2:53 PM

    Our requirement is similar to a Order - OrderDetail example, (where the number of details many times wont exceed 3)
    The Order table has just the Order number and some name... and Order detail has order item, price and date detail item requested ..
    So we just need to show the list of Order and for each order( the details..item no, item, price, date time req)..
    As you can see we can fetch it in one single query..
    I can't ask the user to click on the Order number/name to see the Order details in adifferent table every time.
    Typically when i was using java.. i used to populate the details into the Order VO as an ArrayList of Order Items. w could delete just one detail/ as well as a complete Order all together.
    Please suggest.

  • Programmatically populate ADF BC view object based on user's JAZN roles

    I currently have a ADF BC read-only view object that is based on an sql query.
    I would like to assign values to the bind variables based upon the user's JAZN
    roles. My problem is that I am uncertain how to obtain the roles the user has.
    Any help would be appreciated.
    Thanks,
    Kenrick

    I do believe this topic is discussed in detail in the 4GL Developer's Guide. Section 30.8 describes everything how to obtain user info programatically. Aside from pointing you in a direction that will get you where you need to be, I can't be of much help. I'll be crossing that hurdle in the coming months.
    Download the guide from this page:
    http://www.oracle.com/technology/documentation/jdev/b25947_01/index.html. I printed and bound it and use it as my bible.
    Good Luck,
    Jeff

  • ADF - Multple View Objects in one ADF table - Jdeveloper 11g

    Hi,
    I'm using Jdeveloper 11g, is there a way to use multiple view objects in one ADF table? And if so, do you have an example?
    In my case the view objects are not based on a database table they were created based on an ESB wsdl, one is for person and one is for address.
    Any information or pointers you could provide would be appreciated.
    Thanks!

    Hi,
    That would be a good solution, however, I'm supposed to see if there is a way to use the VOs that were created for person and address. Even better if the solution requires little coding.
    Is it possible to combine these two VOs into a single VO to use with an ADF table or to use both of them in a single table? Or is there some other solution that would enable me to use the person and address VOs in a similar manner?
    Thanks!

  • Performance Issues due to Loading of ADF/JClient View Objects

    Hi,
    I developed a two-tier ADF/JClient application.
    When the ADF/JClient application opens for the first time, there's a big delay
    However opening it subsequently, takes less than half of the time to open the screen.
    I think it might the xml files of different view objects which the framework loads for the first time, and thus takes a lot of time. And after that, the time to open the application reduces.
    We have around 200 view objects in our application. Can this be the reason?
    If yes, then can we load the view objects before ahead, or can we just load them at the very time they are requested ?
    Thanks,
    Makrand Pare

    Hi Makrand,
    Check this out:
    "Limiting Fetching of Business Components Attributes in ADF Swing
    http://www.oracle.com/webapps/online-help/jdeveloper/10.1.3/state/content/navId.4/navSetId._/vtTopicFile.developing_jclient_applications%7Cjui_plimitingfetching%7Ehtml/
    Note: In local mode deployment (the client and Business Components reside in the same VM), the fetching of attribute properties is not supported.
    You can optimize startup time for a Business Components client application and the remotely deployed Business Components by specifying the list of view object attributes that your client uses. If you create a project without the metadata, by coding to the API, you will want to add fetchAttributeProperties() to the bootstrap code of the client forms with a list of only the attributes used by the form. Without this method call, your client form would fetch all control hint properties (including the attributes format and label for example) for all the attributes of the named view objects in the application module, in a single network roundtrip.
    For example, when you do not intend to use all the attributes of the ADF Swing form's bound view object, with the fetchAttributeProperties() method, your ADF Swing form fetches only the information required to layout your forms, while ignoring the attributes you do not require.
    Note: In local mode deployment (the client and Business Components reside in the same VM), the fetching of attribute pro
    Calling fetchAttributeProperties() will prevent property methods such as getFormat() or getLabel() from being called on the Business Components attribute definition whenever the form is created."
    Vlad

  • Mutilple Filter Objects - Changing where clause and or

    Is it possible to have a query as below using filter commands.
    (obj1 = 'value11' and obj2 = 'value21')
    or
    (obj1 = 'value12' and obj2 = 'value22')
    or
    The objective is to manipulate the where clause and , or .
    Thanks in Advance
    Bhanu Mohanty

    Hi Bhanu,
    to reach what you want it's necessary to build a virtual characteristic.
    The new characteristic will be populated via coding during runtime of your query. Another possibility (as mentioned before in this forum by Siegfried Szameitat) is to create a new characteristic in your cube that contains field1 and field2 concatenated. With the first scenario, you don’t need a reloading of your cube, with second one this is necessary.
    Hope this helps.
    Bye,
    Roberto

  • ADF BC View object with invalid character in column names

    Hello
    I Have a table with columns containing # character , for example ORDER# , When i create the read only view object j developer automatically renames this to order, but when i try to sort on that column or try search (filter) i get error that column order is not found
    what i can change to resolve this
    Thanks for your time
    Srinivas

    Thanks frank i will do that , as a work around , the error is resolved by changing the query from select order# , other fields to select order# as ordernumber etc
    Thanks
    Srinivas

  • ADF : Merging View Objects in JDeveloper

    There is a view object called ProjectVO, under this view object I have ProjectApplicationVO(Hierarchy In Data Controls). So using PPR Ican get project Applications related to each project.
    But there is a another viewObject ApplicationVO which has ApplicationDocumentVO (Hierarchy In Data Controls)in it.So I can get documents related to each Applications using PPR easily.
    Now I have a new requirement..... Which is ,
    If I click on a project from ProjectVO, I should get ProjectApplications related to that project which I can do using hierarchy present in Data Controls. But after this if user clicks on any application from ProjectApplicationsVO, I need to display documents related to that Project Application.
    Could anyone please let me know how to implement it?
    Existing ViewObjects:
    ProjectVO---->ProjectApplicationsVO
    DocumentVO---->ApplicationDocumentVO
    Requirement:
    Project----> ProjectApplications----->Application Documents

    Hi,
    I have created the View Link but I am not able to add this view link as a 3rd hierarchical in AM...
    Can you please tell me how to add this View Link as a third hierarchy in the Application Module?
    Edited by: 977652 on Jan 9, 2013 4:39 AM

  • ADF Struts UIX - how write where clause whith date in ViewObject

    Hello
    I need to write a search form with two date fields and then query a where clause between to_date('date 1') and to_date('date 2').
    the query may be writed in ViewCriteria class or using Application module method like this
    AssureViewImpl assureView=getAssureView1();
    assureView.applyViewCriteria(null);
    assureView.setWhereClause("NUM_ASSU = :1");
    assureView.setWhereClauseParam(0,numAss);
    thanks a lot for your help

    Does the user always specify both start and end dates?

  • ADF - Accessing view object from a button in a window

    Hi
    I am using Jdeveloper 10.1.3.2.0 to build a Swing/ADF application.
    I added a method to a view class to call a database procedure.
    I use that view as a base of a jTable to display data in a window.
    Now I need to call the method that I created in the view class from a button on the same window where I display the data, ideally using the same db connection.
    I am quite new to ADF and I have no idea how to get a reference to the view instance in the button method to call my new method. How can I do that? Is there another way to achieve this?
    Thanks!
    Luis

    You usually do this by creating the method at the application module level and then exposing it as a client method. You can then drag and drop it onto your form as a button.
    See details in the ADF Developer Guide chapters 8.3-8.5:
    http://download.oracle.com/docs/html/B25947_01/bcservices003.htm#sm0206

  • View Variable for WHERE clause "ORA-06550, INTO clause expected"

    Hi Guys,
    two questions
    1. can a view have variables like:
    create view myview
    As
    myname varchar(5) = bob
    select * from mytable where name = myname
    2. if so, why does a simple select above cause
    the error "ORA-06550, INTO clause expected" ?

    Hi,
    no so direct is not possible. There are workarounds, see this thread on Asktom: [url http://asktom.oracle.com/pls/asktom/f?p=100:11:0::::P11_QUESTION_ID:1448404423206]Parameterized view
    Herald ten Dam
    http://htendam.wordpress.com

  • How to select value from database view with * in wher clause

    Hi ,
      I ahve a database view with some fields.
    Now my requirement is to serach a single row on the basis of process type.
    Process type can have values like ZBA,ZBC,ZBD,ZBE or similarly anything starting with ZB.
    Now i know that starting two letters will be ZB , but dont knwo the last letter.
    So how should i use select query for the same?
    Should i use like operator for the same?
    regards
    PG

    hi,
    u can use character '%'.sample code like this
    SELECT reltype
                 instid_a
                 catid_a
                 instid_b
                 FROM /dbm/ord_docflow
                 INTO TABLE it_link
                 FOR ALL ENTRIES IN it_pnwtyh
                 WHERE  instid_a  =  it_pnwtyh-instid_a AND
                 instid_b  LIKE 'QMSM%'  AND
                 typeid_a  = 'BUS2400'  AND
                 typeid_b  = 'BUS2400' AND
                 catid_a   = 'BO' AND
                 catid_b   = 'BO' AND
                 reltype   = 'VONA'.
    this is similar to using* while we fetch values from table.in the above code only i no QMSM rest values not sure,so used QMSM%

Maybe you are looking for