Get sequence next value in ADF
Value Type : Expression
Value :
(new oracle.jbo.server.SequenceImpl("HR.XX_IMAGE_S",adf.object.getDBTransaction())).getSequenceNumber()
Other options mentioned in
http://hasamali.blogspot.com/2011/04/adf-bc-various-way-of-setting-sequence.html
For Programmatic Approach
in EoImpl
import oracle.jbo.server.SequenceImpl;
...
protected void initDefaults() {
super.initDefaults();
SequenceImpl sequence = new SequenceImpl("<YourSequenceName>",getDBTransaction());
DBSequence dbseq = new DBSequence(sequence.getSequenceNumber());
OR
Number seqValue = (Number)sequence.getSequenceNumber();
populateAttributeAsChanged(<YourId>,dbseq
}
OR
Inside EOImpl Class
@Override
public void create(AttributeList attributeList) {
super.create(attributeList);
SequenceImpl seq = new SequenceImpl("LOG_SEQ", getDBTransaction());
Number seqNextval = seq.getSequenceNumber();
setId(seqNextval);
}
Value Type : Expression
Value :
(new oracle.jbo.server.SequenceImpl("HR.XX_IMAGE_S",adf.object.getDBTransaction())).getSequenceNumber()
Other options mentioned in
http://hasamali.blogspot.com/2011/04/adf-bc-various-way-of-setting-sequence.html
For Programmatic Approach
in EoImpl
import oracle.jbo.server.SequenceImpl;
...
protected void initDefaults() {
super.initDefaults();
SequenceImpl sequence = new SequenceImpl("<YourSequenceName>",getDBTransaction());
DBSequence dbseq = new DBSequence(sequence.getSequenceNumber());
OR
Number seqValue = (Number)sequence.getSequenceNumber();
populateAttributeAsChanged(<YourId>,dbseq
}
OR
Inside EOImpl Class
@Override
public void create(AttributeList attributeList) {
super.create(attributeList);
SequenceImpl seq = new SequenceImpl("LOG_SEQ", getDBTransaction());
Number seqNextval = seq.getSequenceNumber();
setId(seqNextval);
}
No comments:
Post a Comment