|
10 | 10 | import static com.yahoo.elide.annotation.LifeCycleHookBinding.TransactionPhase.PRESECURITY; |
11 | 11 |
|
12 | 12 | import com.yahoo.elide.Elide; |
| 13 | +import com.yahoo.elide.ElideSettings; |
| 14 | +import com.yahoo.elide.ElideSettingsBuilder; |
13 | 15 | import com.yahoo.elide.async.hooks.ExecuteQueryHook; |
14 | 16 | import com.yahoo.elide.async.hooks.UpdatePrincipalNameHook; |
15 | 17 | import com.yahoo.elide.async.models.AsyncQuery; |
|
27 | 29 | import org.springframework.context.annotation.Bean; |
28 | 30 | import org.springframework.context.annotation.Configuration; |
29 | 31 |
|
| 32 | +import java.util.TimeZone; |
| 33 | + |
30 | 34 | /** |
31 | 35 | * Async Configuration For Elide Services. Override any of the beans (by defining your own) |
32 | 36 | * and setting flags to disable in properties to change the default behavior. |
@@ -88,6 +92,13 @@ public AsyncCleanerService buildAsyncCleanerService(Elide elide, ElideConfigProp |
88 | 92 | @ConditionalOnMissingBean |
89 | 93 | @ConditionalOnProperty(prefix = "elide.async", name = "defaultAsyncQueryDAO", matchIfMissing = true) |
90 | 94 | public AsyncQueryDAO buildAsyncQueryDAO(Elide elide) { |
91 | | - return new DefaultAsyncQueryDAO(elide, elide.getDataStore()); |
| 95 | + // Creating a new ElideSettings and Elide object for Async services |
| 96 | + // which will have ISO8601 Dates. Used for DefaultAsyncQueryDAO. |
| 97 | + ElideSettings asyncElideSettings = new ElideSettingsBuilder(elide.getDataStore()) |
| 98 | + .withEntityDictionary(elide.getElideSettings().getDictionary()) |
| 99 | + .withISO8601Dates("yyyy-MM-dd'T'HH:mm'Z'", TimeZone.getTimeZone("UTC")) |
| 100 | + .build(); |
| 101 | + Elide asyncElide = new Elide(asyncElideSettings); |
| 102 | + return new DefaultAsyncQueryDAO(asyncElide, asyncElide.getDataStore()); |
92 | 103 | } |
93 | 104 | } |
0 commit comments