Class DefaultKeyGenerator

  • All Implemented Interfaces:
    KeyGenerator

    @Deprecated
    public class DefaultKeyGenerator
    extends Object
    implements KeyGenerator
    Deprecated.
    as of Spring 4.0, in favor of SimpleKeyGenerator or custom KeyGenerator implementations based on hash codes
    Default key generator. Returns 0 if no parameters are provided, the parameter itself if only one is given or a hash code computed from all given parameters' hash code values. Uses the constant value 53 for any null parameters given.

    NOTE: As this implementation returns only a hash of the parameters it is possible for key collisions to occur. Since Spring 4.0 the SimpleKeyGenerator is used when no explicit key generator has been defined. This class remains for applications that do not wish to migrate to the SimpleKeyGenerator.

    Since:
    3.1
    Author:
    Costin Leau, Chris Beams, Juergen Hoeller