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

Similar Messages

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

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

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

  • Possible bug when creating multiple detail view objects

    using jdev 11.1.1.0.0 to build jsf/adf applications. I wanted to report what seems like a bug in 11g. I have a parent table which has two child tables. After creating the appropriate entities, associations, views, and view links, the app module looks like this:
    MasterView
    --DetailView1
    --DetailView2
    The two detail view objects are on the same level, they are both direct children of the Master view.
    Here's what's happening:
    1) I create the master entity/view objects (MasterView)
    2) I create one of the detail entity/view objects (DetailView1).
    3) I create the association and view link to establish relationship between MasterView and DetailView1. Everything works fine.
    4) I create the entity/view objects for second detail view (DetailView2)
    5) When I attempt to create a second view link (based off an association) to establish the relationship between MasterView and DetailView2, the query clauses of the Create View Link wizard (screens 4 and 5) do not get created properly. I finish the wizard and save. Not only does this view link not get created properly, but in the process the query clauses that were defined in the first view link between MasterView and DetailView1 are wiped out. This will break any coordination between master and detail views in both the app module tester and runtime. Has anyone seen this problem?

    fyi, it looks like this issue has been resolved with jdev 11.1.1.0.2 (Update 2)

  • BUG: Wrong column name in View Object

    Hello,
    I've had this happen several times to me. I added an Entity Object to a View Object in the VO Wizard. I then went to the "Query" section and hit "Test" to test the SQL code generated by the VO Wizard. The test failed because the wizard had added an equality test (table1.col1 = table2.col2) to the WHERE part which used the wrong table name.
    It is possible to manually fix this by putting the correct table name in the query, but you'd have to do this every time you make a change to the View Object.
    What I did was to rebuild the View Object from scratch, and this time it correctly generated the SQL query. I was able to add some more Entity Objects, but then it happened again. This is really irritating because my View Object is fairly complex and it takes quite some time to remake it.
    I can't give instructions on how to reproduce this because it only happens every so often. It would save a lot of frustration if someone could fix it though.
    Hariolf

    Hi Hariolf,
    I was able to build this scenario and test the query with success. Here is the sql for the view object I created
    from the following entities:
    RootEO one to many association with Entity01
    with Entity02
    with Entity03
    Entity01 one to many association with Entity04
    All objects are included in the view object, here is the resulting generated sql:
    SELECT RootEO.ROOTID,
    RootEO.ATTR,
    Entity01.EO1ID,
    Entity01.ROOTID AS ROOTID1,
    Entity04.EO4ID,
    Entity04.ATTR AS ATTR1,
    Entity02.EO2ID,
    Entity02.ROOTID AS ROOTID2,
    Entity03.EO3ID,
    Entity03.ROOTID AS ROOTID3
    FROM ROOTEO RootEO, EO1 Entity01, ENTITY04 Entity04, ENTITY02 Entity02, ENTITY03 Entity03
    WHERE (((RootEO.ROOTID = Entity01.ROOTID)AND (Entity01.EO1ID = Entity04.ATTR))AND
    (RootEO.ROOTID = Entity02.ROOTID))AND (RootEO.ROOTID = Entity03.ROOTID)
    Let me know if I need to retest using a different scenario. Also, what version of jdeveloper are you using?
    Amy

  • Jdev 11g AD / View Objects - update and populate web service data contro

    Hi Experts....
    Looking for the best approach here.
    I am hoping that someone can provide me some thoughts / guidance around the best way to achieve populating a webservice data control from a view object.
    Basically I have created an application pulling data from source tables using ADF BC VO's. I am going to put a command button 'Update Record', that will open up a dialog with a web service data control.
    I am hoping to be able to populate the data control fields, with values from the selected record VO.
    I am tipping at this stage, I will need to do this programatically?
    Is this the recommended approach?
    Any examples of code?
    Thanks in advance to anyone that can help!
    Simo

    Should be similar to this:
    http://blogs.oracle.com/shay/2011/03/passing_parameters_between_web.html
    But the first page would get the data from the VO instead of Webservice.
    Since you are using PL/SQL API in the database to do the update, it might be more efficient to just have an AM service method that uses the existing JDBC connection/transaction and calls this PL/SQL stored procedures and passes info from the VO.
    See: http://download.oracle.com/docs/cd/E17904_01/web.1111/b31974/bcadvgen.htm#BABEIFAI
    Or taking it even further:
    http://download.oracle.com/docs/cd/E17904_01/web.1111/b31974/bcadveo.htm#sm0328

  • 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

  • CRITICAL: Insert View Objects Batch and Immediate mode

    In order to display the telephone and fax in 3 text inputs instead of one , I added transient attributes to my entity object, and added the corresponding code in the EntityImpl.java
    Scode, Acode and Number
    For each of their set functions, do something like:
    public void setScode(Number value)
    String tel_old = (String)getAttributeInternal(TEL);
    //Then split tel into three parts (probably by '-'...)
    //Update the part you want
    //Mash the parts together again, getting 'tel_new'
    setAttributeInternal(TEL, tel_new);
    setAttributeInternal(SCODE, value);
    I have a code similar to this, when i execute in batch mode it is working fine, But When i execute in "Immediate Mode" It fails. How to rectify this ?
    Should I tranfer the set and get codes to the ViewObjectRowImpl.java file. Currently the ViewRowImpl.java is default , nothing is modified in it.
    Thanks a lot.

    Problem Solved. The order of the GetAttribute and setAttribute was significant in Immediate mode. I am still not sure how the particular order can be changed.
    Areacode attribute was called before Statecode attribute.
    Cheers.

  • How to access View object programmatically and ...

    Hi,
    I have a hypothetical situation. I have for example a VO based on Emp and a data table in the UI with a button.
    When pressing this button I want to call a method that will programmatically read in teh values of the current row and then update a field in the UI (say an outputText).
    My problem is I am not sure where to pu this logic. I thought I shouldI create a new method in the Application module then bind that methid to the button. By having the code in the AM then it can easily access the VO attributes. But how can the method in the AM access the values in my backing bean and set them or read them ?
    I am not sure where to put the code - I could put it in teh backing bean and call teh application module from there but the manual doesn't really recommend that I think.

    This is probably logic that should be in the backing bean in a method that is activated from your button.
    The ADF Developer Guide shows you how to do it here:
    http://download.oracle.com/docs/html/B25947_01/bcservices005.htm#sthref681

  • Object skew and deform question

    Can you skew a pasted object like
    you can warp text? Is it possible to arch or wave a pasted object? If so, how?

    Familiarize yourself with Filter>Distort>Liquify, and,  Image>transform>>>various selections here.
    Perhaps one of these options is applicable to your project.

  • Problem with 2 View Objects based on One Entity -Probably a Bug in ADF BC

    Hi
    I am using JDeveloper 10.1.3(SU5) and adf faces and ADF BC and to explain my problem I use HR schema.
    First, I created 2 view objects based on countries table named as TestView1 and TestView2. I set TestView1 query where clause to region_id=1 and TestView2 query where clause to region_id!=1 in the view object editor and then I created 2 separated form on these 2 view objects by dragging and dropping from data control palette.
    Now when I insert a record in the form based on TestView1 with region_id set to 1 and commit the record and go to the next form I can see the record in the second form which is completely wrong since it is against the where clause statement of the second form.
    I am really confused and the situation is very wired and it seems to me something like bug in adf bc.Am I right.Is there any work around or solution for solving this problem.
    Any help would be highly appreciated.
    Best Regards,
    Navid

    Dear Frank,
    Thank you very much for your quick response.
    Reading your helpful comments now I have some questions:
    1- I have commited the record in the database so shouldn't the query of view objects be re-queried?
    2- We try to use ClearVOCaches (entity_name,false) in afterCommit of the base entity object but unfortunately it does not work correctly. after that,We got root app module and used findViewObject method to find all the view of that entity (we have found them by using name not automaticlly) and called executeQuery of all views. From my point of view it has 2 big disadvantages. First suppose that this entity is an important entity and 4 or 5 viow objects are based on it. Now, For inserting one record we should re-execute 4 or 5 view which I think makes some performance issues. Besides, If during the development one programmer add a new view object based on this entity and don't add the executeQuery in the afterCommit for this view, again we have the same problem. Isn't there at least a way that automatically refresh all related view objects however the performance issue still exists.
    3- You mentioned that this issue is handled in the developer guide. Could you kindly give me a refrence which developer guide you mean and which section I should read to overcome this problem.(I have ADF Developer's Guide for Forms/4GL Developer's Guide , however I search for clearVOCaches and surprisingly nothing was found!!!)
    4- Could you please give me some hints that from your point of view what is the best method to solve this problem with minimum performance effect.
    Any comment would be of some great help.
    Thanks in advance,
    Navid

  • Issues in persisting dynamic entity and view objects using MDS

    Hi All,
    I'm trying to create dynamic entity and view objects per user session and to persist these objects throughout the session, I'm trying to use MDS configurations(either file or Database) in adf-config.xml.
    I'm facing following two errors while trying to run the app module:
    1. MDS error (MetadataNotFoundException): MDS-00013: no metadata found for metadata object "/model/DynamicEntityGenModuleOperations.xml"
    2. oracle.mds.exception.ReadOnlyStoreException: MDS-01273: The operation on the resource /sessiondef/dynamic/DynamicDeptEntityDef.xml failed because source metadata store mapped to the namespace / DEFAULT is read only.
    I've gone through the following links which talks about the cause of the issue, but still can't figure out the issue in the code or the config file. Please help if, someone has faced a similar issue.
    [http://docs.oracle.com/cd/E28271_01/doc.1111/e25450/mds_trouble.htm#BABIAGBG |http://docs.oracle.com/cd/E28271_01/doc.1111/e25450/mds_trouble.htm#BABIAGBG ]
    [http://docs.oracle.com/cd/E16162_01/core.1112/e22506/chapter_mds_messages.htm|http://docs.oracle.com/cd/E16162_01/core.1112/e22506/chapter_mds_messages.htm]
    Attached is the code for dynamic entity/view object generation and corresponding adf-config.xml used.
    ///////////App Module Implementation Class/////////////////////////
    public class DynamicEntityGenModuleImpl extends ApplicationModuleImpl implements DynamicEntityGenModule {
    private static final String DYNAMIC_DETP_VO_INSTANCE = "DynamicDeptVO";
    * This is the default constructor (do not remove).
    public DynamicEntityGenModuleImpl() {
    public ViewObjectImpl getDepartmentsView1() {
    return (ViewObjectImpl) findViewObject("DynamicDeptVO");
    public void buildDynamicDeptComp() {
    ViewObject internalDynamicVO = findViewObject(DYNAMIC_DETP_VO_INSTANCE);
    if (internalDynamicVO != null) {
    System.out.println("OK VO exists, return Defn- " + internalDynamicVO.getDefFullName());
    return;
    EntityDefImpl deptEntDef = buildDeptEntitySessionDef();
    ViewDefImpl viewDef = buildDeptViewSessionDef(deptEntDef);
    addViewToPdefApplicationModule(viewDef);
    private EntityDefImpl buildDeptEntitySessionDef() {
    try {
    EntityDefImpl entDef = new EntityDefImpl(oracle.jbo.server.EntityDefImpl.DEF_SCOPE_SESSION, "DynamicDeptEntityDef");
    entDef.setFullName(entDef.getBasePackage() + ".dynamic." + entDef.getName());
    entDef.setName(entDef.getName());
    System.out.println("Application Module Path name: " + getDefFullName());
    System.out.println("EntDef :" + entDef.getFileName() + " : " + entDef.getBasePackage() + ".dynamic." + entDef.getName());
    entDef.setAliasName(entDef.getName());
    entDef.setSource("DEPT");
    entDef.setSourceType("table");
    entDef.addAttribute("ID", "ID", Integer.class, true, false, true);
    entDef.addAttribute("Name", "NAME", String.class, false, false, true);
    entDef.addAttribute("Location", "LOCATION", Integer.class, false, false, true);
    entDef.resolveDefObject();
    entDef.registerSessionDefObject();
    entDef.writeXMLContents();
    entDef.saveXMLContents();
    return entDef;
    } catch (Exception ex) {
    System.out.println(ex.getLocalizedMessage());
    return null;
    private ViewDefImpl buildDeptViewSessionDef(EntityDefImpl entityDef) {
    try {
    ViewDefImpl viewDef = new oracle.jbo.server.ViewDefImpl(oracle.jbo.server.ViewDefImpl.DEF_SCOPE_SESSION, "DynamicDeptViewDef");
    viewDef.setFullName(viewDef.getBasePackage() + ".dynamic." + viewDef.getName());
    System.out.println("ViewDef :" + viewDef.getFileName());
    viewDef.setUseGlueCode(false);
    viewDef.setIterMode(RowIterator.ITER_MODE_LAST_PAGE_FULL);
    viewDef.setBindingStyle(SQLBuilder.BINDING_STYLE_ORACLE_NAME);
    viewDef.setSelectClauseFlags(ViewDefImpl.CLAUSE_GENERATE_RT);
    viewDef.setFromClauseFlags(ViewDefImpl.CLAUSE_GENERATE_RT);
    viewDef.addEntityUsage("DynamicDeptUsage", entityDef.getFullName(), false, false);
    viewDef.addAllEntityAttributes("DynamicDeptUsage");
    viewDef.resolveDefObject();
    viewDef.registerSessionDefObject();
    viewDef.writeXMLContents();
    viewDef.saveXMLContents();
    return viewDef;
    } catch (Exception ex) {
    System.out.println(ex.getLocalizedMessage());
    return null;
    private void addViewToPdefApplicationModule(ViewDefImpl viewDef) {
    oracle.jbo.server.PDefApplicationModule pDefAM = oracle.jbo.server.PDefApplicationModule.findDefObject(getDefFullName());
    if (pDefAM == null) {
    pDefAM = new oracle.jbo.server.PDefApplicationModule();
    pDefAM.setFullName(getDefFullName());
    pDefAM.setEditable(true);
    pDefAM.createViewObject(DYNAMIC_DETP_VO_INSTANCE, viewDef.getFullName());
    pDefAM.applyPersonalization(this);
    pDefAM.writeXMLContents();
    pDefAM.saveXMLContents();
    ////////adf-config.xml//////////////////////
    <?xml version="1.0" encoding="windows-1252" ?>
    <adf-config xmlns="http://xmlns.oracle.com/adf/config" xmlns:config="http://xmlns.oracle.com/bc4j/configuration" xmlns:adf="http://xmlns.oracle.com/adf/config/properties"
    xmlns:sec="http://xmlns.oracle.com/adf/security/config">
    <adf-adfm-config xmlns="http://xmlns.oracle.com/adfm/config">
    <defaults useBindVarsForViewCriteriaLiterals="true"/>
    <startup>
    <amconfig-overrides>
    <config:Database jbo.locking.mode="optimistic"/>
    </amconfig-overrides>
    </startup>
    </adf-adfm-config>
    <adf:adf-properties-child xmlns="http://xmlns.oracle.com/adf/config/properties">
    <adf-property name="adfAppUID" value="TestDynamicEC-8827"/>
    </adf:adf-properties-child>
    <sec:adf-security-child xmlns="http://xmlns.oracle.com/adf/security/config">
    <CredentialStoreContext credentialStoreClass="oracle.adf.share.security.providers.jps.CSFCredentialStore" credentialStoreLocation="../../src/META-INF/jps-config.xml"/>
    </sec:adf-security-child>
    <persistence-config>
    <metadata-namespaces>
    <namespace metadata-store-usage="mdsRepos" path="/sessiondef/"/>
    <namespace path="/model/" metadata-store-usage="mdsRepos"/>
    </metadata-namespaces>
    <metadata-store-usages>
    <metadata-store-usage default-cust-store="true" deploy-target="true" id="mdsRepos">
    <metadata-store class-name="oracle.mds.persistence.stores.file.FileMetadataStore">
    <property name="metadata-path" value="/tmp"/>
    <!-- <metadata-store class-name="oracle.mds.persistence.stores.db.DBMetadataStore">
    <property name="jndi-datasource" value="jdbc/TestDynamicEC"/>
    <property name="repository-name" value="TestDynamicEC"/>
    <property name="jdbc-userid" value="adfmay28"/>
    <property name="jdbc-password" value="adfmay28"/>
    <property name="jdbc-url" value="jdbc:oracle:thin:@localhost:1521:XE"/>-->
    </metadata-store>
    </metadata-store-usage>
    </metadata-store-usages>
    </persistence-config>
    </adf-config>
    //////////////////////////////////////////////////////////////////////////////////////////////////////////

    Hi Frank,
    I m trying to save entity and view object xml by calling writeXMLContents() and saveXMLContents() so that these objects can be retrieved using the xmls later on.
    These methods internally use MDS configuration in adf-config.xml, which is creating the issue.
    Please share your thoughts on resolving this or if, there is any other way of creating dynamic entity/view objects for db tables created at runtime.
    Nik

  • Reference entities in View Objects

    Hi,
    I have several questions related to the use of multiple entities in a View Object.
    Suppose I have three entity objects: Product (N) <-> (0..1) Manufacturer (N) -> (1) State.
    (In a state there are several manufacturers, and each manufacturer makes several products. Of several products the manufacturer is unknown, so that's why there's a 0..1 on the manufacturer side)
    I want to create a view on products, ProductView, and I want to display the manufacturer name and the state name, so I've added these as reference entities to the ProductView.
    When doing so, several questions popped up:
    1) The View Object Wizard did not generate a where clause. If this is because I use more than one reference entity, then I don't understand why it wouldn't be able to generate the proper whereclause, since I've selected the associations between the entity objects, so it should be able to derive a proper whereclause from that.
    2) Left outer joins can only be performed by adding '(+)' to the query. However I would like to use the LEFT OUTER JOIN clause, since that is a bit more flexible (because I can add several expressions to the ON() clause. I can only use a LEFT OUTER JOIN if I create an expert mode query and do it myself. It would be nice if jdeveloper supported this type of query.
    3) In the query tab, the query uses weird aliases for the fieldnames. Since there was already an Id attribute in the base view object, the primary key of the second and third entityes had been named Id1 and Id2. I immediately renamed those to manufacturer_id (as I've read in one of the howto's on this forum). Still, the query uses the aliases ID1 and ID2 ('Manufacturer.ID AS ID1'), which makes the whereclause that I must right unreadable. Again, the only way to change this is to write my own query in expert mode.
    Thoughts?
    Greetings,
    Ivo

    [list]
    [*]Would be nice if BC4J supported left outer joins
    We do. This is exactly why the Expert Mode Query feature is there.
    In addition to LEFT OUTER JOIN there are hundreds of possible
    database query tricks that developers want to leverage in their SQL
    statements. Expert Mode gives you a generic way to handle all
    of them.
    [*]Weird aliases in the query
    Did you check the attribute settings in your VO to see what aliases are specified there at the bottom of the panel? These are what gets used by the query when BC4J "calculates" the query for you (i.e. when it's not an expert mode query).
    [*]The where clause didn't contain the '(+)' thingees, so the view did not perform an outer join
    Outer joins require expert mode. BC4J doesn't by default ever generate outer-join queries itself.
    [*]Derived view worked in the tester, but JClient master/detail generation didn't work
    This is Bug# 2684863 that we're looking at for 9.0.4
    [*]ViewLink inherited from base object doesn't show up for inclusion in datamodel
    This is Bug# 2684866 that we're investigating for 9.0.4
    You can create a new view link between the extended VO and either the existing destination view, or a VO extended from it, and it should work in the data model window.
    [list]

  • Problem exposing Accessor Methods on View object (ViewRowImpl.java)

    JDeveloper 9.03
    I have a view link, ViewLinkSourceDest, that links two view objects Source and Destination. Each view object has its respective ViewRowImpl.java file created.
    I have selected "Generate Accessor in View Object" in View link Properties of the View Link Wizard for both source and destination view objects.
    The correct Accessor methods are available in both the source and destination ViewRowImpl files.
    When I access the Source accessor method from the DestinationViewRowImpl object I receive the following error:
              ORA-00904: invalid column name
              It is also is displaying the Source view object's SQL statement with the (:1 = Destination.ID) where clause.
    The error is occurring when trying to retrieve the view object using this type of method call:
              Row r = this.getSourceView();
    After further investigation I have found an example set of view objects in which the error does not occur. The difference was in the ViewLink.xml file.
    The ViewLink.xml file that accesses the Accessor with the error begins like this:
              <ViewLink     
                   Name="ViewLink"
                   Where=":1 = Destination._ID" >
    The ViewLink.xml file that accesses the Accessor with no error begins like this:
              <ViewLink     
                   Name="ViewLink"
                   EntityAssociation ="SourceDestAssociation" >
    suggesting that the use of an association would resolve this problem.
    I was not able to create a View link based on an association that would generate a ViewLink.xml file that ressemble the successful file above. I could however manually add the correct entry to the xml file that caused the error and sucessfully access the Accessor method in the source object. This is not the final answer because the IDE will regenerate the ViewLink.xml file to its original state even if created with the appropriate Association.
    Is this a bug?
    Is the way the ViewLink.xml file created different in JDev 9.03 than in 9.02
    Is there something I am missing that is causing the ViewLink.xml file to generate incorrectly?
    Any suggestions would be helpful.
    Rob

    Steps to recreate:
    1 Create SomeSuperEntityImpl.java extended by SourceEntityImpl.java and DestinationEntityImpl.java entity objects.
    2 Create SourceView and DestinationView objects
    3 Create SourceDestinationAssociation linking the entity object Source PK to Destination FK
    4 Create SourceDestinationView linking Source and Destination view using the SourceDestinationAssociation
    View the SourceDestinationView.xml file and you will see that the viewlink has Where=":1 = source.src_id"
    This is the scenario that causes the initial problem with the Accessor Methods.
    If the SomeSuperEntityImpl.java is removed as the super class and the same procedure is followed you will get the desired 'EntityAssociation = "package.SourceDestinationAssociation"' in the SourceDestinationView.xml file .
    Hope this is a little clearer.
    Rob

Maybe you are looking for