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

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

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

Namespace.getSequences介绍

暂无

代码示例

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

public void performValidation(
    Metadata metadata,
    DatabaseInformation databaseInformation,
    ExecutionOptions options,
    Dialect dialect) {
  for ( Namespace namespace : metadata.getDatabase().getNamespaces() ) {
    if ( schemaFilter.includeNamespace( namespace ) ) {
      validateTables( metadata, databaseInformation, options, dialect, namespace );
    }
  }
  for ( Namespace namespace : metadata.getDatabase().getNamespaces() ) {
    if ( schemaFilter.includeNamespace( namespace ) ) {
      for ( Sequence sequence : namespace.getSequences() ) {
        if ( schemaFilter.includeSequence( sequence ) ) {
          final SequenceInformation sequenceInformation = databaseInformation.getSequenceInformation(
              sequence.getName()
          );
          validateSequence( sequence, sequenceInformation );
        }
      }
    }
  }
}

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

@Test
@TestForIssue( jiraKey = "HHH-9936" )
public void testMultipleUsesOfDefaultSequenceName() {
  final MetadataImplementor metadata = (MetadataImplementor) new MetadataSources( ssr )
      .addAnnotatedClass( Entity1.class )
      .addAnnotatedClass( Entity2.class )
      .buildMetadata();
  metadata.validate();
  assertEquals( 0, metadata.getDatabase().getAuxiliaryDatabaseObjects().size() );
  int count = 0;
  for ( Namespace namespace : metadata.getDatabase().getNamespaces() ) {
    for ( Sequence sequence : namespace.getSequences() ) {
      count++;
    }
  }
  assertEquals( 1, count );
}

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

@Test
@TestForIssue( jiraKey = "HHH-9936" )
public void testMultipleUsesOfExplicitSequenceName() {
  final MetadataImplementor metadata = (MetadataImplementor) new MetadataSources( ssr )
      .addAnnotatedClass( Entity3.class )
      .addAnnotatedClass( Entity4.class )
      .buildMetadata();
  metadata.validate();
  assertEquals( 0, metadata.getDatabase().getAuxiliaryDatabaseObjects().size() );
  int count = 0;
  for ( Namespace namespace : metadata.getDatabase().getNamespaces() ) {
    for ( Sequence sequence : namespace.getSequences() ) {
      count++;
    }
  }
  assertEquals( 1, count );
}

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

tablesInformation.put( namespace, nameSpaceTablesInformation );
if ( schemaFilter.includeNamespace( namespace ) ) {
  for ( Sequence sequence : namespace.getSequences() ) {
    checkExportIdentifier( sequence, exportIdentifiers );
    final SequenceInformation sequenceInformation = existingDatabase.getSequenceInformation( sequence.getName() );

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

for ( Sequence sequence : namespace.getSequences() ) {
  if ( !schemaFilter.includeSequence( sequence ) ) {
    continue;

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

);
sequenceStructure.registerExportables( database );
exportIdentifierSet.add( namespace.getSequences().iterator().next().getExportIdentifier() );
namespaceSize++;

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

for ( Sequence sequence : namespace.getSequences() ) {
  if ( !schemaFilter.includeSequence( sequence ) ) {
    continue;

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

protected List<Sequence> sequences(Database database) {
  List<Sequence> sequences = new ArrayList<>();
  for ( Namespace namespace : database.getNamespaces() ) {
    for ( Sequence sequence : namespace.getSequences() ) {
      sequences.add( sequence );
    }
  }
  return sequences;
}

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

for ( Sequence seq : namespace.getSequences() ) {
  this.sequenceCounterHandlers.put( seq.getExportIdentifier(),
      new SequenceClusteredCounterHandler( persistenceStrategy.getCacheManager().getCacheManager(), seq ) );

代码示例来源:origin: org.hibernate.ogm/hibernate-ogm-infinispan-embedded

for ( Sequence seq : namespace.getSequences() ) {
  this.sequenceCounterHandlers.put( seq.getExportIdentifier(),
      new SequenceClusteredCounterHandler( persistenceStrategy.getCacheManager().getCacheManager(), seq ) );

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

for ( Sequence sequence : namespace.getSequences() ) {
  generatedSequences.add( sequence.getName().getSequenceName().getText() );
  igniteDatastoreProvider.atomicSequence( sequence.getName().getSequenceName().getText(), sequence.getInitialValue(), true );

代码示例来源:origin: org.hibernate.ogm/hibernate-ogm-infinispan-remote

@Override
public void initializeSchema(SchemaDefinitionContext context) {
  ServiceRegistryImplementor serviceRegistry = context.getSessionFactory().getServiceRegistry();
  TypeTranslator typeTranslator = serviceRegistry.getService( TypeTranslator.class );
  OptionsService optionsService = serviceRegistry.getService( OptionsService.class );
  Map tableEntityTypeMapping = context.getTableEntityTypeMapping();
  InfinispanRemoteDatastoreProvider datastoreProvider = (InfinispanRemoteDatastoreProvider) serviceRegistry.getService( DatastoreProvider.class );
  String protobufPackageName = datastoreProvider.getProtobufPackageName();
  SchemaDefinitions sd = new SchemaDefinitions( protobufPackageName );
  HashSet<Sequence> sequences = new HashSet<>();
  for ( Namespace namespace : context.getDatabase().getNamespaces() ) {
    for ( Sequence sequence : namespace.getSequences() ) {
      sequences.add( sequence );
    }
    for ( Table table : namespace.getTables() ) {
      if ( table.isPhysicalTable() ) {
        createTableDefinition( context.getSessionFactory(), sd, table, typeTranslator, protobufPackageName,
          getCacheConfiguration( tableEntityTypeMapping, optionsService, table.getName() )
        );
      }
    }
  }
  for ( IdSourceKeyMetadata iddSourceKeyMetadata : context.getAllIdSourceKeyMetadata() ) {
    if ( !HotRodSequenceCounterHandler.isSequenceGeneratorId( iddSourceKeyMetadata ) ) {
      sd.createSequenceSchemaDefinition( iddSourceKeyMetadata, datastoreProvider.getProtobufPackageName() );
    }
  }
  datastoreProvider.registerSchemaDefinitions( sd, sequences );
}

相关文章