الانتقال إلى المحتوى
View in the app

A better way to browse. Learn more.

مجموعة مستخدمي أوراكل العربية

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Applmodule Method Return Rowset

Featured Replies

بتاريخ:

السلام عليكم

 

  its possible to add in appmodule method that return Row set or any row collection

   

and call this method in managed bean 

 

            
         
            
         public RowSet getPrRows(int id)
    {
        RowSet  rows;
            BigDecimal price=new BigDecimal(0);
            ViewObject vo = getPrView1();
            ViewCriteria vc = vo.createViewCriteria();
            ViewCriteriaRow vcr1 = vc.createViewCriteriaRow();
            vcr1.setAttribute("Itid",id);
            vc.add(vcr1);
            vo.applyViewCriteria(vc);
            vo.executeQuery();
             rows=(RowSet)vo;
             return rows;
            
        }

 

بتاريخ:

نعم ممكن

بتاريخ:
  • كاتب الموضوع

نعم ممكن

شكرا مهندس مصطفي 

يعني الطريقة المكتوب بيها الميثود صحيحة

ولو صحيحة كيف انادي عليها في managed bean

وكيف iterate في النتيجة

 

 

شاكر لحضرتك

بتاريخ:

لا توجد مشكلة فيها لكن ما الذي تريد عمله بالضبط حيث أنه الأفضل استخدام iterator داخل bean

بتاريخ:
  • كاتب الموضوع

مثلا عائذ املا tabular في الصفحة  من النتيجة ,ال tabular بيزد علي viewbpject مختلف بحيث اساعد المستخدم بادخال عدد من الصفوف تم ادخاله مسبقا في جدول اخر

واسترجاعها في tabular للحذف او التعديل زي ما بتعمل عند ما اكون عائذ احول sales order لفاتورة نهائية

بتاريخ:

يمكن تنفيذها داخل bean من خلال iterator ولا توجد أي حاجة لاستخدام appModule

بتاريخ:
  • كاتب الموضوع

اشكرك اخي مصطفي 

 

المشكلة عند ما احاول تنفيذها داخل bean توجد مشكلة عند  انه لا يتعرف علي   ال View object       getPrView1

بتاريخ:
  • كاتب الموضوع

اشكرك اخي مصطفي 

 

المشكلة عند ما احاول تنفيذها داخل bean توجد مشكلة عند  انه لا يتعرف علي   ال View object       getPrView1

الا بعمل Object من AppModuleImpl

بتاريخ:

يمكن تنفيذها داخل bean من خلال iterator

بتاريخ:
  • كاتب الموضوع

شكرا مهندس مصطفي علي هذا التوضيح

 

الكود  ادناها يقوم بجلب بيانات من جدول لحفظها في جدول اخر عن طريق ADF Tabular والان شغال بطريقة صحيحة السؤال هل هذا الكود من ناحية performance or best practice جيد ام لا

 

    public String LoadData(ValueChangeEvent ev) {
        // Add event code here...
        BigDecimal qty=new BigDecimal(2);
        BigDecimal id= new BigDecimal(0);
        BigDecimal prc=new BigDecimal(0);
        BigDecimal vat=new BigDecimal(0);
        BigDecimal perc=new BigDecimal(0.1);
        Integer pr=0;
        //FacesContext fctx = FacesContext.getCurrentInstance();
        String amDef = "model.AppModule";
             String config = "AppModuleLocal";
             ApplicationModule am = Configuration.createRootApplicationModule(amDef,config);
        AppModuleImpl service = (AppModuleImpl)am;
                RowSet  rows;
                BigDecimal price=new BigDecimal(0);
                ViewObject vo =service.getPrView1();
                ViewCriteria vc = vo.createViewCriteria();
                ViewCriteriaRow vcr1 = vc.createViewCriteriaRow();
                pr=(Integer)ev.getNewValue();
                vcr1.setAttribute("Reqno",pr);
                vc.add(vcr1);
                vo.applyViewCriteria(vc);
                vo.executeQuery();
                ClearTable();   // delete existing records 
            while (vo.hasNext())
            {   
                Row r=vo.next();
               qty= (BigDecimal)r.getAttribute("Qty");
               id= (BigDecimal)r.getAttribute("Itid");
               prc= (BigDecimal)r.getAttribute("Price");
            vat=(qty.multiply(prc)).multiply(perc);
              
            String x=cb1_action(); // to add new record this method called createInsert to add new record
            DCBindingContainer dcBindings = (DCBindingContainer)BindingContext.getCurrent().getCurrentBindingsEntry();
            DCIteratorBinding customIter = dcBindings.findIteratorBinding("InvDetView1Iterator");
            RowSetIterator customRSIter = customIter.getRowSetIterator();
            //Populating the data to newly created row
            Row currentRow = customRSIter.getCurrentRow();
            currentRow.setAttribute("Itid",id); 
            currentRow.setAttribute("Qty", qty); 
            currentRow.setAttribute("Price", prc);    
            currentRow.setAttribute("Vat",Math.round(vat.doubleValue())); 
            currentRow.setAttribute("TotPrice", prc.multiply(qty));    
            currentRow.setAttribute("Reqno", pr);    
        }  
        return null;
    }
بتاريخ:

لو عدد السجلات كبير فاستخدام sql أسرع كثيراً

لكن لو عدد السجلات التي يتم إدخالها في حدود 100 على الأكثر فلن يظهر فرق كبير

بتاريخ:

لكن بشكل عام طريقة استدعاء AppModule خاطئة

سيكون هناك فيديو قريب في مشروع ADF على قناتنا لتوضيح الطريقة الصحيحة

بتاريخ:
  • كاتب الموضوع

جزاك الله خيرا اخ مصطفي في الانتظار ان شاء الله

بتاريخ:
  • كاتب الموضوع

لو عدد السجلات كبير فاستخدام sql أسرع كثيراً

لكن لو عدد السجلات التي يتم إدخالها في حدود 100 على الأكثر فلن يظهر فرق كبير

هل تعني ب sql عبارة select from A insert into B يعني يتم حفظ البيانات بشكل دائم

لكن الغرض من المثال هو ان يتم جلب هذه البيانات في الصفحة لغرض التعديل والتعديل والحذف وان يقوم بحفظ البيانات او الالغاء

انضم إلى المناقشة

يمكنك المشاركة الآن والتسجيل لاحقاً. إذا كان لديك حساب, سجل دخولك الآن لتقوم بالمشاركة من خلال حسابك.

زائر
أضف رد على هذا الموضوع...

برجاء الإنتباه

بإستخدامك للموقع فأنت تتعهد بالموافقة على هذه البنود: سياسة الخصوصية

Account

Navigation

البحث

إعداد إشعارات المتصفح الفورية

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.