Questions on ADF View Objects, Links and Iterators

I have a number of questions regarding using ViewObjects in applications where there are alot of relationships between tables.
First, lets say that I have ViewObject SomeView that was added to the App Module (AM) as VO1. And because it has a number of "detail" records that have to be iterated through in a "report like" view it has those other VO's added under it as "children" in the AM.
So I have
VO1 (an instance of SomeView)
--> VO2 (an instance of some other view)
--> VO3 (an instance of some other view)
that is used on pages where only a single VO1 is shown at a time.
Now because I had another page I wanted to make that had a listing of all SomeView objects. Some of the fields in SomeView are foreign keys to records in VO2 and VO3 and while I don't want to show all the fields from VO2 and VO3, I do want to show a name field from each rather than just the foreign key.
My experience (though I've never read this anywhere) tells me that when doing a "table" that is a list of rows from a VO, you can't display info from the child VO's because the child VO's are on whatever record corresponds to the "currentRow" in the parent VO and just displaying the rows in a rangeSet doesn't make each the "currentRow" so even we display 10 records in a for loop, the "currentRow" is just one, and the child VO's iterators aren't moved as we go through the for loop. (Can someone confirm if I am correct on this conclusion????)
So the only way I know of to show some field from a related table in each row is to make the VO have the entity objects from the related tables be part of the view as references. Is this the only way?
If I do that on a view that didn't have other views as children defined in the AM I don't have any problem and it works like I want.
But if I do it on a view that did have other views as children defined in the AM it makes the page(s) using that view with the children iterators behave badly. Half the information quits showing up, etc.
For example, ... if I go to the "SomeView" which was defined with only one entity object association, and I add the entity objects (that are the basis of instances of VO2 and VO3 ) as referenceable only, it totally breaks the page where I display a single VO1 and use it's VO2 and VO3 children. IS THIS NORMAL OR AM I MISSING SOMETHING?
So, is the solution that I have to have more view objects defined for different purposes ?
Can anyone give any general guidelines for when/where to use different view objects vs. when to use different iterators. I'm not having much luck with using secondary RSI's and haven't found much info on them.
Also, how about issues of naming iterators that are in various binding containers (ie. UI Model for a page). If I do and LOV it creates an iterator and gives it a default name like ViewNameIterator1. If I already have a different page that uses a regular (non LOV) iterator with that name, and the user goes back and forth between those pages, is that a clash?
Finally, I've read a couple of Steve Muench's blogs on View Link consistency but I'm not sure what the rules are on when it applies and doesn't. How you turn it on or off, etc. One of his examples in http://radio.weblogs.com/0118231/2004/02/27.html talks about it in the context of two view objects that are NOT typically "linked" in a master/detail kind of way. Like an AllDepartments and a DepartmentsLessThan view. Do you have to create a View Link between them to have results of one be reflected in the other if they aren't used in the same page in a web app? Or does it happen automatically (with the caveat that you have to do the rowQualifies method). Just feels like I'm missing some pieces.
Thanks in advance,
Lynn

Hi,
I am also interested in a best-practice note from oracle.
Currently we store history in seperate history tables for columns that changed. All this implemented in our BaseEoImpl overriding the EntityImpl.prepareForDML().
Thanks

Similar Messages

  • ADF panel does not prompt for variable defined in ADF view object.

    I have created an ADF Panel, which allows the user to run a few simple queries against an Oracle database done using ADF view objects and ADF view links and ADF application module.
    One of these queries lookup detail information about a given database object (Table, view or whatever) from dba_objects. The SQL uses a parameter (:P_OBJ_NAME) that has a default value of “Departments”. If I run the ADF application module by itself outside of the ADF panel, all works fine, it prompts me to provide a value for the parameter :P_OBJ_NAME.
    As I said the panel contains the different ADF view links including the one that should prompt the user to provide a value for :P_OBJ_NAME. When I run the panel it does not prompt me for :P_OBJ_NAME, it just uses the default defined value “departments”.
    I hope I described my problem for every one to understand. The question obviously is how do I get the ADF panel to prompt the user to provide a value for parameter :P_OBJ_NAME, my expectation was that since the sql in the view object and the application module both are designed to prompt for a value for this parameter then the panel should do just that but it does not.
    You expert input would be most appreciated.
    Thanks.
    Bobby A.
    Edited by: Babak Akbari on Aug 13, 2009 8:34 AM
    Edited by: Babak Akbari on Aug 13, 2009 11:12 AM

    The prompting for a parameter is a feature we built into the ADF Tester - it is not a default behavior you get in your application when you just place a VO on your page.
    To get something like this expend the operations node under the VO in the data control palette, and drag the "Execute with parameters" operation to your page to drop it as a parameter form.
    This will provide your user a place to fill out the parameter and press a button to execute the query.

  • Validation at View Object level and not Enity Object

    How would you create validation logic at the view object level and not at the entity object level? I have many VOs that reference the same EO and want some validation logic to be applied only to certain VOs.
    Thanks,
    Quoc

    My use case for this is to perform form validation inputted by the user via a JSPX page.

  • ADF View Object Capability

    Usually I use ADF View Object when I want to view data from table in Oracle DB.
    Now can View Object extract data from file? xml or csv format?
    Regards
    Erich

    Hi,
    no, ViewObjects work with queries against the database.
    Frank

  • View Objects , whereclauseparam and PERFORMANCE in JSP

    We experience that using the method setWhereClauseParam gives VERY BAD performance in our JSP applications.
    According to JDev team and others, "best practice" is to use setWhereClauseParam(s), so we wonder why the performance degrade significantly compared to a simpler approach (=define the whereclause when the datasource is created). To avoid the shared pool to grow we were tempted to use the recommended best-practice-parameter-binding approach, but due to performance we had to drop that idea.
    Our JSP (pseudo) code look like this:
    <jbo:ApplicationModule id="am" .......
    <jbo:DataSource id="ds" appid="am" viewobject="ourView" rangesize="0"/>
    <%
    ViewObject ourVo= ds.getApplicationModule().FindViewObject("ourView");
    ourVo.setWhereClauseParam(0, 'xxx');
    ourVo.setWhereClauseParam(1, 'yyy');
    %>
    <jbo:RowsetIterate datasource="ds" >
    bla bla bla ..
    </jbo:RowsetIterate>
    THIS IS SLOW !! ..... compared to:
    <jbo:ApplicationModule id="am" .......
    <% String clause = "Col1 = 'xxx' and Col2 = 'yyy' %>
    <jbo:DataSource id="ds" appid="am" whereclause='<%= clause %>' viewobject="LabelHeadersView" rangesize="0"/>
    <jbo:RowsetIterate datasource="ds" >
    bla bla bla ..
    </jbo:RowsetIterate>
    We get the same results but the last method is times 100 faster ??
    Any ideas are appreciated .
    Thanks, Jens

    OK. I believe I now know what the culprit it. It is your use of the where clause fragment:
    (pdk_files_id = ? OR ? IS NULL)
    Here's how I arrived at this (while at the same time ruling BC4J out of the picture as a potential cause of the problem).
    I following the steps below:
    [list]
    [*]Connected as SCOTT in SQLPlus, I create the table:
    CREATE TABLE files( pdk_files_id NUMBER PRIMARY KEY, name VARCHAR2(20));
    [*]I insert one row into the new files table:
    INSERT INTO files values (1111, 'SteveTest');
    COMMIT;
    [*]I connect as SYSTEM, an run the script ORACLE_HOME/sqlplus/admin/plustrce.sql to create the SQL*Plus PLUSTRACE role so that SCOTT will be able to use the SQLPlus AutoTrace feature
    [*]As SYSTEM still, I ran the command: GRANT PLUSTRACE TO SCOTT
    This gives SCOTT the privilege to use the SQL*Plus autotrace command
    [*]I connect as SCOTT, and run the script ORACLE_HOME/rdbms/admin/utlxplan.sql
    this created the plan table in my SCOTT schema needed to run the autotrace feature
    [*]In SQLPLUS, still connected as SCOTT I issue the command:
    SET AUTOTRACE ON EXPLAIN
    [*]Then I do the following to create a SQL*Plus bind variable
    VAR v VARCHAR2(20)
    [*]And then do the following to set its value at the SQL*Plus command prompt:
    EXEC :v := '1111';
    [list]
    Finally, I try some different queries and look at the autotrace output:
    SQL> select * from files where pdk_files_id = 1111
      2  /
    PDK_FILES_ID NAME
            1111 SteveTest
    Execution Plan
       0      SELECT STATEMENT Optimizer=CHOOSE
       1    0   TABLE ACCESS (BY INDEX ROWID) OF 'FILES'
       2    1     INDEX (UNIQUE SCAN) OF 'SYS_C003006' (UNIQUE).
    This shows that using the literal value 1111 uses the index.
    SQL> select * from files where (pdk_files_id = 1111 or 1111 is null)
      2  /
    PDK_FILES_ID NAME
            1111 SteveTest
    Execution Plan
       0      SELECT STATEMENT Optimizer=CHOOSE
       1    0   TABLE ACCESS (BY INDEX ROWID) OF 'FILES'
       2    1     INDEX (UNIQUE SCAN) OF 'SYS_C003006' (UNIQUE).
    This shows that using the literal values together with the OR clause, still uses the index.
    SQL> select * from files where (pdk_files_id = :v)
      2  /
    PDK_FILES_ID NAME
            1111 SteveTest
    Execution Plan
       0      SELECT STATEMENT Optimizer=CHOOSE
       1    0   TABLE ACCESS (BY INDEX ROWID) OF 'FILES'
       2    1     INDEX (UNIQUE SCAN) OF 'SYS_C003006' (UNIQUE).
    Using my ":v" bind variable I defined, it uses the index, too, even though the type of the bind variable is VARCHAR2 and the type of the PDK_FILES_ID column is NUMBER. This is because this is a simple enough case for the database to do automatic type coersion to convert my string value '1111' for the bind variable into the number value 1111 and then use that for the index lookup.
    HOWEVER, when I try the case that simulates what you are doing in BC4J, which is using a bind variable together with the OR clause for the NULL test, we see...
    SQL> select * from files where (pdk_files_id = :v OR :v IS NULL)
      2  /
    PDK_FILES_ID NAME
            1111 SteveTest
    Execution Plan
       0      SELECT STATEMENT Optimizer=CHOOSE
       1    0   TABLE ACCESS (FULL) OF 'FILES'.
    So in this case, the database DOES NOT use the index, and hence explains why your query is slow.
    I believe the database works this way because when it hard-parses the SQL statement, it is at this time that it determines the query plan for the SQL statement. The plan needs to remain stable since the same plan will be cached and reused for all uses of the same parsed SQL statement, so the plan cannot be conditional based on the values of the bind variables. Since it cannot decide without knowing the value of the bind variable, it apparently disqualifies your index from being used.
    Even introducing an optimizer hint only improves the problem a little. I tried this example:
    SQL> select /*+INDEX (files sys_c003006)*/ *
      2  from files where (pdk_files_id = :v or :v IS NULL)
      3  /
    PDK_FILES_ID NAME
            1111 SteveTest
    Execution Plan
       0      SELECT STATEMENT Optimizer=CHOOSE (Cost=826 Card=5 Bytes=125)
       1    0   TABLE ACCESS (BY INDEX ROWID) OF 'FILES' (Cost=826 Card=5 Bytes=125)
       2    1     INDEX (FULL SCAN) OF 'SYS_C003006' (UNIQUE) (Cost=26 Card=82).
    In this case it still has to fully scan the index where above it was able to do a unique scan.
    MORAL OF THE STORY:The tiny cost of having two different View Objects in your application, one to use when you want to find by PDK_FILES_ID, and one to use when you want to find by your other key criteria, is well worth the performance improvement that can be had by using bind variables and using them in a way that the database will use the index.
    As Tom Kyte says in his excellent book Expert One on One: Oracle in a passage that made me laugh:
    "If I were going to write a book about building Oracle applications that do not scale, "Don't Use Bind Variables" would be the first and last chapter." :-)
    So, by using a few design-time-created view objects that uses bind variables and avoid the use of the (COL = ? OR ? IS NULL) construct, you get the following benefits:
    [list]
    [*]The database doesn't have to hard-parse your SQL statement each time you execute it (which it does if you keep sending queries that have literal values in the SQL statement, making each query different as far as the SGA is concerned)
    [*]The indexes will get used correctly as we saw above
    [*]Your code actually might be clearer, since you can name one of your view objects "FindFileById" and the other one "FindFileByName", or what have you
    [list]
    Hope this helps.

  • Excel 2013 "cannot use object linking and embedding error"

    Hi
    We are using excel export as pdf functionality and have the following DCOM configuration
    1.start->run and type 'DCOMCNFG'
    2: Open 'DCOM Config' and locate 'Microsoft Excel Application'
    3: Set its identity to 'This User' and give specific service user
    On opening excel  we are getting  "cannot use object linking and embedding error" and the microsoft sugestions tells to change to launching user which is not an option for us,Is there any other suggestion to fix this issue by keeping Dcom
    configuration with'This User'
    Thanks in advance
    Pradeep

    Hi
    when excel is opened, a warning pops up saying "Cannot use object linking and embedding" . This
    fix change the DCOM ID to Launching User) does not work for us. We need the Excel DCOM ID to use a particular user "domain\user" in order to access excel from our website.
    Is there any other suggestions
    Thanks in advance
    Pradeep

  • ADF View objects question

    Hello,
    I created a view object (which bases on an entity object) that I'd like to use for searching for records in a table called "CARS". Cars will be searched by names. I also have a JSP page for adding cars (administration functionality).
    The situation is as follows:
    1. I go to the page for adding cars and click "Submit" (which only submits data without committing to the database).
    2. Then I have validation errors (which is ok because some fields are mandatory).
    3. I search for cars by name.
    The funny part is that if I search for cars with given names, I get those cars AND I get the empty row with this new car I'd tried to add just a moment ago. It's definitely not yet in the database and the name of this car is not set (so it shouldn't match with the name I'm searching for).
    My question is: why is it happening and what should I do to get the rows created but not yet committed not appear in the search results?
    I tried to use clearCache() method of ViewObjectImpl but the result is still the same.
    Please help because I desperately need this for my diploma project.
    Thanks,
    Anna

    I run: "java -Djbo.viewlink.consistent=false -jar oc4j.jar" and I still get new rows. I'm using OC4J 10g (9.0.4.0.0) standalone that comes with JDeveloper 10g (9.0.5.2) on Linux.
    And about that Create pages: I mean I click on a link "New something" 3 times (for example). I don't use the browser back button because I have my menu on each page. In this case I'm just curious if it's possible to somehow "overwrite" previous "new" rows with the most recent one.
    I thought I would need that but now I know I need something else.
    Imagine such a situation:
    1. A user wants to create a new row or update an existing one.
    2. They start filling the form and submit it (in my case it's committing at the same time)
    3. During validation it turns out that some required values are missing so the user has to enter them.
    4. At this point the user leaves the input form and decides to add or update a different row.
    5. The user enters all the required values and this time validation would succeed. However, because of points 2. and 3. it does not.
    Now my question is: how can I make ADF somehow "forget" about the row inserted/updated in point 2. I know that ADF validates all new/changed rows at a time. But I would like to change that behavior so that it would validate only the row changed/created most recently.
    Thanks,
    Anna

  • Adding New View Objects/Link on "Preview and Print" - Order Acknowledgement

    Hi,
    Can we add New View Objects/View Links for the existing "Preview and Print" Order Acknowledgement.
    I want to add for the 2 new functionalities i.e., for Charges (from OE_PRICE_ADJUSTMENTS_V ) and the Line Level Notes, which is currently not supported by Oracle.
    Can anyone help me on acheving this functionality?
    Looking forward for your response.
    Thanks in advance,
    Regards,
    Muru

    You can do that. You should first create the new business objects(AM, VO, VL) in jdeveloper, create your new regions in jdeveloper, associate the AM to the top level region(stackLayout) you create. Use personalization and add a stack layout in the Preview and Print page, set the extends property to point to the new region which you had created. Donot forget to deploy all the files in middle tier before doing the personalization.
    The AM which you had added to the stackLayout will automatically be nested with the root AM of the page during runtime.

  • DOC BUG: 9.0.3.1 View Object Wizard and a Question

    First the question: What is the Passivate property for in the View Object Wizard's Attribute Settings page?
    Related Doc Bugs 9.0.3.1
    Topic: Define New View Attribute Dialog
    (click Help button in New Attribute dialog when creating a view object attribute)
    Problems: The description for the "Attribute" property is "foo"; Descrimator, Updateable, and Queriable have single letter descriptions. Key Attribute and Passivate are not listed.
    Topic: View Object Wizard - Attribute Settings Page
    (click Help button in Attribute Settings page in View Object Wizard)
    Problems: Query Column Type and Passivate are not listed. Attribute Settings column lists properties in a strange order (not a bug).
    Peter Koletzke

    Peter,
    I've logged doc bug 2814172: BC4J GLOSSARY SHOULD HAVE ENTRIES FOR PASSIVATE AND ACTIVATE.
    For more information, you could read the "About Application Module Pooling" topic in the online documentation. Passivation is what happens when the application module's state is saved to the database - and activation happens when an application module instance retrieves passivated state from the database.
    Thanks
    Blaise

  • Dynamic View Object Creation and Scope Question

    I'm trying to come up with a way to load up an SQL statement into a view object, execute it, process the results, then keep looping, populating the view object with a new statement, etc. I also need to handle any bad SQL statement and just keep going. I'm running into a problem that is split between the way java scopes objects and the available methods of a view object. Here's some psuedo code:
    while (more queries)
    ViewObject myView = am.createViewObjectFromQueryStmt("myView",query); //fails if previous query was bad
    myView.executeQuery();
    Row myRow = myView.first();
    int rc = myView.getRowCount();
    int x = 1;
    myView.first();
    outStr = "";
    int cc = 0;
    while (x <= rc) //get query output
    Object[] result = myRow.getAttributeValues();
    while (cc < result.length)
    outStr = outStr+result[cc].toString();
    cc = cc+1;
    x = x+1;
    myView.remove();
    catch (Exception sql)
    sql.printStackTrace(); myView.remove(); //won't compile, out of scope
    finally
    myView.remove(); //won't compile, out of scope
    //do something with query output
    Basically, if the queries are all perfect, everything works fine, but if a query fails, I can't execute a myView.remove in an exception handler. Nor can I clean it up in a finally block. The only other way I can think of to handle this would be to re-use the same view object and just change the SQL being passed to it, but there's no methods to set the SQL directly on the view object, only at creation time as a method call from the application module.
    Can anyone offer any suggestions as to how to deal with this?

    I figured this out. You can pass a null name to the createViewObjectFromQueryStmt method, which apparently creates a unqiue name for you. I got around my variable scoping issue by re-thinking my loop logic.

  • Link and iterators

    Hi,
    im working with adf faces and adf bc.
    I've a question.
    I've created tree entities (and view) in link so i have parent son and grandson.
    I want to create a table list from grandson and point to the page that manage that record.
    I've the problem that when i retrieve data from that table i see just some record filtered by first father. Is there a way to solve this problem ?
    Is there a way to create a new view object with the table of grandson and after retrieved data (with this iterator) point to that famous page (that have the same primary key but is different iterator).
    I hope someone help me.
    Thanks in advance
    mickgiu

    I've the problem that when i retrieve data from that
    table i see just some record filtered by first
    father. Is there a way to solve this problem ? It seems that your table is based on ViewObject instance filtered by a ViewLink. Get a look at the ApplcationModule's Data Model to see if the GrandsonViewObject is listed as a child of the SonViewbject ( GrandsonViewObject via SomeViewLink1 ). If so, you'll need to create another GrandsonViewObject instance, but this time a top level one so it does not gets filtered.

  • ADF - View Objects

    Hi All,
    We are working on building a web application using on ADF.
    The landing page of our application is a dashboard screen that is read-only with 100 to 500 records displayed in a table.
    User can move to other pages and create requests.
    1) When user is on dashboard and moves to other pages of the application, is there a way to release the memory used by view objects and underlying entity objects used by the views used to display the dashboard? Another point here is, our application requirement is to refresh the data from database when user moves between screens. Even if user switches back to dashboard screen after moving to other screen the data needs to be queried anyway. So for better memory management of the application we would like to release the memory for GC when user leaves our dashboard screens.
    Another question I have is:
    2) When a application module passivation occurs, will there be a snapshot taken for all view rows and entity caches or will it be only for pending DB state - entities added/modified/deleted? - We have lot of cases in our application where we display read-only dashboards and I am trying to understand if we can turnoff the passivation on view objects used to display read-only data if passivation deals with only pending DB state.
    Please suggest.

    Hi,
    1) When user is on dashboard and moves to other pages of the application, is there a way to release the memory used by view objects and underlying entity objects used by the views used to display the dashboard? Another point here is, our application requirement is to refresh the data from database when user moves between screens. Even if user switches back to dashboard screen after moving to other screen the data needs to be queried anyway. So for better memory management of the application we would like to release the memory for GC when user leaves our dashboard screens.
    Note that premature optimization can be contra-productive and often is the root of all evil. In other words, as long as you don't experience performance problems, I would let the framework do its job - so be careful wanting too much without a reason. Anyway, to clear the entity cache (and this is the only memory you need to bother for) you can call  <ApplicationModuleInstance>.getTransaction().clearEntityCache(String entityName);
    clearEntityCache
    public void clearEntityCache(java.lang.String entityName)
    Clears the cache of the specified Entity Object. A value of null clears the caches of all Entities. If a View Object uses the Entity Object, the View Object's cache will be cleared as well.
    Parameters:
    entityName - the name of the entity whose cache is to be cleared. If null, caches for all entities are cleared.
    Another question I have is:
    2) When a application module passivation occurs, will there be a snapshot taken for all view rows and entity caches or will it be only for pending DB state - entities added/modified/deleted? - We have lot of cases in our application where we display read-only dashboards and I am trying to understand if we can turnoff the passivation on view objects used to display read-only data if passivation deals with only pending DB state.
    Passivation is for pending changes only and not for all queried data. You define passivation on the AM level and you can switch it off there. In this case I suggest you use an Application Module that speacifically holds the dashboard queries.
    Since performance is your concern I recommend you reading:
    Advanced View Object Techniques - 11g Release 1 (11.1.1.7.0)
    Tuning Application Module Pools and Connection Pools - 11g Release 1 (11.1.1.7.0)
    Frank

  • ADF View Object filtering

    Hi, This question is related to ADF table filters.
    Let us take an example of a View Object that is being dropped in a jspx page as a "ADF Table" with filters.
    Whenever user applies a filter on a column, will the data for view object be queried from database once again?
    Is there a way to avoid the query re-execution on applying filters in table.

    Thanks for the replies. Jdeveloper version we use is 11.1.1.6.
    I have a follow up question.
    We have a programmatic View Object which gets data from 3 different rows and populate them in view rows (We have overridden standard methods like executeQueryForCollection..etc)
    The data is displayed in a ADF table.
    Now when the user filters data, normally filter works fine but the web service calls are made every time the filters are applied/removed.
    We would like to avoid making calls to web services when user filters data by setting Query Mode to "QUERY_MODE_SCAN_VIEW_ROWS".
    But what happens is first time filter is applied, the filtered rows are displayed properly but from there on the query collection refers to filtered data only and not the complete data set.
    So when the user removes filter and hits enter again only filtered rows are displayed and not all the rows fetched initially. I am not sure why the query collection looses all the rows and keeps only filtered rows??

  • ADF View object validation. Cannot have same column value multiple time.

    Hi Expert,
    I have a ADF viewobject validation question. I have the Department and employee view objects. Each department have multiple employees. (may be u can also assume. the employee name is an VO attribute not the database field)
    I need to implement the following validation rule
    One department shouldn't have same employee name. How can i implement this validation rule in the ADF-BC.
    Looking forward ur expert suggestions. Thanks
    -t

    Assuming that the employee name (which you have said is a transient attribute) is created by concatenating some other fields, you could, I suppose create a unique index in the DB or a unique validator in the EO to ensure that the department ID (assume you have such an attribute) and the fields that make up the name are unique. It seems kind of unusual to be validating a transient field like this.
    John

  • How do I obtain the next number for a Primary Key using an ADF View Object?

    I have two separate View Objects (A & B) for the same Entity Object. View Object A does a SELECT on all of the fields in the table. This View Object is where I execute my adds and updates. View Object B is only used to retrieve the next number for the primary key. This is done so that when I add a row to the database, I always get the max number of the primary key and add one to it. I accomplished this by setting the SQL mode to Expert and using the SQL: "SELECT MAX(NBR) AS MAX_NUMBER FROM TABLE_1". This may be overkill having a seperate View Object for this, but so far this is the only way I have found to obtain the next number. However, I have discovered that this way does not always work.
    The problem I'm running into is when I try to add multiple records to View Object A without committing the transaction between each add. Because View Object B is disconnected from View Object A, the MAX_NUMBER of View Object B comes back with the same number for each add I do on View Object A. So I know I must retrieve the MAX_NUMBER from View Object A.
    I've tried using the following code in my Table1ViewImpl class:
    this.setQuery("SELECT MAX(Table1.NBR) AS MAX_NUMBER FROM TABLE_1 Table1");
    this.executeQuery();
    The view object now has what I want, but I have yet to figure a way to extract the MAX_NUMBER out of the View Object. I've also looked into using the method addDynamicAttribute() but I can't figure out any way to set the attribute with the MAX_NUMBER.
    I can't be the only one trying to retrieve the next number from a database table using ADF. Can anyone help me with this? FYI - I'm using JDev 10.1.3 EA.

    You missing the point.
    On a multi-user db knowing the next highest number doesn't guarantee the number will be available when it comes time to commit the record. You can prove this to yourself by opening two instances of your app and do whatever you do to add a new record to your VO. Both will assume the same number, and when you commit an error will be generated
    You must use sequences to avoid the possibility of duplicate keys. If you are trying to avoid gaps in your numbering then you need to convince yourself why this is necessary.

Maybe you are looking for

  • Creation of Source system in BI Server

    Hi, I want to Send Export DS from source BI server to target BI server. So I need to create one Source system in Target BI server. Can anybody tell me the procedure for creating this? Thanks in advance. Rgds Biswarup

  • Setting Third-Party Saxon parser for parsing xml files

    Hi,           I wish to parse certain xhtml files using saxon parser because that serves our needs. In order to that in tomcat, I used to use the following code -           System.getProperties().setProperty("javax.xml.parsers.SAXParserFactory","com.

  • HT1911 I want to change my security question

    I want to change my security question

  • Best way to transfer single point data between loops on FPGA

    Hi,     I used quite number of loops on FPGA and need to transfer single point datas between loops. Only the current value of data is needed so buffer is not necessary. I don't want use target scope FIFO since it require minimum 21 elements and I onl

  • Xml ,database

    I have a method in stateless session ejb bean which has a one string parameter.The remote client calls this method and pass a xml string which contains data to be inserted in the oracle tables. I need to write code that will accept this string and wi