2 Replies Latest reply: May 8, 2013 6:26 AM by Manish RSS

    ADF: Regarding EntityImpl

    Manish
      Hi all,

      i'm using jdev 11.1.1.5.0

      in my use case i have three vo based on eo like A B C and have master-detail relationship between these entity like

      A->B->C (multilevel)

      i have written some code on prepareForDml method of all Entity. Now when i create new record then save so new created on all entity accroding master-detail relation ship Now
      when i commit code of B entiy prepareForDml call first.

      My Question is that how can i control execution flow of Entity Impl i want first execute code of A entity after that B then C.

      Thanks
      Manish
        • 1. Re: ADF: Regarding EntityImpl
          Mohammad Jabr
          You can ovverride postChange method in BEntityyImpl and CEntityImpl .
          Here is an example from Developer guide.
          Example 4–29 Overriding postChanges() in ProductsBaseImpl to Post Supplier First
          // In ProductsBaseImpl.java
          public void postChanges(TransactionEvent e) {
          /* If current entity is new or modified */
          if (getPostState() == STATUS_NEW ||
          getPostState() == STATUS_MODIFIED) {
          /* Get the associated supplier for the product */
          SuppliersImpl supplier = getSupplier();
          /* If there is an associated supplier */
          if (supplier != null) {
          /* And if its post-status is NEW */
          if (supplier.getPostState() == STATUS_NEW) {
          /*
          * Post the supplier first, before posting this
          * entity by calling super below
          */
          supplier.postChanges(e);
          }
          }
          }
          super.postChanges(e);
          }
          • 2. Re: ADF: Regarding EntityImpl
            Manish
            thanks a lot jabr

            it is working.