Entity Transient attributes

I have a VO defined from an EO that have a transient attribute (a calculated attribute).
I can't use this attribute in a view criteria. I can't define this attribute as "queriable" in the ViewObject Wizard because the checkbox is disable.
Could anybody help me.
TIA.
Francisco

It's not clear from your description if the transient attribute is at the EO-level or the VO-level only.
Can you clarify?
Are you programmatically accessing the contents of the view criteria? That is, if the attribute is transient, in what way are you expecting setting a view criteria based on it to affect the results returned from the query?

Similar Messages

  • Transient Attributes in Entity object vs View Object

    Hi Everyone,
    I need some suggestion with my project. I have a vendors table based on which I created an entity object (columns: vendor_id, contract_id, so on ) but I want to display vendor_name in UI which can be read from other table. I thought of using a transient attribute to populate this vendor_name.
    It is working fine when I create a new record (where I handled this in LOV return value of vendor_id field and it return vendor_id, vendor_name values) but when there is edit/view of page, this vendor_name is null which means I need to populate it during page load /refresh time. Can someone suggest me a better way to populate this transient attributes. I also want to know when should I use transient attributes in Entity object (I saw most of the developer using VO transient attributes in these kind of situation)
    Thanks,
    Ravi

    Hi,
    also want to know when should I use transient attributes in Entity object (I saw most of the developer using VO transient attributes in these kind of situation)
    transient values in entities are saved in the entity cache and thus can be changed in the UI. If you use transient attributes on the VO then these are read-only. All transient attribute however need to be populated upon page load, which you can do in a ViewRowImpl class that checks for a null value when the getter is called to then call a setter, or by using Groovy script as a default value (just set the attribute to script)
    Frank

  • Transient attribute  in viewobject and entity object

    i added a transient attribute to an entity object . Then, for the view object based on that entity object, i added this transient attribute. The attribute name is Department Description. When i display the record(s) from this view object, everything is cool. But, when i try to create/insert a new record, i get error:
    JBO-27019: Get method for attribute "DepartmentDescription" could not be resolved. What is going on here and what do i need to change to create/insert a new entity row which has a transient attribute?
    As well as i added trasient attribute in view object also ....same erroe is comming ..................
    Thanks inadvance

    Hello Siva,
    have you already solved your problem?
    I have a very similar error.
    Thanks.
    Peter

  • Issue with value of  transient attribute after filtering or sorting a table

    Hi guys,
      i'm using jdev 11.1.1.4.0 .
      i've the use case :
             - a table with a column containing a checkbox to mark the selection of  a row
    <af:column align="center" sortProperty="TemIsChosen" filterable="true"
    sortable="true" id="c6">
    <af:selectBooleanCheckbox value="#{row.bindings.TemIsChosen.inputValue}" autoSubmit="true"
    shortDesc="#{bindings.ServersIndicTempVVO.hints.TemIsChosen.tooltip}"
    id="sbc1"
    valueChangeListener="#{backing_initIndicatorsTemp.onSelectTemp}"/>
    </af:column>
             - i select one or more rows with checkboxes
             - if i filter  or sort the table, the selection of the checkboxes reset to not selected (value false by default).
         I understand that for the framework, it's a normal behavior because for filtering or sorting , it re-executes the query from database. And transient attribute is not persistent, so it goes back to the default initial value "false".
         What i would appreciate, it's that filtering or sorting has no effect on the value of the transient attribute, ie end user selection remains.
          I tried to modify query mode of the ViewObject to filter with in-memory data. It works fine but if you reset filter inputs you can't retrieve correct RowSet. Only new RowSet is stored, old is lost.
           So  now it's the filtering feature that doesn't work as expected.
       How can i implement  my use case withouth the troubles i've described.
    Best regards,
    David

    Hi Frank,
       no it's a view object level attribute inside a read-only view object.
      The view object doesn't use any entity.
      Here is the definition of the attribute in the xml file of the VO, if can help you :
    <ViewAttribute
        Name="TemIsChosen"
        IsSelected="false"
        IsPersistent="false"
        PrecisionRule="true"
        Type="java.lang.Boolean"
        ColumnType="BIT"
        AliasName="VIEW_ATTR"
        SQLType="BIT"
        Passivate="true">
        <Properties>
          <SchemaBasedProperties>
            <TOOLTIP
              ResId="ADD"/>
            <DISPLAYWIDTH
              Value="50"/>
          </SchemaBasedProperties>
        </Properties>
      </ViewAttribute>
    David

  • Treetable with transient attributes

    Hi,
    I use JDeveloper 11.1.1.2.0 to develope an ADF application.
    I need to create and show two level treetable using viewobjects theese have only transient fields.
    I have two viewobjects and a viewlink described below:
    1. VO : AccountsVO
    2. VO : ProductsVO
    Viewlink : ProductsOfAccountVL
    An account can has a lot of products. Both of viewobjects have only transient attributes.
    I have to use transient attributes because of the architecture of the application.
    I create and insert the rows to the viewobjects in managed bean.
    I need to create a treetable like below :
    AccountName1 AccountDesc1
    ---ProductNo1 ProductName1 ProductDesc1
    ---ProductNo2 ProductName2 ProductDesc2
    AccountName2 AccountDesc2
    ---ProductNo3 ProductName3 ProductDesc3
    When I drag and drop the parent VO as an ADF Tree Table then run the application, I could see only first level records.
    I mean only Accounts are shown.
    The viewlink doesn't work. Is this a bug or is it normally work like this.
    Finally I intend to create and add child node programmatically, but I don't know is it possible or not and how could it be done.
    What do you advice or what is the correct way.
    Mehmet
    Thanks.
    Edited by: mdoldur on 03.Haz.2010 12:33

    Hi Frank,
    I don't have any entity object, so I get the informations from a few different modules and
    insert them to the programmatic viewobjects which have transient attributes.
    In fact I could create 2 temporary tables on the database but I am not allowed to change the database schema.
    By the way I have updated my JDeveloper from 11.1.1.2 to 11.1.1.3 I will try the same operation and inform you.
    Thanks.
    Mehmet.

  • Getting error when trying to extend standard VO with transient attributes

    Hello,
    I am trying to extend the standard VO ReqSummaryVO in iprocurement module and getting the error "Each Row in the Query Result Columns must be mapped to a unique Query Attribute in the mapped entity columns" at step 4. This VO has a lot of transient attributes. I have gone through solutions from other threads related to this error but none of them worked for me. Can someone help me on this please?
    Thanks,
    Girish.

    Hello,
    I am trying to extend the standard VO ReqSummaryVO in iprocurement module and getting the error "Each Row in the Query Result Columns must be mapped to a unique Query Attribute in the mapped entity columns" at step 4. This VO has a lot of transient attributes. I have gone through solutions from other threads related to this error but none of them worked for me. Can someone help me on this please?
    Thanks,
    Girish.

  • How to call a method in Viewimpl from transient attributes value

    Hai,
    I have a method in ViewImpl say validate().I need to call this method from an transient attributes value where value type is expression.i used adf.object.validate() but its not working.
    Can any one help me
    Thanks in advance

    Hai,
    Jabr i read these in a pdf where it explains about Introduction to Groovy support in JDeveloper and Oracle ADF 11g
    Referencing custom methods in the EntityImpl class
    If you have defined a method in your EntityImpl class, then this can be called as part of your
    expression for an attribute default:
    adf.object.getDefaultSalaryForGrade()
    Unlike when referencing an attribute of the entity object, which can be done by simply
    referencing the attribute name, when referencing a method, you are required to prefix the
    method name with adf.object.
    So is there a way?
    regards

  • Adding Transient attributes at runtime.

    ViewObjects allows to add a dynamic attribute at runtime.
    Is there any way to add dynamically a transient attribute to an Entity at runtime ?
    TIA
    Tullio

    Tullio:
    We run into some serious design issues if were to support dynamic attributes at the EO level. Let me explain:
    First of all, a dynamic EO attr will be of limited value unless it can be exposed through VO. This means that we have to support runtime mapping of EO attr to VO. This is non-trivial work.
    Secondly, view rows have an inherent assumption that its attributes are grouped as non-dyn attrs (those mapped to EO attrs and transient/calculated attrs) first, followed by dynamic attributes. If we were to support dyn EO attrs, this assumption has to break. This assumption is plays an important role in VO inheritance as well. When one VO extends another VO, dyn attrs are not inherited, and this attr grouping assumption makes inherited attr mgmt much more manageable for us.
    Because these reasons, I think support of dyn attrs at the EO level will not be easy.
    Thanks.
    Sung

  • Passivate Transient Attributes

    I have a transient attribute in a View Object that reflects the results of a costly calculation. Passivate to PS_TXN seems to me the best way to keep the result from one request to another.
    1. Has the calculated value to be cached by setAttributeInternal in the view row internal buffer, or has it to be cached as a member of the view row impl ?
    Passivation calls the getter, so it makes no difference. But how are members of view row objects cleared in the case they are "recycled" ?
    2. It seems to me that activating a transient attribute is somewhat buggy: the getter is always called before the restored value appears in the mInner-mCalcs member of a view row, which calculates the value unnecessarily. If the value was not cached with setAttributeInternal, it never appears in mCals.

    If your transient attributes are updateable, but you use them only within the scope of a single request (e.g. you set the value within a particular request and use it only until the end of this request but not later), then you do not have to passivate them. However, if they are updateable and you need their values to survive across multiple requests, then you must ensure that these attributes are passivated. In order to configure them to passivate you should do the following:
    1. Check the checkbox "Passivate State (e.g. Current Row, Bind Variables, etc.)" in the section "General/Tunning" in VO's definition dialog box;
    2. Either check the checkbox "Including All Transient Values" in the same section or leave it unchecked but check the checkbox "Passivate" in the definition of the corresponding VO attributes.
    N.B. The setting "Include All Transient Values" affects not only the transient VO attributes but the SQL-derived VO attributes (that are not entity-based) too.
    The configuration parameter "jbo.txn.disconnect_level" has nothing to do with passivation/activation. The correct way to test if your VOs behave correctly under passivation/activation is to disable AM pooling (e.g. to uncheck the checkbox "Enable Application Module Pooling" in the corresponding AM Configuration dialog box). When AM Pooling is disabled ADF passivates the corresponding AM state at the end of each HTTP request and activates it at the beginning of next request and so on. In this way you can check if your VOs are passivation/activation-safe.
    Please, have a look at the article [url http://docs.oracle.com/cd/E23943_01/web.1111/b31974/bcstatemgmt.htm#sm0318]Application State Management in the documentation for more information and detailed explanation.
    Dimitar

  • Binding transient attributes

    I have a transient attribute in my EntityObject and a corresponding attribute in my ViewObject. It seems that the JUTextFieldBinding created by:
    setDocument(JUTextFieldBinding.createAttributeBinding(panelBinding, jTextArea, "ViewName", null, "ViewIter", "AttributeName")));
    doesn't call setAttribute() when the JTextArea's text is changed bu the user.
    I can listen for focusLost myself and set the attribute and all is fine.
    Everything is also fine for persistent attributes.
    I'm not sure if I'm creating a transient or Entity-derived ViewObject attribute here. The documentation describes both but fails to say how to create them. Is it dependent on the ViewObject attribute name matching an EntityObject attribute name?
    Tony.

    Tony,
    Transient attributes are not treated differently at the JClient level. I tried (using JDev 9.0.3.1) your scenario and was able to update a TextArea mapped to a entity-derived (transient at entity-level) View Attribute with a name different from the Entity-Attribute name and was able to update it's value, move to another row, come back and the value was there.

  • Sorting transient attributes

    Does anyone know how to take advantage of adf/uix built in sorting for view objects that contain only transient fields? For example, when I build a view object that references an entity object, sorting (via a uix table tag) works great. However, when using a view object with only transient attributes, sorting does not work through a uix table. Any ideas would really be appreciated...

    FYI,
    I've figured this out for anyone that sees this post in the future. Here's how to do it.
    1 Open the transient view object in the view object editor (by double-clicking on the view object).
    2 Select Java.
    3 Press the Class extends button.
    4 For Object, browse to the following class: SortableTransientViewObject (see below for implementation)
    5 Press OK.
    6 Select Attributes.
    7 For each attributes:
    1. Select the "Selected in Query" property.
    2. Copy the exact name of the attribute to the query column alias field.
    8 Press OK.
    SortableTransientViewObject implementation:
    =============================================================
    import java.util.Collections;
    import java.util.Iterator;
    import java.util.LinkedList;
    import java.util.List;
    import oracle.jbo.Row;
    import oracle.jbo.RowSetIterator;
    import oracle.jbo.server.ViewObjectImpl;
    import org.apache.commons.logging.Log;
    import org.apache.commons.logging.LogFactory;
    import oracle.jbo.NoDefException;
    public class SortableTransientViewObject extends ViewObjectImpl
    //flag for determining an invalid column index
    public static final int INVALID_COLUMN_INDEX_FLAG = -1;
    //default sort to INVALID_COLUMN_INDEX_FLAG
    private int sortColumnIndex = INVALID_COLUMN_INDEX_FLAG;
    private boolean sortAscending = true;
    * Sole constructor. Do not remove.
    public SortableTransientViewObject()
    * Sets the default sort order. If the order has not been pre-defined, then the
    * sort will not be executed when the view object is first created.
    * @param sortField the sort field index. Each view object row implementation
    * defines these attributes indices as constants. Those values are the values
    * that should be used for this method.
    * @param sortAscending sort ascending if true; descending otherwise.
    public void setDefaultSortOrder( int sortField, boolean sortAscending )
    this.setSortColumnIndex( sortField );
    this.setSortAscending( sortAscending );
    * ADF Framework extension.
    * <br>
    * This method is called by ADF when a view object is to be refreshed. In
    * the case of sorting, this signals that the view object should be sorted.
    * The ADF framework will have already called the setOrderByClause() method
    * which tells this view object what to sort by.
    public void executeQuery()
    sort( getSortColumnIndex(), isSortAscending() );
    * Over-riding to implement sort for transient view object.
    * <br>
    * This method will be called by the adf framework whenever a request
    * is made to sort the view object through a ui component; most
    * likely a table. The orderByClause parameter will always contain
    * the sort column and will optionally contain the sort direction.
    * <br>
    * This method parses the orderByClass parameter and sets the
    * corresponding sort index and direction. This method does not perform
    * the actual sort; the sort will not take place until the executeQuery()
    * method has been invoked.
    * @param orderByClause a string representing the sort column and sort
    * direction.
    public void setOrderByClause( String orderByClause )
    if( isNullOrEmpty( orderByClause ) ||
    isNullOrEmpty( orderByClause.trim() ))
    this.setSortColumnIndex( INVALID_COLUMN_INDEX_FLAG );
    this.setSortAscending( true );
    return;
    else
    orderByClause = orderByClause.trim();
    boolean sortAscending = true;
    String sortColumn = null;
    int spaceCharacterIndex = orderByClause.indexOf( ' ' );
    if( spaceCharacterIndex == -1 )
    sortColumn = orderByClause;
    sortAscending = true;
    else
    sortColumn = orderByClause.substring( 0, spaceCharacterIndex );
    String sortDirectionStringValue = orderByClause.substring( spaceCharacterIndex, orderByClause.length() );
    if( isNullOrEmpty( sortDirectionStringValue ) ||
    isNullOrEmpty( sortDirectionStringValue.trim() ) )
    sortAscending = true;
    else
    sortDirectionStringValue = sortDirectionStringValue.trim();
    if( "desc".equals( sortDirectionStringValue.toLowerCase() ) )
    sortAscending = false;
    try
    this.setSortColumnIndex( this.getAttributeIndexOf( sortColumn ) );
    catch( NoDefException e )
    this.setSortColumnIndex( INVALID_COLUMN_INDEX_FLAG );
    this.setSortAscending( sortAscending );
    * Sort helper method.
    * <br>
    * Sorts the view object. Because adf's built in sorting only works for
    * non-transient attributes (ie attributes from an entity object), this
    * method was created as a framework extension to support sorting.
    * <br>
    * This method accomplishes sorting by using Java's built in api for
    * sorting: the Collections framework. First, all view object rows are
    * copied into List object. Second, the list is sorted using Java's built
    * in Collections.sort method. Third, all rows are removed from the view
    * object and lastly, the view object is re-populated by iterating through
    * the list.
    * @param sortField the field to sort by.
    * @param sortAscending sort ascending if true; descending otherwise.
    private void sort( int sortFieldParameter, boolean sortAscendingParameter )
    //don't sort if the column index is invalid
    if( sortFieldParameter < 0 || sortFieldParameter >= this.getAttributeCount() )
    return;
    //step 1 - copy all rows to a List object and remove all rows from view object
    List list = new LinkedList();
    RowSetIterator rowIterator = this.getRowSet().createRowSetIterator( null );
    while( rowIterator.hasNext() )
    Row rowToAdd = (Row) rowIterator.next();
    list.add( rowToAdd );
    rowIterator.closeRowSetIterator();
    //step 2 - sort the List object.
    Collections.sort( list, new ViewObjectRowComparator( sortFieldParameter, sortAscendingParameter ) );
    //step 3 - remove all rows from view object
    rowIterator = this.getRowSet().createRowSetIterator( null );
    while( rowIterator.hasNext() )
    rowIterator.next();
    rowIterator.removeCurrentRowAndRetain();
    rowIterator.closeRowSetIterator();
    //step 4 - re-populate the view object with the sorted list.
    Iterator sortedValuesIterator = list.iterator();
    while( sortedValuesIterator.hasNext() )
    Row row = (Row) sortedValuesIterator.next();
    this.insertRow( row );
    public boolean isSortAscending()
    return sortAscending;
    private void setSortAscending(boolean sortAscending)
    this.sortAscending = sortAscending;
    public int getSortColumnIndex()
    return sortColumnIndex;
    private void setSortColumnIndex(int sortColumnIndex)
    this.sortColumnIndex = sortColumnIndex;
    =============================================================

  • Transient attribute's value not updated in view

    Hi,
    I am facing a strange behaviour with a transient attribute of an entity based VO. I have a method that creates rows in this VO, which sets a value to this transient attribute and at the end the new rows are shown. However, this attribute does not show any value despite all the others (non transient) do. What's more, if I set a default value to the attribute, then I'll always see the default one without minding if I had set any other value.
    While debugging the method, the attribute shows the correct value after setting it; I have tried adding it as a calculated attributed in the VO's select sentence, but it won't work; and if I try to create another transient attribute, the same story gets repeated. Finally, if I create the transient attribute in the entity, and get it in the VO, it works correctly. Does anyone know why? I am using JDeveloper 11.1.1.2.
    Thank you very much

    Sure, here it is:
    RowSetIterator itQuestions = voQuestions.createRowSetIterator(null);
    while(itQuestions.hasNext()) {
    VO_RO_QuestionsRowImpl rowQuestion = (VO_RO_QuestionsRowImpl)itQuestions.next();
    VO_QuestionAnswersRowImpl rowAnswer = (VO_QuestionAnswersRowImpl)voAnswers.createRow();
    rowAnswer.setQstnrResultId(qstnrResultId);
    rowAnswer.setQuestionCode(rowQuestion.getQuestionCode());
    rowAnswer.setVisibleFlag(rowQuestion.getRelatedQuestion() == null ? FLAG_YES : FLAG_NO);
    voAnswers.insertRow(rowAnswer);
    itQuestions.closeRowSetIterator();
    As you can see, it hasn't anything special at all.

  • Transient attribute for a view object coming from a socket

    Hello,
    I'd like to create a readonly table (based on a view object without a backing entity).
    Some columns are coming from a table and some other columns (based on the table key) are coming from a socket.
    The problems is that the additional columns are all returned at once by the socket (to avoid calling it for every field and killing our network) and then stored in a java bean.
    So i'd like to make the call to the socket once for every row of the table.
    Do you know in which method of the View object should i make the call (maybe I should do this at the Row level ?)
    Do you have any idea ?
    thank you
    -regards.

    Hi,
    you can try the follwing
    In the bindings of your jspx page you can see iterators defined under "executables". set the "*CacheResults*" property of the specific view object iterator that contains the transient attribute to false.(The default value is true).
    Example:
    <iterator Binds="EditWorkflowNodesView1" RangeSize="25"
    DataControl="AdministratorAppModuleDataControl"
    id="EditWorkflowNodesView1Iterator" CacheResults="false"/>
    Regards,
    Priya.

  • Transient attribute of a view object is not reset after saving

    I have a jspx page based on view object with transient attribute(This transient attribute has been created in entity object on which view object is based). User enters data in transient attribute,some calculation is done and then data is updated and page navigates back to menu page.
    Now when I reenter page then old data still apears on the page.I want old data to be refreshed on reentering.Kindy help

    Hi,
    you can try the follwing
    In the bindings of your jspx page you can see iterators defined under "executables". set the "*CacheResults*" property of the specific view object iterator that contains the transient attribute to false.(The default value is true).
    Example:
    <iterator Binds="EditWorkflowNodesView1" RangeSize="25"
    DataControl="AdministratorAppModuleDataControl"
    id="EditWorkflowNodesView1Iterator" CacheResults="false"/>
    Regards,
    Priya.

  • View Object Transient attribute, refresh problem.

    I have a VO which contains 3 entities joined. I added it a transient attribute with Groovy expression. My expression is : ReplyView.count("ReplyId"); , it counts two VO relationship. it counts normally but, when i insert a new reply, it doesnt refresh/update/recalculate the value. Whats the problem?

    The dependency values referred to are accessed when you edit the transient attribute in the view object. On the left hand panel select dependencies and shuttle the columns that the transient is dependent on. I don't think this matters for non-entity based views since the SQL is fixed but for entity based views this assures the dependent columns are added to the query even if they are not needed by the page.
    http://docs.oracle.com/cd/E21764_01/web.1111/b31974/bcentities.htm#ADFFD20177

Maybe you are looking for