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; the two share their instances through stormify and the StormifyJ constructor that takes a Stormify.
Constructors
Creates the Stormify instance of dataSource, registering registrars.
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
Rows buffered by the driver per round trip in streaming reads. See Stormify.cursorFetchSize.
What a reference to a missing row does. See Stormify.danglingReferences.
The data source this instance runs its queries on. See Stormify.dataSource.
Whether update writes only the changed columns. See Stormify.dynamicUpdate.
Filter syntax of the facets of lists attached to this instance. See Stormify.filterSyntax.
Default input parser for facet filter values of lists attached to this instance, or null for none. See Stormify.inputParser.
Current NamingPolicy. See Stormify.namingPolicy.
The SQL dialect, auto-detected from the data source on first access. Set it manually when detection cannot see the real database, for example behind a proxy or a pool that hides the driver metadata. See Stormify.sqlDialect.
Text folding of case-insensitive facet filters. See Stormify.textFolding.
Policy for unmatched result-set columns. See Stormify.unmatchedColumnPolicy.
Functions
Registers the underlying Stormify instance as the library-wide default, the one getDefault wraps. Returns this wrapper for fluent chaining.
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. Tables.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.
Creates a PagedQuery of entityClass working on this instance, ready to be configured.
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.
readCursor fetching fetchSize rows per round trip instead of cursorFetchSize; 0 reads the whole result without a cursor.
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.
Streams every row to consumer as an array of its column values. See Stormify.readRowsCursor.
readRowsCursor fetching fetchSize rows per round trip instead of cursorFetchSize; 0 reads the whole result without a cursor. See Stormify.readRowsCursor.
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.