Skip to content

Commit

Permalink
Merge pull request #537 from emmanuelbernard/536
Browse files Browse the repository at this point in the history
Fail explicitly if no `persistence.xml` is present and no dialect can be guessed from the driver
  • Loading branch information
stuartwdouglas authored Jan 16, 2019
2 parents c47abe5 + cc0cab8 commit e2e104a
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -275,7 +275,10 @@ private Optional<String> guessDialect(Optional<String> driver) {
if ( resolvedDriver.contains("org.mariadb.jdbc.Driver")) {
return Optional.of(MariaDB103Dialect.class.getName());
}
return Optional.empty();
String error = driver.isPresent() ?
"Hibernate extension could not guess the dialect from the driver '" + resolvedDriver + "'. Add an explicit 'shamrock.hibernate.dialect' property." :
"Hibernate extension cannot guess the dialect as no JDBC driver is specified by 'shamrock.datasource.driver'";
throw new ConfigurationError(error);
}

private void enhanceEntities(final KnownDomainObjects domainObjects, BuildProducer<BytecodeTransformerBuildItem> transformers) {
Expand Down

0 comments on commit e2e104a

Please sign in to comment.