Stormify
The main ORM controller. Entry point for all database operations.
Configuration lifecycle
A Stormify instance is designed to be configured once, then shared across threads. The intended usage is:
Construct the instance (optionally passing registrars).
Apply configuration — assign to namingPolicy, unmatchedColumnPolicy, logger, filterSyntax, inputParser; call addBlacklistField, registerPrimaryKeyResolver, etc.
Publish the instance to whoever needs it (DI container,
asDefault(), dependency parameter, …) and start issuing queries.
After step 3, treat all configuration as frozen. Mutating configuration while other threads are executing queries is not supported — behaviour is undefined and any entity metadata already cached will not reflect the change. The query path itself (CRUD, read, findAll, stored procedures, transactions) is safe to call concurrently from many threads on a fully-configured instance.
Parameters
the data source for all database operations
optional entity registrars to register at construction time
tuning for the connection pool behind suspending. The defaults are sensible for most applications — see PoolConfig for the double-pooling warning when dataSource already pools (e.g. HikariCP).
Constructors
Single-argument convenience constructor. Exists primarily so Spring XML <constructor-arg ref="dataSource"/> (and similar DI containers that resolve constructors by arity) can pick an unambiguous one-arg match.
Convenience constructor with pool tuning and no registrars.
Types
Holds the library-wide defaultInstance used when no instance is explicitly attached.
Properties
How many rows the driver buffers per round-trip during streaming reads. Used by readCursor on every dialect, and additionally by the eager read path on Oracle, whose driver default would otherwise turn a bulk read into a round-trip storm.
The filter syntax used by facets on this instance. Controls which tokens represent OR, NOT, NULL, phrase delimiters, grouping, and wildcards. Default is Google-like syntax: OR, -, NULL, ", (), *.
Default input parser for facet filter values. Applied after per-facet and per-list parsers in the resolution chain. Use for locale-aware number/date parsing across all facets.
The naming policy used to convert Kotlin property names to database column names. Default is NamingPolicy.LOWER_CASE_WITH_UNDERSCORES (snake_case). Changing this only affects entities resolved after the change.
The SQL dialect used by this Stormify instance. Auto-detected from the data source on first access. Can be set manually for proxy scenarios where auto-detection fails.
The coroutine-aware API of this instance, backed by a single connection pool created lazily on first access with poolConfig.
Policy for ResultSet columns that have no matching field on the target entity. Default is UnmatchedColumnPolicy.IGNORE.
Functions
Excludes a field name from all entity mappings (e.g. inherited fields that have no database column).
Closes the suspending connection pool if it was ever created; a no-op otherwise. Use this in shutdown hooks where touching suspending just to close it would needlessly spin up a pool.
Executes an SQL UPDATE/INSERT/DELETE and returns the number of affected rows.
Retrieves all detail (child) entities related to a parent entity through a foreign key.
Type-safe variant of getDetails that accepts an annotation-processor-generated reference path (e.g. Paths.AuditEntry_.createdBy) instead of a string. The compiler guarantees the referenced property exists on the child type, so typos and renames surface at build time rather than on first query.
Removes a previously blacklisted field name, allowing it to be mapped again.
Executes block within a database transaction with automatic commit on success and rollback on any thrown exception, returning the block's result.