ADF Transient variables reusage

Hello,
I have a question regarding transient variables in VO.
When defining a view object, can i have in it 2 transient variables that have the default value "SQL" format and can be something like this:
transVal1 = "SELECT NAME FROM EMPLOYEES WHERE EMPLOYEE_ID = 1"
transVal2 = "SELECT EMPLOYMENT_DATE FROM EMP_DATES WHERE NAME = transVal2"   (this will return just one value)
First time asking a question here, hope it's ok.
Thanks in advance.

My view component looks something like this:
SELECT Table1.TABLE1_ID,
       Table1.TABLE1_DESCRIPTION,
       Table2.TABLE2_ID,
       Table2.TABLE2_DESCRIPTION,
       (SELECT DATE FROM (SELECT MAX(DATE) FROM TABLE3 GROUP BY GROUP_ID) AS Table3 WHERE Table3.TABLE3_FK_ID = Table2.TABLE2_ID) AS MAX_DATE    <- transient
       (SELECT SOMETHING FROM TABLE4 WHERE DATE = MAX_DATE) AS SOME_ATTR                                                            <- transient
FROM  TABLE1 Table1, TABLE2 Table2
The problem is, that, if i put the SQL in the second transient variable, then i can't use "Table2.TABLE2_ID"
Thanks in advance.

