public static boolean areEqual(Identifier id1, Identifier id2) { if ( id1 == null ) { return id2 == null; } else { return id1.equals( id2 ); } }
private void bindPhysicalToLogical(Identifier logicalName, String physicalName) throws DuplicateMappingException { final Identifier existingLogicalName = physicalToLogical.put( physicalName, logicalName ); if ( existingLogicalName != null && ! existingLogicalName.equals( logicalName ) ) { throw new DuplicateMappingException( String.format( Locale.ENGLISH, "Table [%s] contains physical column name [%s] referred to by multiple physical " + "column names: [%s], [%s]", tableName, physicalName, logicalName, existingLogicalName ), DuplicateMappingException.Type.COLUMN_BINDING, tableName + "." + physicalName ); } } }
/** * Get the database sequence increment value from the associated {@link SequenceInformation} object. * * @param jdbcEnvironment the current JdbcEnvironment * @param sequenceName sequence name * * @return sequence increment value */ private Long getSequenceIncrementValue(JdbcEnvironment jdbcEnvironment, String sequenceName) { return jdbcEnvironment.getExtractedDatabaseMetaData().getSequenceInformationList().stream().filter( sequenceInformation -> { Identifier catalog = sequenceInformation.getSequenceName().getCatalogName(); Identifier schema = sequenceInformation.getSequenceName().getSchemaName(); return sequenceName.equalsIgnoreCase( sequenceInformation.getSequenceName().getSequenceName().getText() ) && ( catalog == null || catalog.equals( jdbcEnvironment.getCurrentCatalog() ) ) && ( schema == null || schema.equals( jdbcEnvironment.getCurrentSchema() ) ); } ).map( SequenceInformation::getIncrementValue ).findFirst().orElse( null ); } }
TableInformation tableInformation = null; while ( resultSet.next() ) { if ( tableName.equals( Identifier.toIdentifier( resultSet.getString( "TABLE_NAME" ), tableName.isQuoted() ) ) ) { if ( found ) {