com.github.drinkjava2.jdialects.id
Class SortedUUIDGenerator

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

public class SortedUUIDGenerator
extends Object
implements IdGenerator

Generate a Sorted UUID, total length = sortedLength + uuidLength,
for example, SortedUUIDGenerator(5,20):
10001NmpQHeGLy8eozSSq2p1B
10002DLIGkILFISKJF23KLSDF
10003LVBIFI35LDFJIA31KDSF

Since:
1.0.6
Author:
Yong Zhu

Constructor Summary
SortedUUIDGenerator(String name, int sortedLength, int uuidLength)
           
 
Method Summary
 Boolean dependOnAutoIdGenerator()
          If depends on AutoIdGenerator, for example SortedUUIDGenerator depends on AutoIdGenerator to create start numbers
 GenerationType getGenerationType()
          Return GenerationType
 String getIdGenName()
          Return a unique Id Generator name in this TableModel
 String getName()
           
 Object getNextID(NormalJdbcTool jdbc, Dialect dialect, Type dataType)
          Get the next ID generated by implementation of IdGenerator
 int getSortedLength()
           
 int getUuidLength()
           
 IdGenerator newCopy()
          Return a newCopy (Deep Clone) instance
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SortedUUIDGenerator

public SortedUUIDGenerator(String name,
                           int sortedLength,
                           int uuidLength)
Method Detail

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

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

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

newCopy

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

Specified by:
newCopy in interface IdGenerator

getName

public String getName()

getSortedLength

public int getSortedLength()

getUuidLength

public int getUuidLength()


Copyright © 2018. All rights reserved.