Tabnine Logo
InFlightMetadataCollectorImpl.getDatabase
Code IndexAdd Tabnine to your IDE (free)

How to use
getDatabase
method
in
org.hibernate.boot.internal.InFlightMetadataCollectorImpl

Best Java code snippets using org.hibernate.boot.internal.InFlightMetadataCollectorImpl.getDatabase (Showing top 20 results out of 315)

origin: hibernate/hibernate-orm

@Override
public void addTableNameBinding(String schema, String catalog, String logicalName, String realTableName, Table denormalizedSuperTable) {
  final Identifier logicalNameIdentifier = getDatabase().toIdentifier( logicalName );
  final Identifier physicalNameIdentifier = getDatabase().toIdentifier( realTableName );
  logicalToPhysicalTableNameMap.put( logicalNameIdentifier, physicalNameIdentifier );
  physicalToLogicalTableNameMap.put( physicalNameIdentifier, logicalNameIdentifier );
}
origin: hibernate/hibernate-orm

@Override
public void addAuxiliaryDatabaseObject(AuxiliaryDatabaseObject auxiliaryDatabaseObject) {
  getDatabase().addAuxiliaryDatabaseObject( auxiliaryDatabaseObject );
}
origin: hibernate/hibernate-orm

@Override
public java.util.Collection<Table> collectTableMappings() {
  ArrayList<Table> tables = new ArrayList<>();
  for ( Namespace namespace : getDatabase().getNamespaces() ) {
    tables.addAll( namespace.getTables() );
  }
  return tables;
}
origin: hibernate/hibernate-orm

private List<Identifier> toIdentifiers(String[] names) {
  if ( names == null ) {
    return Collections.emptyList();
  }
  final List<Identifier> columnNames = CollectionHelper.arrayList( names.length );
  for ( String name : names ) {
    columnNames.add( getDatabase().toIdentifier( name ) );
  }
  return columnNames;
}
origin: hibernate/hibernate-orm

@SuppressWarnings("unchecked")
private List<Identifier> extractColumnNames(List columns) {
  if ( columns == null || columns.isEmpty() ) {
    return Collections.emptyList();
  }
  final List<Identifier> columnNames = CollectionHelper.arrayList( columns.size() );
  for ( Column column : (List<Column>) columns ) {
    columnNames.add( getDatabase().toIdentifier( column.getQuotedName() ) );
  }
  return columnNames;
}
origin: hibernate/hibernate-orm

@Override
public void addColumnNameBinding(Table table, String logicalName, Column column) throws DuplicateMappingException {
  addColumnNameBinding( table, getDatabase().toIdentifier( logicalName ), column );
}
origin: hibernate/hibernate-orm

@Override
public String getLogicalColumnName(Table table, String physicalName) throws MappingException {
  return getLogicalColumnName( table, getDatabase().toIdentifier( physicalName ) );
}
origin: hibernate/hibernate-orm

@Override
public String getPhysicalTableName(String logicalName) {
  return getPhysicalTableName( getDatabase().toIdentifier( logicalName ) );
}
origin: hibernate/hibernate-orm

@Override
public String getPhysicalColumnName(Table table, String logicalName) throws MappingException {
  return getPhysicalColumnName( table, getDatabase().toIdentifier( logicalName ) );
}
origin: hibernate/hibernate-orm

