|
|
|
@ -99,12 +99,10 @@ public enum EmbeddedDatabaseConnection {
|
|
|
|
|
*/
|
|
|
|
|
public static boolean isEmbedded(ConnectionFactory connectionFactory) {
|
|
|
|
|
OptionsCapableConnectionFactory optionsCapable = OptionsCapableConnectionFactory.unwrapFrom(connectionFactory);
|
|
|
|
|
if (optionsCapable == null) {
|
|
|
|
|
throw new IllegalArgumentException(
|
|
|
|
|
"Cannot determine database's type as ConnectionFactory is not options-capable. To be "
|
|
|
|
|
+ "options-capable, a ConnectionFactory should be created with "
|
|
|
|
|
+ ConnectionFactoryBuilder.class.getName());
|
|
|
|
|
}
|
|
|
|
|
Assert.notNull(optionsCapable,
|
|
|
|
|
() -> "Cannot determine database's type as ConnectionFactory is not options-capable. To be "
|
|
|
|
|
+ "options-capable, a ConnectionFactory should be created with "
|
|
|
|
|
+ ConnectionFactoryBuilder.class.getName());
|
|
|
|
|
ConnectionFactoryOptions options = optionsCapable.getOptions();
|
|
|
|
|
for (EmbeddedDatabaseConnection candidate : values()) {
|
|
|
|
|
if (candidate.embedded.test(options)) {
|
|
|
|
|