Similar Messages

  • How to populate an EO Transient variable used in Conditional expression.

    Hi All
    I have a Unique Key Validator which has Conditional Execution in which I am checking for the value of transient variable and based on that value this validator is invoked.
    Problem is :- When this Conditional expression is processed, transient variable is not populated (code to populate it is written in getter method). As a result of which, I am not getting expected results.
    This is my conditional expression :- source.<Transient_variable> = <some value>
    I tried by replacing this expression as :- adf.object.getterMethod = <some value> , but that gave me the prototype not found error (method is present in EOImpl.java).
    How can I populate this transient variable before it is evaluated in conditional expression???
    Suggestions are welcomed!!!
    Thanks
    Nitin

    Just to explain
    Both adf.object.methodName and source.methodName are used to access EntityImpl methods. Difference is
    adf.object.methodName - used while defaulting the values of attributes
    source.methodName - used in validation expression and raising error messages/warning.
    Thanks
    Nitin

  • Transient  variable

    hi....
    i want to add a transient variable in EO and VO..but i dont know when i have add a transient variable in EO and when i have add a transient variable in EO and in VO.after that i want to give some java code in that transient variable..please tell me where i have to give the code setter or getter..but am getting values for transient values from entity object attributes only.

    Santhosh,
    not sure what your comment was meant to point out.
    Suganya,
    good question.
    Entity-derived view attributes are view attributes which map to a transient entity attribute. In a particular view row, entity-derived view attributes (like persistent view attributes) will never store values directly. Instead, they store pointers to values in the entity cache. Like persistent view attributes, entity-derived view attributes take advantage of Oracle ADF entity caching, which can aid in maintaining a consistent view and may save memory. These attributes are best used for temporary calculation and storage. Entity-derived attributes, unlike persistent attributes, can derive their values from complex SQL expressions, or use no SQL at all in their calculations. Bottom line, you use entity attributes if calculation of transient attributes is an expensive operation so that you want to avoid doing this over-and-over again and to leverage the entity cache for better performance or to share a transient attribute value between different View Object views. Also entity based transient attributes are updateable.
    Frank

  • What is a Transient Variable and when should it be used

    Hello everyone,
    I just want to know the details regarding the transient variable and when should we use it. what is the significance of this variable?

    Transient variables are not written out when the class is serialized.
    http://java.sun.com/docs/books/tutorial/essential/io/providing.html

  • How can we have transient variable value as a parameter for an attribute?

    Hi,
    I am using JDev 11.1.1.2 with ADF11g.
    I have a requirement where I have to display a table with many columns. One of the columns is a drop down whose values are fetched from DB. This is a non-DB item and so becomes a transient variable of the VO.
    There is another column/attribute of the VO that has to first pick the value of the transient variable and display values in the LOV.
    How can this be achieved? Do we have an example link for this?

    Hi simanta,
    According to your description that you are experiencing the issue with passing one textbox's values as parameter to another textbox, you got some errors, right?
    I have tested on my local environment and can reproduce your issue, your issue can be caused by the invalid expression you have added in the parameter for textbox1, you have mentioned that the textbox1 have just one value, for example, if you specify
    the default value and available value using this expression "=first(Fields!Yourfields.Value, "DataSet2")" you will get this kind of error.
    So, I suggest you not using the expression in the parameter, you can add condition in the query to get the proper value for textbox1, you said you also try to create an dataset for textbox1 but not getting the proper values of textbox1, please reference
    to details information below to check if you have done the right actions:
    Create an Dataset(Dateset2) to get the value for textbox1:
    I suppose you want to get the first values from the table, you can use query below instead of the using expression:
    Select Top 1 amount from tablename2
    Add the parameter(Param1) for textbox1, specify both the available values and default values by select the "Get values from a query" (DataSet2)
    In the main dataset(Dataset1), add the filter like below to display the textbox2's values which are  greater than Textbox1:
    You can also filter the data by modify the query of Dataset1:
    SELECT  * FROM   TableName1
    where  SalesAmount >(@Param1)
    If you problem still exists, please try to provide information below to help us more effective to provide an solution:
    How did you get the value for textbox1(Please provide all the expressions or the dataset query you are currently using)
    How did you add the filter to filter the Textbox2 which greater than textbox1?
    Any problem, please free to ask.
    Regards
    Vicky Liu

  • Flex blazeds/lcds AMF serialization for transient variables

    I am using LCDS and Flex. When I am sending an object from java to Flex, I donot want to send all  the properties. As far as I know,  if you do not want to serialize make a  variable transient.
    eg.
    private transient Date birthDate;
    public Date getBirthDate(){ 
        return birthDate;
    public void setBirthDate(Date val){
        birthDate = val;
        //Some code here.
    Now the serialized object should not have birthDate in it.  But When I  see the AMF logs , the object has the birthDate with value in it.
    Does serialization looks into code and checks the private variable is  transient.( I don't understand how it has access to private property. I  am little confused.)
    Should I mark variable as public. Then getters and setters make no sense  and moreover I write some code in setter method. So I need setter.
    Questions:
    I read in a book(Enterprise flex with blazeds by Brain Telintelo,  Chapter 15) that out of box Blazeds only serializes fileds that have  matching getters and setters. If this is the case, will blazeds even  bothers to check private property as transient.
    Can some body please explain how normal serializtion( not amf  serializtion ) takes place and keeps track of private transient  variables even though they have public getters and setters.
    How do I make a java variable not serialize in Flex/LCDS/BlazeDS environment.
    I have 50-60 variables in objects and 4 or 5 varibales should not be seriablezed. So writing custion Serializer in such a large objects is a big pain. And another disadvantage I see is hibernate will not be able to use this object if I write my own serializer.

    Martin
    Is it possible to post your findings as well ? 
    I'm encountering the same concerns with AMF and could use some help. 
    Ideally, can you assist with the following:
    1.  convert actionscript object graph to amf bytearray
    2.  convert amf bytearray to actionscript object graph
    3.  convert java object graph to amf bytearray
    4.  convert amf byte array to java object graph 
    Thanks,
    -Jonathan

  • Af:selectManyChoice transient variable to show selected rec in edit mode

    Hi All,
    Previous i have asked about af:selectManyChoice.
    My requirement i have two tables HeadTab and ChildTab.
    In my jsff , am showing HeadTab in table grid .In HeadTabVO , i have created a transient variable named chDetail.
    In table grid , am using af:selectManyChoice to chDetail , where user select multiple records. I can successful in get the selected records and saving in the ChildTab.
    Issue : when am in edit mode or revisit the page . Now i need to show the selected /saved records for respective HeadTab Id in chDetail (af:selectManyChoice) .
    I have created view link to HeadTab and ChildTab. How can i show the existing record in selected manner in chDetail transient variable for respective IDs in HeadTab.
    Thanks in advance.

    Frank,
    I'm saving selected records in ChildTab . when user revisits /edit mode , i have to show the records which are saved in ChildTab as selected in the af:selectManyChoice(this is transient variable) .I'm using jspx page.
    Edited by: user9010551 on Nov 5, 2012 9:08 PM

  • Value not displaying for the transient variable

    Hi all,
    I have added a transient variable in my VO.xml file and assigning a value to it in my code along with other non-transient variables. But that value is not getting displayed on the UI.
    Please help me in understanding the behavior of the transient variables in this context and how will I be able to see that value on the UI.
    Thanks.
    Gurpreet Singh

    hi Gurpreet,
    You can add values to that transient column programatically,either by getiing the row from the iterator and then row.setAttribute('Column_name','Value');
    Or providing value to it in the SQL...

  • EjbLoad() transient variable

    I have a transient variable that I use to concatenate some information
    before giving it back to the user. The name variable is mapped to the
    database.However the name is create with a trigger on the database to
    add a unique sequence numer.
    When retrieving the points according to the EJB specs the ejbLoad()
    should be called and I can see it being called. I store the value
    retrieved from the database into a transient variable called pointName
    public String name = null;
    transient String pointName = null;
    public ejbLoad()
    pointName = name;
    public String getName()
    return pointName;
    In Weblogic 5.1 everything worked fine and calling getName() will
    retrieve the proper concatenated name. We switched to 6.1 and I can see
    the ejbLoad() being called but us soon as I call getName() the value
    return is null. It seems that the container is resetting the transient
    variable between calls. Any idea???

    I agree that it should be a container problem. The container has to synchronize
    with the database in the ejbLoad() and anytime it passivates it should synchronized
    with the database prior to returning the data to the user. So if you create a
    transient variable in the ejbLoad() you should be able to retrieve it anytime. This
    is the same algorithm that happens with the isModified() method which uses a
    isDirty transient variable. Anyone having the same problem and being able to
    resolve it please help.
    Thanks
    Jeyakumar Raman wrote:
    Hi Nikola,
    Even I faced the same problem, as you told It should be container problem, even
    i could not figure how to resolve,
    if you found anything can you update me.
    Thanks
    Jeyakumar Raman.
    Rob Woollen <[email protected]> wrote:
    I suspect that you're in 2 different bean instances. I'd recommend
    printing out the System.identityHashCode(this) in ejbLoad and before
    you
    call getName.
    -- Rob
    Nikola Kapetanovic wrote:
    I have a transient variable that I use to concatenate some information
    before giving it back to the user. The name variable is mapped to the
    database.However the name is create with a trigger on the databaseto
    add a unique sequence numer.
    When retrieving the points according to the EJB specs the ejbLoad()
    should be called and I can see it being called. I store the value
    retrieved from the database into a transient variable called pointName
    public String name = null;
    transient String pointName = null;
    public ejbLoad()
    pointName = name;
    public String getName()
    return pointName;
    In Weblogic 5.1 everything worked fine and calling getName() will
    retrieve the proper concatenated name. We switched to 6.1 and I cansee
    the ejbLoad() being called but us soon as I call getName() the value
    return is null. It seems that the container is resetting the transient
    variable between calls. Any idea???--
    AVAILABLE NOW!: Building J2EE Applications & BEA WebLogic Server
    by Michael Girdley, Rob Woollen, and Sandra Emerson
    http://learnWebLogic.com

  • Transient variables non initialised........

    Hi everyone,
    I have two transient variables that is causing me problems. In my jsp page I have an entry form with a persist entity button..... The entry form does not have the two transient variables.
    Below the form is a table that will display all the records entered by the user.The table coluns comprises of the two transient variables but when i persist these two fields are not filled . I have to click on the table ( as if the table is refreshed to have the variables).
    In fact for the display of the tables below I have written in my session bean a method that will retrieve all the records by the user for the current week and set the values for the two transient variables .
    My question is how can i fill the transient variables in the table when i persist that is on submit.
    I am using Ejb 3.0....
    Please help me ...
    Regards Lutchumaya

    Hi Frank,
    here is the code from which i generate the table .... The PPR all is set as you told me...
    But how I can change my method in my session facade please help me . Here is my method
    /** <code>select object (o) from TrpStimeReports o where o.trpSemployees = :emp and o.weekNumber = :weeknum</code> */
    public List<TrpStimeReports> getEmpTrp(Object emp, Object weeknum) {
    // return em.createNamedQuery("getEmpTrp").setParameter("emp", emp).setParameter("weeknum", weeknum).getResultList();
    Calendar cal = Calendar.getInstance();
    if(weeknum == null){
    weeknum = cal.get(Calendar.WEEK_OF_YEAR);
    //Get the project assigned to the user
    List userpro = getUserProjects(((TrpSemployees) emp).getUsername());
    TrpSprojects pro = null;
    TrpStask taskuser = null;
    Long taskid = null;
    //Get the user task list for that user
    List usertas = getUserTasks(((TrpSemployees) emp).getUsername());
    //List of the time report for that user for the current week
    List trprepo = em.createNamedQuery("getEmpTrp").setParameter("emp", emp).setParameter("weeknum", weeknum).getResultList();
    //proid to store the id of the project
    Long proid = null;
    //Here am setting the values for the transient variables that are in my TrpStimeReports class
    for(Iterator itertrp = trprepo.iterator();itertrp.hasNext();){
    TrpStimeReports repo = (TrpStimeReports) itertrp.next();
    TrpSprojects prochange = getProjectForAssignment(repo.getProjectId());
    repo.setProjectName(prochange.getProjectName());
    String taskname =((TrpStask) getTaskById(repo.getTaskId())).getTaskName();
    repo.setTaskName(taskname);
    return trprepo;
    Thank you for your reply
    Regards
    Lutchumaya

  • Using transient variables

    I have a class which implements Serializable
    and I was wondering if there was anything
    I could do to speed up transfering this class
    from Server to Client. The class contains
    two String variables which are set on the server
    and then passed to the client. Would it make
    sense to make them transient or would I then
    loose their values when they get passed to the
    server?

    You would lose the value when your object is serialized.
    If you want to optimize the serialized data, you can implement writeObject() and readObject() -- see the documentation for java.lang.Serializable for more details.

  • Initialization of transient variables - not

    I have some code similar to
    public class FooBar implements Serializable {
        String foo;
        transient String bar = "bar";
    }I notice that when I deserialize FooBar, bar is null. This is not what I would have expected or wanted. Doesn't new get called to construct then new FooBar, then the initializers are run, before the deserialization of foo happens?
    I'm using the XStream XML serialization library. Is this behaviour library specific, or has serialization and deserialization always worked this way?

    I notice that when I deserialize FooBar, bar is null.
    This is not what I would have expected or wanted.
    Doesn't new get called to construct then new FooBar,
    then the initializers are run, before the
    deserialization of foo happens?Nope. Deserialization doesn't invoke constructors (nor initializer blocks). You can create you own readObject (if I recall correctly) method in that class that will get called when it is created via deserialization. In that method, you can do whatever post-serialization you want to do, such as setting that bar member.

  • What r the good examples of transient kinda variable?

    Can anyone plz tell me few good examples of transient variables?

    Anything that can be calculated from other members of the object, e.g.
    class Grades {
    double exam1;
    double exam2;
    double exam3;
    transient double average;
    public Grades(double exam1, double exam2, double exam3) {
    this.exam1= exam1;
    this.exam2= exam2;
    this.exam3= exam3;
    this.average = (exam1+exam2+exam3)/3;
    }

  • How to populate transient attribute from view object dynamically

    I have three 4 tables named as "employee,event,event_progress,and checklist progress". i have created a view object using the first three tables . i ahave also created 5 transient variables in to the same view object.when i dragged the view object in to my page as a table i want to populate those transient attribute.
    i have 5 transient attribute which are present as a column value named as chechlist_name in another table "checklist".those all transient attribute also having two sub rows whose data should be populated from the checklist progress table.

    Hi
    Please post your question on this forum, your question belong to this forum.
    JDeveloper and ADF
    Muhammad Nasir

  • Problem with adf table when adding component in table column.

    Hi All,
    i am using jdev version 11.1.1.5.0.
    use case: i have created one adf table which is based on DC VO. now i have added one select one radio group component(which contain 4 radio button approved ,reject,back,None) in adf table.
    table have many rows for example in first row i have select approved and to next row i have select reject now when i get value of radio group in backing bean using component binding i got last selected value.(in that case reject).
    And second is that when i set radio button value for current row using binding like
    rb.setValue("R") then reject option selected for all rows.
    so my question is that-
    how can i get and set value of select one radio group in row level using component binding.

    Hi,
    I don't see a reason for not using a transient attribute for the radioGroup in your previous reply.
    Here is the example i tried.
                            <af:selectOneRadio label="#{bindings.DeptView1.hints.DeptnoRadio.label}" id="sor1"
                                    value="#{row.bindings.DeptnoRadio.inputValue}">
                                <af:selectItem label="A" value="A" id="si1"/>
                                <af:selectItem label="B" value="B" id="si2"/>
                                <af:selectItem label="C" value="C" id="si3"/>
                                <af:selectItem label="D" value="D" id="si4"/>
                                <af:selectItem label="E" value="E" id="si5" disabled="#{row.bindings.EnableDisable.inputValue}"/>
                            </af:selectOneRadio>Where DeptnoRadio is the transient attribute i've created (which will have some random values between A and E), and EnableDisable is another transient variable of boolean type which would return true or false based on some condition.
    Now, for every row, the value is different (and corresponding radio button is selected) and for a row, which matches the condition, the option E is disabled.
    -Arun

Maybe you are looking for

  • Datetime in Indian Standard TimeZone (IST)

    Hi, I want to have the getdate() function in sql server to return date in IST format. Currently my sql server instance is remotely located having timezone other than IST. Please share... Thanks

  • Export to PDF and Spot Color Reg Marks

    This sounds like a simple problem but I have not been able to find a way to do this.  When I create a document in ID with 2 spot colors and then export to a pdf and add registration marks (or crop marks) at this stage, the reg marks are created as th

  • Column name as a variable !!!!!!!!!!!!!!!!!!!!

    hi All, please I would like to write a query such that the column names is to be variables. "select &C1, &C2 from T1 ;" it's working in sql developer but it's not working on apex region. thanks a lot.

  • Aperture import and desktop problem

    My Aperture main screen had changed and can not be fully used, as some pictures are not vissible in the browser view. As well the picture if shown in full screen in the main screen is not shown properly - 1/4 on the right side is missing. Today I rea

  • Do all open tabs in safari use data on iPhone 5

    I am wondering if pages that are open in the background of safari use data on the iPhone 5 iOS 7.1.1?