org.hibernate.boot.model.relational.Namespace.createSequence()方法的使用及代码示例

x33g5p2x  于2022-01-25 转载在 其他  
字(2.3k)|赞(0)|评价(0)|浏览(88)

本文整理了Java中org.hibernate.boot.model.relational.Namespace.createSequence()方法的一些代码示例,展示了Namespace.createSequence()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Namespace.createSequence()方法的具体详情如下:
包路径:org.hibernate.boot.model.relational.Namespace
类名称:Namespace
方法名:createSequence

Namespace.createSequence介绍

暂无

代码示例

代码示例来源:origin: hibernate/hibernate-orm

protected void buildSequence(Database database) {
    final int sourceIncrementSize = getSourceIncrementSize();

    final Namespace namespace = database.locateNamespace(
        logicalQualifiedSequenceName.getCatalogName(),
        logicalQualifiedSequenceName.getSchemaName()
    );
    Sequence sequence = namespace.locateSequence( logicalQualifiedSequenceName.getObjectName() );
    if ( sequence != null ) {
      sequence.validate( initialValue, sourceIncrementSize );
    }
    else {
      sequence = namespace.createSequence( logicalQualifiedSequenceName.getObjectName(), initialValue, sourceIncrementSize );
    }

    this.sequenceName = database.getJdbcEnvironment().getQualifiedObjectNameFormatter().format(
        sequence.getName(),
        database.getJdbcEnvironment().getDialect()
    );
  }
}

代码示例来源:origin: hibernate/hibernate-orm

@Override
  public void registerExportables(Database database) {
    final Namespace namespace = database.locateNamespace(
        logicalQualifiedSequenceName.getCatalogName(),
        logicalQualifiedSequenceName.getSchemaName()
    );
    Sequence sequence = namespace.locateSequence( logicalQualifiedSequenceName.getObjectName() );
    if ( sequence != null ) {
      sequence.validate( 1, 1 );
    }
    else {
      sequence = namespace.createSequence(
          logicalQualifiedSequenceName.getObjectName(),
          1,
          1
      );
    }

    final JdbcEnvironment jdbcEnvironment = database.getJdbcEnvironment();
    final Dialect dialect = jdbcEnvironment.getDialect();

    this.sequenceName = jdbcEnvironment.getQualifiedObjectNameFormatter().format(
        sequence.getName(),
        dialect
    );
    this.sql = jdbcEnvironment.getDialect().getSequenceNextValString( sequenceName );
  }
}

代码示例来源:origin: hibernate/hibernate-ogm

@Override
  public void registerExportables(Database database) {
    final Namespace namespace = database.locateNamespace(
        logicalQualifiedSequenceName.getCatalogName(),
        logicalQualifiedSequenceName.getSchemaName()
    );
    Sequence sequence = namespace.locateSequence( logicalQualifiedSequenceName.getObjectName() );
    if ( sequence != null ) {
      sequence.validate( getInitialValue(), getIncrementSize() );
    }
    else {
      sequence = namespace.createSequence( logicalQualifiedSequenceName.getObjectName(), getInitialValue(), getIncrementSize() );
    }
  }
}

相关文章