public InFlightMetadataCollectorImpl(
    BootstrapContext bootstrapContext,
    MetadataBuildingOptions options) {
  this.bootstrapContext = bootstrapContext;
  this.uuid = UUID.randomUUID();
  this.options = options;
  this.identifierGeneratorFactory = options.getServiceRegistry()
      .getService( MutableIdentifierGeneratorFactory.class );
  for ( Map.Entry<String, SQLFunction> sqlFunctionEntry : bootstrapContext.getSqlFunctions().entrySet() ) {
    if ( sqlFunctionMap == null ) {
      // we need this to be a ConcurrentHashMap for the one we ultimately pass along to the SF
      // but is this the reference that gets passed along?
      sqlFunctionMap = new ConcurrentHashMap<>( 16, .75f, 1 );
    }
    sqlFunctionMap.put( sqlFunctionEntry.getKey(), sqlFunctionEntry.getValue() );
  }
  bootstrapContext.getAuxiliaryDatabaseObjectList().forEach( getDatabase()::addAuxiliaryDatabaseObject );
}
origin: hibernate/hibernate-orm

  String subselectFragment,
  boolean isAbstract) {
final Namespace namespace = getDatabase().locateNamespace(
    getDatabase().toIdentifier( catalogName ),
    getDatabase().toIdentifier( schemaName )
);
  logicalName = getDatabase().toIdentifier( name );
origin: hibernate/hibernate-orm

  String subselectFragment,
  Table includedTable) throws DuplicateMappingException {
final Namespace namespace = getDatabase().locateNamespace(
    getDatabase().toIdentifier( catalogName ),
    getDatabase().toIdentifier( schemaName )
);
  logicalName = getDatabase().toIdentifier( name );
origin: hibernate/hibernate-orm

public void addBinding(Identifier logicalName, Column physicalColumn) {
  final String physicalNameString = physicalColumn.getQuotedName( getDatabase().getJdbcEnvironment().getDialect() );
  bindLogicalToPhysical( logicalName, physicalNameString );
  bindPhysicalToLogical( logicalName, physicalNameString );
}
origin: hibernate/hibernate-orm

@Override
public String getLogicalColumnName(Table table, Identifier physicalName) throws MappingException {
  final String physicalNameString = physicalName.render( getDatabase().getJdbcEnvironment().getDialect() );
  Identifier logicalName = null;
  Table currentTable = table;
  while ( currentTable != null ) {
    final TableColumnNameBinding binding = columnNameBindingByTableMap.get( currentTable );
    if ( binding != null ) {
      logicalName = binding.physicalToLogical.get( physicalNameString );
      if ( logicalName != null ) {
        break;
      }
    }
    if ( DenormalizedTable.class.isInstance( currentTable ) ) {
      currentTable = ( (DenormalizedTable) currentTable ).getIncludedTable();
    }
    else {
      currentTable = null;
    }
  }
  if ( logicalName == null ) {
    throw new MappingException(
        "Unable to find column with physical name " + physicalNameString + " in table " + table.getName()
    );
  }
  return logicalName.render();
}
origin: hibernate/hibernate-orm

private void processExportableProducers() {
  // for now we only handle id generators as ExportableProducers
  final Dialect dialect = getDatabase().getJdbcEnvironment().getDialect();
  final String defaultCatalog = extractName( getDatabase().getDefaultNamespace().getName().getCatalog(), dialect );
  final String defaultSchema = extractName( getDatabase().getDefaultNamespace().getName().getSchema(), dialect );
  for ( PersistentClass entityBinding : entityBindingMap.values() ) {
    if ( entityBinding.isInherited() ) {
      continue;
    }
    handleIdentifierValueBinding(
        entityBinding.getIdentifier(),
        dialect,
        defaultCatalog,
        defaultSchema,
        (RootClass) entityBinding
    );
  }
  for ( Collection collection : collectionBindingMap.values() ) {
    if ( !IdentifierCollection.class.isInstance( collection ) ) {
      continue;
    }
    handleIdentifierValueBinding(
        ( (IdentifierCollection) collection ).getIdentifier(),
        dialect,
        defaultCatalog,
        defaultSchema,
        null
    );
  }
}
origin: hibernate/hibernate-orm

private void handleIdentifierValueBinding(
    KeyValue identifierValueBinding,
    Dialect dialect,
    String defaultCatalog,
    String defaultSchema,
    RootClass entityBinding) {
  // todo : store this result (back into the entity or into the KeyValue, maybe?)
  // 		This process of instantiating the id-generator is called multiple times.
  //		It was done this way in the old code too, so no "regression" here; but
  //		it could be done better
  try {
    final IdentifierGenerator ig = identifierValueBinding.createIdentifierGenerator(
        getIdentifierGeneratorFactory(),
        dialect,
        defaultCatalog,
        defaultSchema,
        entityBinding
    );
    if ( ig instanceof ExportableProducer ) {
      ( (ExportableProducer) ig ).registerExportables( getDatabase() );
    }
  }
  catch (MappingException e) {
    // ignore this for now.  The reasoning being "non-reflective" binding as needed
    // by tools.  We want to hold off requiring classes being present until we
    // try to build a SF.  Here, just building the Metadata, it is "ok" for an
    // exception to occur, the same exception will happen later as we build the SF.
    log.debugf( "Ignoring exception thrown when trying to build IdentifierGenerator as part of Metadata building", e );
  }
}
origin: hibernate/hibernate-orm

keyName = keyNameIdentifier.render( getDatabase().getJdbcEnvironment().getDialect() );
keyName = keyNameIdentifier.render( getDatabase().getJdbcEnvironment().getDialect() );
origin: hibernate/hibernate-orm

    namedEntityGraphMap,
    sqlFunctionMap,
    getDatabase(),
    bootstrapContext
);
origin: hibernate/hibernate-orm

