|
50 | 50 | import org.springframework.data.mapping.context.MappingContext;
|
51 | 51 | import org.springframework.data.projection.ProjectionInformation;
|
52 | 52 | import org.springframework.data.projection.SpelAwareProxyProjectionFactory;
|
| 53 | +import org.springframework.data.r2dbc.convert.R2dbcConverter; |
53 | 54 | import org.springframework.data.r2dbc.dialect.R2dbcDialect;
|
54 | 55 | import org.springframework.data.r2dbc.mapping.OutboundRow;
|
55 | 56 | import org.springframework.data.r2dbc.mapping.event.AfterConvertCallback;
|
@@ -122,6 +123,20 @@ public R2dbcEntityTemplate(org.springframework.data.r2dbc.core.DatabaseClient da
|
122 | 123 | this(databaseClient, getDataAccessStrategy(databaseClient));
|
123 | 124 | }
|
124 | 125 |
|
| 126 | + /** |
| 127 | + * Create a new {@link R2dbcEntityTemplate} given {@link DatabaseClient}, {@link R2dbcDialect} and |
| 128 | + * {@link R2dbcConverter}. |
| 129 | + * |
| 130 | + * @param databaseClient must not be {@literal null}. |
| 131 | + * @param dialect the dialect to use, must not be {@literal null}. |
| 132 | + * @param converter the dialect to use, must not be {@literal null}. |
| 133 | + * @since 1.2 |
| 134 | + */ |
| 135 | + public R2dbcEntityTemplate(org.springframework.r2dbc.core.DatabaseClient databaseClient, R2dbcDialect dialect, |
| 136 | + R2dbcConverter converter) { |
| 137 | + this(databaseClient, new DefaultReactiveDataAccessStrategy(dialect, converter)); |
| 138 | + } |
| 139 | + |
125 | 140 | /**
|
126 | 141 | * Create a new {@link R2dbcEntityTemplate} given {@link DatabaseClient} and {@link ReactiveDataAccessStrategy}.
|
127 | 142 | *
|
@@ -170,6 +185,15 @@ public ReactiveDataAccessStrategy getDataAccessStrategy() {
|
170 | 185 | return this.dataAccessStrategy;
|
171 | 186 | }
|
172 | 187 |
|
| 188 | + /* |
| 189 | + * (non-Javadoc) |
| 190 | + * @see org.springframework.data.r2dbc.core.R2dbcEntityOperations#getConverter() |
| 191 | + */ |
| 192 | + @Override |
| 193 | + public R2dbcConverter getConverter() { |
| 194 | + return this.dataAccessStrategy.getConverter(); |
| 195 | + } |
| 196 | + |
173 | 197 | /*
|
174 | 198 | * (non-Javadoc)
|
175 | 199 | * @see org.springframework.beans.factory.BeanFactoryAware#setBeanFactory(org.springframework.beans.factory.BeanFactory)
|
|
0 commit comments