Create java classes for entity object and for the attribute setter method put below code and your sequence name instead of seq1.
SequenceImpl s = new SequenceImpl("seq1",getDBTransaction());
setAttributeInternal(SUBMHEADID, s.getSequenceNumber());
Note: you need to provide some dummy value like -1 in the display to avoid madatory validation. At the time of insert it will take value from sequence.