fk.setName( nameIdentifier.render( getDatabase().getJdbcEnvironment().getDialect() ) );
origin: org.hibernate.orm/hibernate-core

private List<Identifier> toIdentifiers(String[] names) {
  if ( names == null ) {
    return Collections.emptyList();
  }
  final List<Identifier> columnNames = CollectionHelper.arrayList( names.length );
  for ( String name : names ) {
    columnNames.add( getDatabase().toIdentifier( name ) );
  }
  return columnNames;
}
org.hibernate.boot.internalInFlightMetadataCollectorImplgetDatabase

Popular methods of InFlightMetadataCollectorImpl

  • <init>
  • buildMetadataInstance
    Builds the complete and immutable Metadata instance from the collected info.
  • processSecondPasses
    Ugh! But we need this done before we ask Envers to produce its entities.
  • addClassType
  • addCopyIdentifierComponentSecondPass
  • addCreateKeySecondPass
  • addDelayedPropertyReferenceHandler
  • addFkSecondPass
  • addIdGeneratorResolverSecondPass
  • addIdentifierGenerator
  • addImplicitColumnNamingSecondPass
  • addNamedProcedureCallDefinition
  • addImplicitColumnNamingSecondPass,
  • addNamedProcedureCallDefinition,
  • addPkDrivenByDefaultMapsIdSecondPass,
  • addQuerySecondPass,
  • addSecondPass,
  • addSecondaryTableSecondPass,
  • addSetSimpleValueTypeSecondPass,
  • addUniqueConstraintHolders,
  • applyNamedNativeQuery,
  • applyResultSetMapping

Popular in Java

  • Reactive rest calls using spring rest template
  • getSupportFragmentManager (FragmentActivity)
  • getSystemService (Context)
  • getExternalFilesDir (Context)
  • BufferedWriter (java.io)
    Wraps an existing Writer and buffers the output. Expensive interaction with the underlying reader is
  • FileNotFoundException (java.io)
    Thrown when a file specified by a program cannot be found.
  • List (java.util)
    An ordered collection (also known as a sequence). The user of this interface has precise control ove
  • PriorityQueue (java.util)
    A PriorityQueue holds elements on a priority heap, which orders the elements according to their natu
  • Scanner (java.util)
    A parser that parses a text string of primitive types and strings with the help of regular expressio
  • TimeUnit (java.util.concurrent)
    A TimeUnit represents time durations at a given unit of granularity and provides utility methods to
  • Top plugins for WebStorm
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now