2 Replies Latest reply on May 8, 2013 11:26 AM by Manish

    ADF: Regarding EntityImpl

      Hi all,

      i'm using jdev

      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.

        • 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
          • 2. Re: ADF: Regarding EntityImpl
            thanks a lot jabr

            it is working.