Stormify J
Entry point for Stormify from Java code. Provides CRUD operations, raw SQL queries, stored procedure calls, and transaction management against a javax.sql.DataSource.
StormifyJ stormify = new StormifyJ(hikariDataSource);
stormify.asDefault();
User u = stormify.findById(User.class, 1);From Kotlin code, use Stormify directly.
Constructors
Convenience constructor that accepts any javax.sql.DataSource (HikariCP, plain JDBC driver, etc.).
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.
Single-argument javax.sql.DataSource overload — see the primary one-arg constructor for the rationale.
Types
Properties
Current NamingPolicy. See Stormify.namingPolicy.
The auto-detected SQL dialect for this data source. See Stormify.sqlDialect.
Policy for unmatched result-set columns. See Stormify.unmatchedColumnPolicy.
Functions
Registers the underlying Stormify instance as the library-wide default and caches this wrapper in StormifyJ.getDefault, so Java callers can retrieve the Java-friendly wrapper (not just the raw Stormify) via a single static call. Returns this wrapper for fluent chaining.
Runs block with this wrapper as the default, restoring the previous default when the block exits. Use for scoped overrides such as per-request tenants.
DELETE's the row corresponding to deletedItem using its primary key.
Batch DELETE of items.
Executes an INSERT / UPDATE / DELETE and returns the affected row count.
Returns the detail rows of type detailsClass that reference parent. Use propertyName to disambiguate when the detail class has multiple foreign keys pointing at the same parent type.
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.
Executes a SELECT and returns the rows as a list of baseClass instances.
Executes a SELECT and returns the rows, capturing values from columns named in customFields (e.g. COUNT(*) OVER () AS __total) via the supplied consumers — those columns are not mapped onto the entity. Column names are matched case-insensitively.
Executes a SELECT and streams each row to consumer — avoids materializing the full result.
Streaming variant that captures values from columns named in customFields via the supplied consumers instead of mapping them onto the entity. See the list-returning read overload for the capture semantics.
Runs block inside a database transaction. Commits on return, rolls back on any thrown exception. Inside the block, all CRUD/query calls on this wrapper (e.g. stormify.create(user)) transparently run on the transaction's connection via the ambient transaction registry. Nested calls to this method become savepoints automatically.
Returning variant of transaction — see that method for lifecycle semantics.