org.springframework.data.relational.core.mapping.RelationalMappingContext Java Examples

The following examples show how to use org.springframework.data.relational.core.mapping.RelationalMappingContext. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: InfrastructureConfiguration.java    From Hands-On-Reactive-Programming-in-Spring-5 with MIT License 6 votes vote down vote up
BookRepository customerRepository2(PostgresqlConnectionFactory factory) {
   TransactionalDatabaseClient txClient =
      TransactionalDatabaseClient.builder()
         .connectionFactory(factory)
         .build();
   RelationalMappingContext context = new RelationalMappingContext();
   return new R2dbcRepositoryFactory(txClient, context)
      .getRepository(BookRepository.class);
}
 
Example #2
Source File: PostgresAutoConfiguration.java    From vertx-spring-boot with Apache License 2.0 5 votes vote down vote up
@Bean
public SimpleReactivePostgresTemplate reactivePostgresTemplate(Vertx vertx) {
    PgConnectOptions connectOptions = new PgConnectOptions()
        .setUser("sa")
        .setPassword("sa")
        .setDatabase("sa");
    PoolOptions poolOptions = new PoolOptions();
    PgPool pgPool = PgPool.pool(new io.vertx.axle.core.Vertx(vertx), connectOptions, poolOptions);

    BasicRelationalConverter converter = new BasicRelationalConverter(new RelationalMappingContext());
    ColumnEntityWriter entityWriter = new ColumnEntityWriter(converter);

    return new SimpleReactivePostgresTemplate(pgPool, entityWriter, converter);
}
 
Example #3
Source File: QuerydslJdbcRepositoryFactory.java    From infobip-spring-data-querydsl with Apache License 2.0 5 votes vote down vote up
public QuerydslJdbcRepositoryFactory(DataAccessStrategy dataAccessStrategy,
                                     RelationalMappingContext context,
                                     JdbcConverter converter,
                                     Dialect dialect, ApplicationEventPublisher publisher,
                                     NamedParameterJdbcOperations operations,
                                     SQLQueryFactory sqlQueryFactory) {
    super(dataAccessStrategy, context, converter, dialect, publisher, operations);
    this.publisher = publisher;
    this.context = context;
    this.converter = converter;
    this.accessStrategy = dataAccessStrategy;
    this.sqlQueryFactory = sqlQueryFactory;
}
 
Example #4
Source File: InfrastructureConfiguration.java    From Hands-On-Reactive-Programming-in-Spring-5 with MIT License 4 votes vote down vote up
@Bean
R2dbcRepositoryFactory repositoryFactory(DatabaseClient client) {
   RelationalMappingContext context = new RelationalMappingContext();
   return new R2dbcRepositoryFactory(client, context);
}
 
Example #5
Source File: ReactiveDbApplication.java    From Spring5Tutorial with GNU Lesser General Public License v3.0 4 votes vote down vote up
@Bean
public R2dbcRepositoryFactory factory(DatabaseClient client) {
	RelationalMappingContext context = new RelationalMappingContext();
    context.afterPropertiesSet();
    return new R2dbcRepositoryFactory(client, context);
}
 
Example #6
Source File: QuerydslJdbcRepositoryFactoryBean.java    From infobip-spring-data-querydsl with Apache License 2.0 4 votes vote down vote up
@Autowired
protected void setMappingContext(RelationalMappingContext mappingContext) {

    super.setMappingContext(mappingContext);
    this.mappingContext = mappingContext;
}