Package ome.util

Class TableIdGenerator

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

    public class TableIdGenerator
    extends org.hibernate.id.enhanced.TableGenerator
    OMERO-specific id generation strategy. Combines both TableGenerator and OptimizerFactory into a single class because of weirdness in their implementation. Instead, uses our own ome_nextval(?,?) method to keep the Hibernate sequence values (hiValue) in sync with the database values.
    • Field Summary

      • Fields inherited from class org.hibernate.id.enhanced.TableGenerator

        CONFIG_PREFER_SEGMENT_PER_ENTITY, DEF_SEGMENT_COLUMN, DEF_SEGMENT_LENGTH, DEF_SEGMENT_VALUE, DEF_TABLE, DEF_VALUE_COLUMN, DEFAULT_INCREMENT_SIZE, DEFAULT_INITIAL_VALUE, INCREMENT_PARAM, INITIAL_PARAM, OPT_PARAM, SEGMENT_COLUMN_PARAM, SEGMENT_LENGTH_PARAM, SEGMENT_VALUE_PARAM, TABLE_PARAM, VALUE_COLUMN_PARAM
      • Fields inherited from interface org.hibernate.id.IdentifierGenerator

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

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

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void configure​(org.hibernate.type.Type type, java.util.Properties params, org.hibernate.dialect.Dialect dialect)  
      java.io.Serializable generate​(org.hibernate.engine.SessionImplementor session, java.lang.Object obj)  
      void setSqlAction​(SqlAction sql)  
      • Methods inherited from class org.hibernate.id.enhanced.TableGenerator

        buildInsertQuery, buildSelectQuery, buildUpdateQuery, determineDefaultSegmentValue, determineGeneratorTableName, determineIncrementSize, determineInitialValue, determineSegmentColumnName, determineSegmentColumnSize, determineSegmentValue, determineValueColumnName, doWorkInCurrentTransaction, generatorKey, getIdentifierType, getIncrementSize, getInitialValue, getOptimizer, getSegmentColumnName, getSegmentValue, getSegmentValueLength, getTableAccessCount, getTableName, getValueColumnName, sqlCreateStrings, sqlDropStrings
      • Methods inherited from class org.hibernate.engine.TransactionHelper

        doWorkInNewTransaction
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • TableIdGenerator

        public TableIdGenerator()
    • Method Detail

      • configure

        public void configure​(org.hibernate.type.Type type,
                              java.util.Properties params,
                              org.hibernate.dialect.Dialect dialect)
                       throws org.hibernate.MappingException
        Specified by:
        configure in interface org.hibernate.id.Configurable
        Overrides:
        configure in class org.hibernate.id.enhanced.TableGenerator
        Throws:
        org.hibernate.MappingException
      • setSqlAction

        public void setSqlAction​(SqlAction sql)
      • generate

        public java.io.Serializable generate​(org.hibernate.engine.SessionImplementor session,
                                             java.lang.Object obj)
        Specified by:
        generate in interface org.hibernate.id.IdentifierGenerator
        Overrides:
        generate in class org.hibernate.id.enhanced.TableGenerator