JEHibernate is configured either programmatically with a builder or from a properties file an admin can edit without recompiling. HikariCP is the connection pool, owned and bounded by JEHibernate.
Other builder methods: property(key, value) for any raw hibernate.* setting, namingStrategy(...), pool(PoolConfig) for full pool control, dataSource(DataSource) to reuse an external pool, migration(MigrationConfig), multiTenancy(...), enableAudit(), and enableSecondLevelCache().
Properties file
Load from the classpath, filesystem, or a plugin data folder. Admins switch databases by editing one file.
The property prefix is the database type: {prefix}.url, {prefix}.username, {prefix}.password, and optional {prefix}.driver / {prefix}.dialect to override the auto-detected defaults.
The connection pool
HikariCP is the default. JEHibernate owns the DataSource and hands it to Hibernate, so the pool is real and bounded — no silent "internal pool exhausted" behaviour under load. Tune it with a PoolConfig:
The legacy connectionPool(minIdle, maxSize) still works and maps onto PoolConfig.
Reading pool health
Surface these on an admin command or a metrics endpoint to see saturation before it bites.
Reusing an existing DataSource
In Spring, or anywhere a pool already exists, hand it to JEHibernate instead of creating a second one. JEHibernate will not close a pool it does not own.
ddl-auto defaults to validate
Since 4.0, schema is owned by migrations. If you want Hibernate to manage DDL instead, set ddlAuto("update") explicitly or disable migrations. See Migrations.
var jeh = JEHibernate.fromProperties("hibernate.properties"); // classpath/filesystem
var jeh = JEHibernate.fromProperties(getDataFolder(), "database", "hibernate.properties"); // plugin
database.type=POSTGRESQL
postgresql.url=jdbc:postgresql://localhost:5432/app
postgresql.username=app
postgresql.password=secret
# Any hibernate.* key passes straight through:
hibernate.hbm2ddl.auto=validate
hibernate.show_sql=false
# Pool tuning via jehibernate.pool.*:
jehibernate.pool.maximumPoolSize=10
jehibernate.pool.minimumIdle=2
PoolHealth h = jeHibernate.getPoolHealth();
// h.active(), h.idle(), h.total(), h.threadsAwaiting(), h.available()
DataSource ds = jeHibernate.getDataSource(); // the owned pool, if you need it