RED-8702: Explore document databases to store entityLog
* pmd + checkstyle
This commit is contained in:
parent
13ba9e5f77
commit
9fe3b50fe3
@ -28,8 +28,9 @@ public class MyMongoLiquibaseTest {
|
||||
public void testMongoDB() {
|
||||
|
||||
try (MongoLiquibaseDatabase database = (MongoLiquibaseDatabase) DatabaseFactory.getInstance().openDatabase(URL, USERNAME, PASSWORD, null, null)) {
|
||||
Liquibase liquibase = new Liquibase("mongo/liquibase/test.changelog.xml", new ClassLoaderResourceAccessor(), database);
|
||||
liquibase.update();
|
||||
try (Liquibase liquibase = new Liquibase("mongo/liquibase/test.changelog.xml", new ClassLoaderResourceAccessor(), database)) {
|
||||
liquibase.update();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -292,45 +292,6 @@ public class MyOtherMongoTest {
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* @Configuration
|
||||
* @EnableMongoRepositories
|
||||
* @EnableAutoConfiguration(exclude = {RabbitAutoConfiguration.class})
|
||||
* @Import({LayoutParsingServiceProcessorConfiguration.class})
|
||||
* @ComponentScan(excludeFilters = {@ComponentScan.Filter(type = FilterType.ASSIGNABLE_TYPE)})
|
||||
* public static class MongoTestConfiguration {
|
||||
* @Bean public MongoCustomConversions mongoCustomConversions() {
|
||||
* return new MongoCustomConversions(Arrays.asList(new MongoOffsetDateTimeWriter(), new MongoOffsetDateTimeReader()
|
||||
* ));
|
||||
* }
|
||||
* <p>
|
||||
* <p>
|
||||
* }
|
||||
* <p>
|
||||
* <p>
|
||||
* public static class MongoOffsetDateTimeWriter implements Converter<OffsetDateTime, Document> {
|
||||
* <p>
|
||||
* public static final String DATE_FIELD = "dateTime";
|
||||
* public static final String OFFSET_FIELD = "offset";
|
||||
* @Override public Document convert(final OffsetDateTime offsetDateTime) {
|
||||
* final Document document = new Document();
|
||||
* document.put(DATE_FIELD, Date.from(offsetDateTime.toInstant()));
|
||||
* document.put(OFFSET_FIELD, offsetDateTime.getOffset().toString());
|
||||
* return document;
|
||||
* }
|
||||
* <p>
|
||||
* }
|
||||
* <p>
|
||||
* public static class MongoOffsetDateTimeReader implements Converter<Document, OffsetDateTime> {
|
||||
* @Override public OffsetDateTime convert(final Document document) {
|
||||
* final Date dateTime = document.getDate(MongoOffsetDateTimeWriter.DATE_FIELD);
|
||||
* final ZoneOffset offset = ZoneOffset.of(document.getString(MongoOffsetDateTimeWriter.OFFSET_FIELD));
|
||||
* return OffsetDateTime.ofInstant(dateTime.toInstant(), offset);
|
||||
* }
|
||||
* <p>
|
||||
* }
|
||||
**/
|
||||
|
||||
@Slf4j
|
||||
static class Initializer implements ApplicationContextInitializer<ConfigurableApplicationContext> {
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user