Class ObjectId

All Implemented Interfaces:
IdSource

public class ObjectId extends AbstractIdSource
An IdSource to create unique object IDs.

Only used if the backend does not support sequences.
Provides some degree of optimization to update the table only once at the end of the transaction.

Author:
harald
See Also:
  • Constructor Details

    • ObjectId

      public ObjectId(String name)
      Creates an object id.
      Parameters:
      name - the source and table name
  • Method Details

    • isLockFree

      public boolean isLockFree()
      Description copied from interface: IdSource
      Returns whether retrieving an id is a lock-free operation.
      Returns:
      true if lock-free
    • nextId

      public long nextId(Db db)
      Description copied from interface: IdSource
      Get the next unique ID.
      Parameters:
      db - the current session
      Returns:
      a free ID.