6 Replies Latest reply: Apr 16, 2012 9:32 AM by Subramanian Meyyappan RSS

    validate method on EoImpl

    Subramanian Meyyappan
      hi jdev groups

      using 11.1.1..5.0-adfbc

      i had a validate method in particulalr xxxeoimpl class.

      Reason: while perform tab out in ui the function will fires. well it performs it's work correclty.
       code in Eoimpl class
          public boolean validatexxxSubTerr(String xxxsubterr) {
              if(xxxsubterr!=null){
      ......
                   setAttributeInternal("xxxTerrId",FuncFindTerritory("somevaluevalue",prospsubterr));
               }
              else{
                 throw new JboException("Territory Not Found") ;
              }
              return true;
          }
        code in Eoimpl class
          public String FuncFindTerritory(String pbu, String pxxxsubterr){
              CallableStatement cs = null;
              try{
              cs=getDBTransaction().createCallableStatement("begin ? := FUNC_FIND_TERRITORY(?,?); end;",0);
              cs.registerOutParameter(1, Types.VARCHAR);
              cs.setString(3,pxxxsubterr);
              cs.setString(2,pbu);
              cs.executeUpdate();
              return cs.getString(1);
              }
              catch(SQLException e){
              throw new JboException(e);
              }
              finally 
              {
              if (cs!=null)
              try{
                 cs.close();
                 }
               catch (Exception e){System.out.println (" Function Find Territory Exception Thrown "+e);}
              } 
              
          }
      my question is : I use this FuncFindTerritory in most of the eoimpl class.

      so i dont want to duplicate the same FuncFindTerritory in all eo class.

      is there any chance to define this function in am module access/call this function in eo particular validate method.
      setAttributeInternal("xxxTerrId",FuncFindTerritory("somevaluevalue",prospsubterr)); // this what i mean
      if wrote like this means i have to define method(FuncFindTerritory) in eoimpl class.

      instead of doing like this..

      Adf provides to access the methods which is define in am? is there any way...


      sorry for updating late.
      thanks&&regards
      adf7.