This discussion is archived
6 Replies Latest reply: Dec 10, 2012 2:10 AM by Timo Hahn RSS

How to set bind variable

974910 Newbie
Currently Being Moderated
Hi
I am writing Junits for a view object and i need to paas the bind variable value . I have use the following code

MaterialPOAMImpl am = (MaterialPOAMImpl)this.getApplicationModule();
PoSchedAssociatedChargesVOImpl poAssociatedChargesVOImpl = (PoSchedAssociatedChargesVOImpl)am.getPoSchedAssociatedCharges1();
poAssociatedChargesVOImpl.setBind_poLineLocationId(364083L);
poAssociatedChargesVOImpl.executeQuery();

When i am running this gives me java.long.casting exception.
Can anyone plz help me what went wrong??

Thanks in advance.
  • 1. Re: How to set bind variable
    Timo Hahn Oracle ACE
    Currently Being Moderated
    Have you checked that the data type of the bind breaks is long?
    It may be of type Number.

    Timo
  • 2. Re: How to set bind variable
    974910 Newbie
    Currently Being Moderated
    Hi Timo
    Thanks for reply
    I have checked and it is of Long Type

    its giving this exception
    "java.lang.ClassCastException: oracle.apps.fnd.applcore.oaext.model.OAApplicationModuleImpl cannot be cast to oracle.apps.scm.landedCost.landedCosts.reviewPoDetails.uiModel.applicationModule.MaterialPOAMImpl"
  • 3. Re: How to set bind variable
    bigchill Newbie
    Currently Being Moderated
    Hi

    the casting happens in this line,

    PoSchedAssociatedChargesVOImpl poAssociatedChargesVOImpl = (PoSchedAssociatedChargesVOImpl)am.getPoSchedAssociatedCharges1();

    so you may want to check if am appmodule returns the right VO.
    check getPoSchedAssociatedCharges1() in the app module to see if it returns the right VO - assuming it has been hand changed by you and might have missed something.

    Or it may be that the VO is not part of the AM, or you have not exposed the View accessor methods exposed to the client in the AM or VO.
  • 4. Re: How to set bind variable
    Frank Nimphius Employee ACE
    Currently Being Moderated
    Hi,

    can't you read error messages ?

    oracle.apps.fnd.applcore.oaext.model.*OAApplicationModuleImpl* cannot be cast to oracle.apps.scm.landedCost.landedCosts.reviewPoDetails.uiModel.applicationModule.*MaterialPOAMImpl*"

    translates to ...

    OAApplicationModuleImpl <> MaterialPOAMImpl

    pointing to

    MaterialPOAMImpl am = *(MaterialPOAMImpl)this.getApplicationModule();*

    as the line causing the issue. You cast the AM to the wrong class. This is it

    Frank
  • 5. Re: How to set bind variable
    974910 Newbie
    Currently Being Moderated
    Hi
    I am able to remove the casting exception now, but the code is not able to set the bind variable value. Any comments on that.

    Thanks
  • 6. Re: How to set bind variable
    Timo Hahn Oracle ACE
    Currently Being Moderated
    No comment on that. We can't help if we don't know what error you get. 'it's not working' is no help at all.

    Run the app with -Djbo.debugoutput=console to get a printout of the query send to the db.

    Timo

Legend

  • Correct Answers - 10 points
  • Helpful Answers - 5 points