This commit is contained in:
jamesagnew
2018-12-10 05:50:48 -05:00
parent 76f9a2f0f3
commit 18c85900e5
2 changed files with 25 additions and 2 deletions

11
pom.xml
View File

@@ -11,7 +11,7 @@
<parent> <parent>
<groupId>ca.uhn.hapi.fhir</groupId> <groupId>ca.uhn.hapi.fhir</groupId>
<artifactId>hapi-fhir</artifactId> <artifactId>hapi-fhir</artifactId>
<version>3.6.0</version> <version>3.7.0-SNAPSHOT</version>
</parent> </parent>
<groupId>ca.uhn.hapi.fhir.demo</groupId> <groupId>ca.uhn.hapi.fhir.demo</groupId>
@@ -255,6 +255,15 @@
</configuration> </configuration>
</plugin> </plugin>
<!-- This plugin is just a part of the HAPI internal build process, you do not need to incude it in your own projects -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-deploy-plugin</artifactId>
<configuration>
<skip>true</skip>
</configuration>
</plugin>
<!-- This is to run the integration tests --> <!-- This is to run the integration tests -->
<plugin> <plugin>
<groupId>org.apache.maven.plugins</groupId> <groupId>org.apache.maven.plugins</groupId>

View File

@@ -5,6 +5,7 @@ import java.util.Properties;
import javax.persistence.EntityManagerFactory; import javax.persistence.EntityManagerFactory;
import javax.sql.DataSource; import javax.sql.DataSource;
import ca.uhn.fhir.jpa.search.DatabaseBackedPagingProvider;
import ca.uhn.fhir.jpa.search.LuceneSearchMappingFactory; import ca.uhn.fhir.jpa.search.LuceneSearchMappingFactory;
import ca.uhn.fhir.jpa.util.DerbyTenSevenHapiFhirDialect; import ca.uhn.fhir.jpa.util.DerbyTenSevenHapiFhirDialect;
import org.apache.commons.dbcp2.BasicDataSource; import org.apache.commons.dbcp2.BasicDataSource;
@@ -41,6 +42,19 @@ public class FhirServerConfig extends BaseJavaConfigDstu3 {
return retVal; return retVal;
} }
/**
* We override the paging provider definition so that we can customize
* the default/max page sizes for search results. You can set these however
* you want, although very large page sizes will require a lot of RAM.
*/
@Override
public DatabaseBackedPagingProvider databaseBackedPagingProvider() {
DatabaseBackedPagingProvider pagingProvider = super.databaseBackedPagingProvider();
pagingProvider.setDefaultPageSize(20);
pagingProvider.setMaximumPageSize(200);
return pagingProvider;
}
/** /**
* The following bean configures the database connection. The 'url' property value of "jdbc:derby:directory:jpaserver_derby_files;create=true" indicates that the server should save resources in a * The following bean configures the database connection. The 'url' property value of "jdbc:derby:directory:jpaserver_derby_files;create=true" indicates that the server should save resources in a
* directory called "jpaserver_derby_files". * directory called "jpaserver_derby_files".
@@ -70,7 +84,7 @@ public class FhirServerConfig extends BaseJavaConfigDstu3 {
private Properties jpaProperties() { private Properties jpaProperties() {
Properties extraProperties = new Properties(); Properties extraProperties = new Properties();
extraProperties.put("hibernate.dialect", DerbyTenSevenHapiFhirDialect.class.getName()); extraProperties.put("hibernate.dialect", DerbyTenSevenHapiFhirDialect.class.getName());
extraProperties.put("hibernate.format_sql", "true"); extraProperties.put("hibernate.format_sql", "false");
extraProperties.put("hibernate.show_sql", "false"); extraProperties.put("hibernate.show_sql", "false");
extraProperties.put("hibernate.hbm2ddl.auto", "update"); extraProperties.put("hibernate.hbm2ddl.auto", "update");
extraProperties.put("hibernate.jdbc.batch_size", "20"); extraProperties.put("hibernate.jdbc.batch_size", "20");