Gapless Sequence

                                                 Gapless Sequence


For this I have create new table in HR


Make two columns as Ids and Names.

Now create new application as hr connection

 


Create model part with table2 eo,vo,app module

 


In eo generate java classes as shows below

 



We have to write doDml statement in java class

 

 


------------------- -----------------------------------------------------------------------------------------------------

    protected void create(AttributeList attributeList) {

        super.create(attributeList);

        SequenceImpl se = new SequenceImpl("Final_SEQ",getDBTransaction());

        this.setIds(se.getSequenceNumber());

       

    }

--------------------------------------- ------------------------------------------------------------------------------------


 ------------------------------------------------ -------------------------------------------------------------------------- 

     protected void doDML(int operation, TransactionEvent e) {

        super.doDML(operation, e);

        if(operation == DML_INSERT){

            SequenceImpl se = new SequenceImpl ("Final_SEQ",getDBTransaction());

            this.setIds(se.getSequenceNumber());

}

----------------------------------------- ------------------------------------------------------------------------

        Now create jspx page



 

Drop in that page form from data control as adf form

 


 


 

Here take submit create insert ,commit, rollback buttons

 


 

Now Run the page for see output

 


Give value in that form fields


Click on submit then commit

Now go DB and refresh table here rows created

 


If u want to delete one row from DB select that column click on delete then commit


 

See in DB refresh table here row was deleted

If I delete ids 3  then hit the commit its remove from Data Base


FARHATH

Comments

Popular posts from this blog

Programmatically invoke a Popup to create a new row.

POJO(Plain Old Java Object) - Editable Data - DataControl.dcx

Dynamic Tabs in ADF