Package com.google.code.lightssh.project.sequence.entity

Examples of com.google.code.lightssh.project.sequence.entity.Sequence


  public Sequence nextSequence(String key,int step ){
    if( key == null )
      throw new ApplicationException("获取序列的参数KEY为空!");
   
    boolean inserted = false;
    Sequence seq = dao.read( key );
    if( seq == null ){
      seq = new Sequence( key );
      inserted =true;
    }
    seq.incLastNumber( step );
   
    if( inserted )
      dao.create( seq );
    else
      dao.update( seq );
View Full Code Here


  public String newTransactionNextSequenceNumber(Sequenceable sa) {
    return nextSequenceNumber( sa );
  }
 
  public String nextSerialNumber(Sequenceable sa) {
    Sequence seq = nextSequence( sa );
    if( seq == null )
      throw new ApplicationException("获取得的序列为空!");
   
    return seq.getFormatLastNumber( sa.getSequenceLength() );
  }
View Full Code Here

TOP

Related Classes of com.google.code.lightssh.project.sequence.entity.Sequence

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.