Class NoKeyGeneratorFactory

java.lang.Object
org.castor.cpa.persistence.sql.keygen.NoKeyGeneratorFactory
All Implemented Interfaces:
KeyGeneratorFactory

public final class NoKeyGeneratorFactory extends Object implements KeyGeneratorFactory
Factory for instantiating NoKeyGenerator objects.
Version:
$Revision$ $Date: 2009-07-13 17:22:43 (Tue, 28 Jul 2009) $
Author:
Ahmad Hassan, Ralf Joachim
  • Constructor Details

    • NoKeyGeneratorFactory

      public NoKeyGeneratorFactory()
  • Method Details

    • getKeyGeneratorName

      public String getKeyGeneratorName()
      Get the short name of the key generator. It is used to reference key generators in a mapping configuration file. If several key generators of the same type are used for the same database, then they are referenced by aliases.
      Specified by:
      getKeyGeneratorName in interface KeyGeneratorFactory
      Returns:
      Name of the KeyGenerator used to identify key generator (types).
    • getKeyGenerator

      public KeyGenerator getKeyGenerator(PersistenceFactory factory, Properties params, int sqlType) throws MappingException
      Produce the key generator.
      Specified by:
      getKeyGenerator in interface KeyGeneratorFactory
      Parameters:
      factory - Helper object for obtaining database-specific QuerySyntax.
      params - Parameters for key generator.
      sqlType - The SQL type of the primary key, the generated identities must have the corresponding Java type, e.g. java.sql.Types.INTEGER corresponds to java.lang.Integer, java.sql.Types.NUMERIC corresponds to java.lang.BigDecimal.
      Returns:
      A KeyGenerator instance.
      Throws:
      MappingException - If there's a problem resolving the mapping information.