Example usage for org.springframework.boot.jdbc DatabaseDriver UNKNOWN

List of usage examples for org.springframework.boot.jdbc DatabaseDriver UNKNOWN

Introduction

In this page you can find the example usage for org.springframework.boot.jdbc DatabaseDriver UNKNOWN.

Prototype

DatabaseDriver UNKNOWN

To view the source code for org.springframework.boot.jdbc DatabaseDriver UNKNOWN.

Click Source Link

Document

Unknown type.

Usage

From source file:org.jboss.forge.addon.springboot.commands.jpa.SpringBootJPASetupWizard.java

@Override
public void validate(UIValidationContext validator) {
    final DatabaseType database = dbType.getValue();
    final DatabaseDriver driver = DatabaseDriver.fromProductName(database.name());
    if (driver.equals(DatabaseDriver.UNKNOWN)) {
        // Spring Boot doesn't know about this DB
        validator.addValidationError(dbType, "Spring Boot doesn't know about DB '" + dbType.getName() + "'");
    }/*from  www. j av  a2 s  .c  o  m*/

    if (isNotEmbeddedDB(database) && !databaseURL.hasValue() && !dataSourceName.hasValue()) {
        validator.addValidationError(dataSourceName, "Either DataSource name or database URL is required");
        validator.addValidationError(databaseURL, "Either DataSource name or database URL is required");
    }
}