Class TableSeqGenerator

  • All Implemented Interfaces:
    org.hibernate.id.BulkInsertionCapableIdentifierGenerator, org.hibernate.id.Configurable, org.hibernate.id.IdentifierGenerator, org.hibernate.id.PersistentIdentifierGenerator

    public class TableSeqGenerator
    extends org.hibernate.id.enhanced.SequenceStyleGenerator
    按照表明进行命名序列
    依据命名模式进行,默认模式{table}_seq
    该生成器可以
     1)具有较好的数据库移植性,支持没有sequence的数据库。
     2)可以通过设置优化起进行优化
     3)可以按照表名进行自动命名序列名,模式{table}_seq
     
    Author:
    chaostone
    • Field Summary

      Fields 
      Modifier and Type Field Description
      static TableNamingStrategy namingStrategy
      Updated by OverrideConfiguration.secondPass
      • Fields inherited from class org.hibernate.id.enhanced.SequenceStyleGenerator

        CONFIG_PREFER_SEQUENCE_PER_ENTITY, CONFIG_SEQUENCE_PER_ENTITY_SUFFIX, DEF_SEQUENCE_NAME, DEF_SEQUENCE_SUFFIX, DEF_VALUE_COLUMN, DEFAULT_INCREMENT_SIZE, DEFAULT_INITIAL_VALUE, FORCE_TBL_PARAM, INCREMENT_PARAM, INITIAL_PARAM, OPT_PARAM, SEQUENCE_PARAM, VALUE_COLUMN_PARAM
      • Fields inherited from interface org.hibernate.id.IdentifierGenerator

        ENTITY_NAME, JPA_ENTITY_NAME
      • Fields inherited from interface org.hibernate.id.PersistentIdentifierGenerator

        CATALOG, IDENTIFIER_NORMALIZER, PK, SCHEMA, TABLE, TABLES
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void configure​(org.hibernate.type.Type type, Properties params, org.hibernate.dialect.Dialect dialect)
      If the parameters do not contain a SequenceGenerator.SEQUENCE name, we assign one based on the table name.
      String getSequencePattern()  
      void setSequencePattern​(String sequencePattern)  
      • Methods inherited from class org.hibernate.id.enhanced.SequenceStyleGenerator

        buildDatabaseStructure, determineAdjustedIncrementSize, determineBulkInsertionIdentifierGenerationSelectFragment, determineIncrementSize, determineInitialValue, determineOptimizationStrategy, determineSequenceName, determineValueColumnName, generate, generatorKey, getDatabaseStructure, getIdentifierType, getOptimizer, sqlCreateStrings, sqlDropStrings, supportsBulkInsertionIdentifierGeneration
    • Field Detail

      • namingStrategy

        public static TableNamingStrategy namingStrategy
        Updated by OverrideConfiguration.secondPass
    • Constructor Detail

      • TableSeqGenerator

        public TableSeqGenerator()
    • Method Detail

      • configure

        public void configure​(org.hibernate.type.Type type,
                              Properties params,
                              org.hibernate.dialect.Dialect dialect)
        If the parameters do not contain a SequenceGenerator.SEQUENCE name, we assign one based on the table name.
        Specified by:
        configure in interface org.hibernate.id.Configurable
        Overrides:
        configure in class org.hibernate.id.enhanced.SequenceStyleGenerator
      • getSequencePattern

        public String getSequencePattern()
      • setSequencePattern

        public void setSequencePattern​(String sequencePattern)