Search in sources :

Example 1 with JdbcArrayColumns

use of org.springframework.data.jdbc.core.dialect.JdbcArrayColumns in project spring-data-jdbc by spring-projects.

the class AbstractJdbcConfiguration method jdbcConverter.

/**
 * Creates a {@link RelationalConverter} using the configured
 * {@link #jdbcMappingContext(Optional, JdbcCustomConversions)}. Will get {@link #jdbcCustomConversions()} ()}
 * applied.
 *
 * @see #jdbcMappingContext(Optional, JdbcCustomConversions)
 * @see #jdbcCustomConversions()
 * @return must not be {@literal null}.
 */
@Bean
public JdbcConverter jdbcConverter(JdbcMappingContext mappingContext, NamedParameterJdbcOperations operations, @Lazy RelationResolver relationResolver, JdbcCustomConversions conversions, Dialect dialect) {
    JdbcArrayColumns arrayColumns = dialect instanceof JdbcDialect ? ((JdbcDialect) dialect).getArraySupport() : JdbcArrayColumns.DefaultSupport.INSTANCE;
    DefaultJdbcTypeFactory jdbcTypeFactory = new DefaultJdbcTypeFactory(operations.getJdbcOperations(), arrayColumns);
    return new BasicJdbcConverter(mappingContext, relationResolver, conversions, jdbcTypeFactory, dialect.getIdentifierProcessing());
}
Also used : BasicJdbcConverter(org.springframework.data.jdbc.core.convert.BasicJdbcConverter) JdbcArrayColumns(org.springframework.data.jdbc.core.dialect.JdbcArrayColumns) DefaultJdbcTypeFactory(org.springframework.data.jdbc.core.convert.DefaultJdbcTypeFactory) JdbcDialect(org.springframework.data.jdbc.core.dialect.JdbcDialect) Bean(org.springframework.context.annotation.Bean)

Aggregations

Bean (org.springframework.context.annotation.Bean)1 BasicJdbcConverter (org.springframework.data.jdbc.core.convert.BasicJdbcConverter)1 DefaultJdbcTypeFactory (org.springframework.data.jdbc.core.convert.DefaultJdbcTypeFactory)1 JdbcArrayColumns (org.springframework.data.jdbc.core.dialect.JdbcArrayColumns)1 JdbcDialect (org.springframework.data.jdbc.core.dialect.JdbcDialect)1