Wednesday, March 16, 2011

Using DB Sequence

By Overriding Create in VOImpl

    protected void create(AttributeList attributeList) {
        super.create(attributeList);
        SequenceImpl seq = new SequenceImpl("<DB_seq_name>", getDBTransaction());
        Number seqNextval = seq.getSequenceNumber();
        setLpLocationId(seqNextval);
    }
 
 
By EL exp:

Go to Entity Attribute. Click on Expression. then provide the following line in the 'value' field
(new oracle.jbo.server.SequenceImpl("<DB_seq_name>",adf.object.getDBTransaction())).getSequenceNumber()

No comments:

Post a Comment