Posts

Showing posts from April, 2016

Using Database sequence in the ADF for primary key attribute.

Image
There are multiple ways to use DB sequence in the ADF for generating ids. 1. Use the column as DB sequence and  mention the sequence name in the sequnce name filed. Post that ADF will take care of executing the sequence.    ADF framework will add a temporary negative number until you commit the information. 2.  Use SequenceImpl in the Adf, this can be used at mutiple places, this can be used    -- Create method.    --  Do DML method. ===============================================         SequenceImpl seq = new SequenceImpl("MSKILL_LOV_GEN_SEQ",this.getDBTransaction());                 Integer nextVal = Integer.parseInt(seq.getSequenceNumber().toString());                 this.setLovValueId(nextVal);                 super.doDML(operation, e); =================================== Using it dodml are more beneficial as it will create sequence duging save only hence we will see a sequence gap in records, which will come if we will use this code in create me