Class MaxValueIncrementerFactory

java.lang.Object
org.kuali.rice.krad.data.platform.MaxValueIncrementerFactory

public final class MaxValueIncrementerFactory extends Object
Factory for obtaining instances of DataFieldMaxValueIncrementer for a given DataSource and incrementer name.

These incrementers are used for getting generated incrementing values like that provided by a database-level sequence generator.

Note that not all database platforms support sequences natively, so incrementers can be returned that emulate sequence-like behavior. The Spring Framework provides incrementer implementations for numerous different database platforms. This classes uses DatabasePlatforms to determine the platform of the given DataSource.

Note that this class will cache internally any incrementers for a given DataSource + Incrementer Name combination.

Author:
Kuali Rice Team (rice.collab@kuali.org)
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final String
    Prefix for property names used to identify the classname for a DataFieldMaxValueIncrementer to use for a given platform.
  • Method Summary

    Modifier and Type
    Method
    Description
    static org.springframework.jdbc.support.incrementer.DataFieldMaxValueIncrementer
    getIncrementer(DataSource dataSource, String incrementerName)
    Either constructs a new incrementer or retrieves a cached instance for the given DataSource and target incrementer name.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • PLATFORM_INCREMENTER_PREFIX

      public static final String PLATFORM_INCREMENTER_PREFIX
      Prefix for property names used to identify the classname for a DataFieldMaxValueIncrementer to use for a given platform.

      To construct a full property name, concatenate this prefix with the platform name.

      See Also:
  • Method Details

    • getIncrementer

      public static org.springframework.jdbc.support.incrementer.DataFieldMaxValueIncrementer getIncrementer(DataSource dataSource, String incrementerName)
      Either constructs a new incrementer or retrieves a cached instance for the given DataSource and target incrementer name.
      Parameters:
      dataSource - the DataSource for which to retrieve the incrementer.
      incrementerName - the case-insensitive name of the incrementer to use, this will generally be the name of the database object which is used to implement the incrementer.
      Returns:
      an incrementer that can be used to generate the next incremented value for the given incrementer against the specified DataSource.
      Throws:
      IllegalArgumentException - if dataSource or incrementerName are null or blank.