12 Replies Latest reply: Nov 21, 2012 2:27 AM by thishum RSS

    master and detail table saving in one shot

    thishum
      hi all experts,
      tell me how to save master form and detail table data in one submit button.?
      without java bean coding can it do?
      if need java code how should do that?
      master form and detail table can edit it values. detail table has no:of rows. is it need iterrator operation?
      pls help me how should do that in one button.
      thkx.
        • 1. Re: master and detail table saving in one shot
          user404
          There are lots of examples.
          This is one of them:
          http://liuwuhua.blogspot.com.es/2010/11/master-detail-crud-in-adf-bc.html
          • 2. Re: master and detail table saving in one shot
            thishum
            hi friend,
            is there any lov in my master form and detail table this may work?
            pls help...
            • 3. Re: master and detail table saving in one shot
              user404
              Yes . As long as your LOV is formed correctly of course.
              • 4. Re: master and detail table saving in one shot
                thishum
                dear friend,
                when i rais new no using lov it will pop up following error.
                this is happening on view link which add on app module.
                [1039] EntityCache:add ERROR - new/modified row with same primary key as an existing row
                [1040] DCBindingContainer.reportException :oracle.jbo.TooManyObjectsException
                [1041] oracle.jbo.TooManyObjectsException: JBO-25013: Too many objects match the primary key oracle.jbo.Key[EST20120000124 ].
                     at oracle.jbo.server.EntityCache.throwTooManyObjectsException(EntityCache.java:608)
                     at oracle.jbo.server.EntityCache.handleDuplicateKey(EntityCache.java:617)
                     at oracle.jbo.server.EntityCache.addForAltKey(EntityCache.java:1030)
                     at oracle.jbo.server.EntityImpl.setAttributeValueInternal(EntityImpl.java:4014)
                     at oracle.jbo.server.EntityImpl.setAttributeValue(EntityImpl.java:3601)
                     at oracle.jbo.server.AttributeDefImpl.set(AttributeDefImpl.java:3194)
                               ;;;;;;;
                ;;;;;

                [1042] JUErrorHandlerDlg.reportException(oracle.jbo.TooManyObjectsException)
                [1043] Releasing iterator binding:oracle_jbo_uicli_binding_JUIteratorBinding_405
                • 5. Re: master and detail table saving in one shot
                  RanjithChitharanjan
                  Hi,
                  How can u bind an lov to a primary key field???
                  use db sequence or trigger for primary key generation


                  Ranjith
                  • 6. Re: master and detail table saving in one shot
                    thishum
                    yes friend, I select it now with dbsequence.but updatable field is can not change.it is in while new.not in never.it does not allow to change.help...
                    others are done in above web link. this my view link is 1 to many.
                    thks..
                    • 7. Re: master and detail table saving in one shot
                      thishum
                      no one know how to save header and detail table using one submit button.?
                      my header table data in editable form, but detail table data in table.both have lov's.
                      dbsequence is not work well..show me using managebean java class how to do that.
                      tkx.
                      • 8. Re: master and detail table saving in one shot
                        thishum
                        ADF experts.
                        attention please, send me how to save master & detail table save using one submit button?
                        give me usefull link.

                        txz.
                        • 9. Re: master and detail table saving in one shot
                          Shay Shmeltzer-Oracle
                          Your question is not clear.
                          As far as saving both master and detail in the same button - that is the default way that a commit button works - you don't need to do anything special for this to work.
                          The error that you get at the top of this thread indicates that you are trying to insert two records with the same key value - so that is the part you need to fix.
                          Without specific details about the steps you are doing no one would be able to help you further.
                          • 10. Re: master and detail table saving in one shot
                            934032
                            Hi , u have stated that db sequence is not working , please check if u have created sequence for child table in db if not..

                            1. Create a DB sequence in the database(in your case),

                            2. In the ADF application, under the model project create an entity object for the table which has the primary key

                            3. Open the Entity Object, go to Java tab and click on the 'Edit' button to auto-generate the entity object java class
                            a. Select 'Generate Entity Object Class' check box
                            b. Under the 'Include' grouping select 'Create Method' in additions to the default selected 'Accessors' option

                            4. later in the Entity ObjectIMPL class overide the create method and set the primary key with the sequence name u have created.


                            @Override
                            protected void create(AttributeList attributeList) {

                            //super.create(attributeList);

                            SequenceImpl s = new SequenceImpl("sequence_name", getDBTransaction());
                            super.create(attributeList);
                            Object obj = s.getSequenceNumber();

                            this.set_urprimarykey((Number)obj);// example this.setOrderId((Number)obj);
                            }

                            Thanks
                            Vishu
                            • 11. Re: master and detail table saving in one shot
                              thishum
                              dear friend,
                              we are going to generate our primary key like <string value><sysdate><number value>.ex: EXT 2012 0000001(EXT20120000001),.
                              therefore i can not use dbsequence. In here I use it generate database function. so need to know how to insert both tables?
                              can you give me coding how to insert both table in this type of senario.
                              is it using java class?
                              thks.
                              • 12. Re: master and detail table saving in one shot
                                thishum
                                pls read my problem and send me small example without dbsequence??
                                expect path from ADF developers for my issue??
                                thks.