public Namespace locateNamespace(Identifier catalogName, Identifier schemaName) { if ( catalogName == null && schemaName == null ) { return getDefaultNamespace(); } final Namespace.Name name = new Namespace.Name( catalogName, schemaName ); Namespace namespace = namespaceMap.get( name ); if ( namespace == null ) { namespace = makeNamespace( name ); } return namespace; }
public Namespace adjustDefaultNamespace(Identifier catalogName, Identifier schemaName) { final Namespace.Name name = new Namespace.Name( catalogName, schemaName ); if ( implicitNamespace.getName().equals( name ) ) { return implicitNamespace; } Namespace namespace = namespaceMap.get( name ); if ( namespace == null ) { namespace = makeNamespace( name ); } implicitNamespace = namespace; return implicitNamespace; }
public Database(MetadataBuildingOptions buildingOptions, JdbcEnvironment jdbcEnvironment) { this.serviceRegistry = buildingOptions.getServiceRegistry(); this.jdbcEnvironment = jdbcEnvironment; this.physicalNamingStrategy = buildingOptions.getPhysicalNamingStrategy(); this.dialect = determineDialect( buildingOptions ); this.implicitNamespace = makeNamespace( new Namespace.Name( toIdentifier( buildingOptions.getMappingDefaults().getImplicitCatalogName() ), toIdentifier( buildingOptions.getMappingDefaults().getImplicitSchemaName() ) ) ); }
public MappedNamespace locateNamespace(NamespaceName name) { if ( name.getCatalog() == null && name.getSchema() == null ) { return getDefaultNamespace(); } return namespaceMap.computeIfAbsent( name, n -> makeNamespace( name ) ); }
public MappedNamespace adjustDefaultNamespace(Identifier catalogName, Identifier schemaName) { final NamespaceName name = new NamespaceName( catalogName, schemaName ); if ( implicitNamespace.getName().equals( name ) ) { return implicitNamespace; } MappedNamespace namespace = namespaceMap.get( name ); if ( namespace == null ) { namespace = makeNamespace( name ); } implicitNamespace = namespace; return implicitNamespace; }
public Database(MetadataBuildingOptions buildingOptions, JdbcEnvironment jdbcEnvironment) { this.jdbcEnvironment = jdbcEnvironment; this.dialect = determineDialect( buildingOptions ); this.implicitNamespace = makeNamespace( new NamespaceName( toIdentifier( buildingOptions.getMappingDefaults().getImplicitCatalogName() ), toIdentifier( buildingOptions.getMappingDefaults().getImplicitSchemaName() ) ) ); }