com.github.drinkjava2.jdialects.id
Class SequenceIdGenerator

java.lang.Object
  extended by com.github.drinkjava2.jdialects.id.SequenceIdGenerator
All Implemented Interfaces:
IdGenerator

public class SequenceIdGenerator
extends Object
implements IdGenerator

The platform-independent SequenceGen model, similar like JPA

Since:
1.0.0
Author:
Yong Zhu

Constructor Summary
SequenceIdGenerator()
           
SequenceIdGenerator(String name, String sequenceName, Integer initialValue, Integer allocationSize)
           
 
Method Summary
 Boolean dependOnAutoIdGenerator()
          If depends on AutoIdGenerator, for example SortedUUIDGenerator depends on AutoIdGenerator to create start numbers
 Integer getAllocationSize()
           
 GenerationType getGenerationType()
          Return GenerationType
 String getIdGenName()
          Return a unique Id Generator name in this TableModel
 Integer getInitialValue()
           
 String getName()
           
 Object getNextID(NormalJdbcTool jdbc, Dialect dialect, Type dataType)
          Get the next ID generated by implementation of IdGenerator
 String getSequenceName()
           
 IdGenerator newCopy()
          Return a newCopy (Deep Clone) instance
 void setAllocationSize(Integer allocationSize)
           
 void setInitialValue(Integer initialValue)
           
 void setName(String name)
           
 void setSequenceName(String sequenceName)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SequenceIdGenerator

public SequenceIdGenerator()

SequenceIdGenerator

public SequenceIdGenerator(String name,
                           String sequenceName,
                           Integer initialValue,
                           Integer allocationSize)
Method Detail

getNextID

public Object getNextID(NormalJdbcTool jdbc,
                        Dialect dialect,
                        Type dataType)
Description copied from interface: IdGenerator
Get the next ID generated by implementation of IdGenerator

Specified by:
getNextID in interface IdGenerator
Parameters:
jdbc - A NormalJdbcTool implementation to access database
dialect - The Dialect
dataType - The Type of a column
Returns:
id generated by IdGenerator

getGenerationType

public GenerationType getGenerationType()
Description copied from interface: IdGenerator
Return GenerationType

Specified by:
getGenerationType in interface IdGenerator

getIdGenName

public String getIdGenName()
Description copied from interface: IdGenerator
Return a unique Id Generator name in this TableModel

Specified by:
getIdGenName in interface IdGenerator

newCopy

public IdGenerator newCopy()
Description copied from interface: IdGenerator
Return a newCopy (Deep Clone) instance

Specified by:
newCopy in interface IdGenerator

dependOnAutoIdGenerator

public Boolean dependOnAutoIdGenerator()
Description copied from interface: IdGenerator
If depends on AutoIdGenerator, for example SortedUUIDGenerator depends on AutoIdGenerator to create start numbers

Specified by:
dependOnAutoIdGenerator in interface IdGenerator

getName

public String getName()

setName

public void setName(String name)

getSequenceName

public String getSequenceName()

setSequenceName

public void setSequenceName(String sequenceName)

getInitialValue

public Integer getInitialValue()

setInitialValue

public void setInitialValue(Integer initialValue)

getAllocationSize

public Integer getAllocationSize()

setAllocationSize

public void setAllocationSize(Integer allocationSize)


Copyright © 2018. All rights reserved.