com.elasticpath.domain.order
Interface OrderNumberGenerator

All Superinterfaces:
EpDomain, Persistence, java.io.Serializable
All Known Implementing Classes:
OrderNumberGeneratorImpl

public interface OrderNumberGenerator
extends Persistence

This is used to track the next available order number.

Notes:

  • The order number is in a separate domain object so that it can be mapped to a table that can be independently locked while the order number is incremented.
  • Order numbers are strings that may contain characters.
  • There is only one NextOrderNumber object that corresponds to the first record in the table.
  • The table must be pre-populated with a record corresponding to the single instance of this object with the starting order number


    Field Summary
    static long INSTANCE_UIDPK
              This is the UID used for retrieving the single instance of NextOrderNumber.
     
    Method Summary
     java.lang.String getNextOrderNumber()
              Get the next available order number and increments it so that each call to this method will return a unique order number.
     
    Methods inherited from interface com.elasticpath.domain.Persistence
    executeBeforePersistAction, getUidPk, isPersistent, setDefaultValues, setUidPk
     
    Methods inherited from interface com.elasticpath.domain.EpDomain
    getElasticPath, setElasticPath
     

    Field Detail

    INSTANCE_UIDPK

    static final long INSTANCE_UIDPK
    This is the UID used for retrieving the single instance of NextOrderNumber.

    See Also:
    Constant Field Values
    Method Detail

    getNextOrderNumber

    java.lang.String getNextOrderNumber()
    Get the next available order number and increments it so that each call to this method will return a unique order number. The NextOrderNumber should be persisted after calling this method

    Returns:
    the order number