This commit is contained in:
James Agnew
2025-06-02 18:03:26 +02:00
parent 9ecffeda11
commit b695610178
2 changed files with 14 additions and 3 deletions

View File

@@ -27,7 +27,8 @@ public class JpaHibernatePropertiesProvider extends HibernatePropertiesProvider
if (isNotBlank(dialectClass)) {
myDialect = ReflectionUtil.newInstanceOrReturnNull(dialectClass, Dialect.class);
} else {
ourLog.warn("'hibernate.dialect' not set in application configuration! Please explicitly specify a valid HAPI FHIR hibernate dialect.");
ourLog.warn(
"'hibernate.dialect' not set in application configuration! Please explicitly specify a valid HAPI FHIR hibernate dialect.");
DataSource connection = theEntityManagerFactory.getDataSource();
try (Connection dbConnection = connection.getConnection()) {
myDialect = new StandardDialectResolver()

View File

@@ -1,6 +1,8 @@
package ca.uhn.fhir.jpa.starter;
import ca.uhn.fhir.context.FhirContext;
import ca.uhn.fhir.jpa.config.HibernatePropertiesProvider;
import ca.uhn.fhir.jpa.model.dialect.HapiFhirH2Dialect;
import ca.uhn.fhir.jpa.searchparam.config.NicknameServiceConfig;
import ca.uhn.fhir.jpa.starter.cr.CrProperties;
import ca.uhn.fhir.model.primitive.IdDt;
@@ -80,6 +82,9 @@ class ExampleServerR4IT implements IServerSupport {
@Autowired
private CrProperties crProperties;
@Autowired
private HibernatePropertiesProvider myHibernatePropertiesProvider;
@LocalServerPort
private int port;
@@ -367,6 +372,11 @@ class ExampleServerR4IT implements IServerSupport {
Parameters localResult = ourClient.operation().onType(CodeSystem.class).named("$validate-code").withParameter(Parameters.class, "url", new UrlType(testCodeSystem)).andParameter("coding", new Coding(testCodeSystem, "yes", null)).execute();
}
@Test
public void testHibernatePropertiesProvider_GetDialect() {
assertEquals(HapiFhirH2Dialect.class, myHibernatePropertiesProvider.getDialect().getClass());
}
@BeforeEach
void beforeEach() {