Kotlin API Reference
Storm's Kotlin API is organized into a set of focused modules. Each module has a specific role, from the core ORM engine with coroutine support to Spring Boot auto-configuration and validation. This page provides an overview of the module structure and links to detailed documentation for each concept.
Module Overview
storm-kotlin
The main Kotlin API module. It provides the ORMTemplate interface, extension functions (DataSource.orm, Connection.orm), repository interfaces, coroutine support, and the type-safe query DSL. This is the primary dependency for Kotlin applications.
// Gradle (Kotlin DSL)
implementation("st.orm:storm-kotlin:1.11.0")
<!-- Maven -->
<dependency>
<groupId>st.orm</groupId>
<artifactId>storm-kotlin</artifactId>
<version>1.11.0</version>
</dependency>
The Kotlin API does not depend on any preview features. All APIs are stable and production-ready.
storm-kotlin-spring
Spring Framework integration for Kotlin. Provides RepositoryBeanFactoryPostProcessor for repository auto-discovery and injection, @EnableTransactionIntegration for bridging Storm's programmatic transactions with Spring's @Transactional, and transaction-aware coroutine support. Add this module when you use Spring Framework without Spring Boot.
implementation("st.orm:storm-kotlin-spring:1.11.0")
See Spring Integration for configuration details.
storm-kotlin-spring-boot-starter
Spring Boot auto-configuration for Kotlin. Automatically creates an ORMTemplate bean from the DataSource, discovers repositories, enables transaction integration, and binds storm.* properties from application.yml. This is the recommended dependency for Spring Boot applications.
implementation("st.orm:storm-kotlin-spring-boot-starter:1.11.0")
See Spring Integration: Spring Boot Starter for what the starter provides and how to override its defaults.
Key Classes and Functions
| Class/Function | Description | Guide |
|---|---|---|
ORMTemplate | The central entry point. Create with dataSource.orm or ORMTemplate.of(dataSource). Provides access to entity/projection repositories and the SQL template query engine. | Getting Started |
EntityRepository<E, ID> | Type-safe repository interface for CRUD operations on entities. Extend this interface and add custom query methods with default method bodies. | Repositories |
ProjectionRepository<P, ID> | Read-only repository for projections (subset of entity columns). | Projections |
Entity<ID> | Marker interface for entity data classes. Implement this on your Kotlin data classes to enable repository operations. | Entities |
Projection<ID> | Marker interface for projection data classes. | Projections |
DataSource.orm | Extension property that creates an ORMTemplate from a DataSource. | Getting Started |
transaction { } | Coroutine-aware programmatic transaction block. | Transactions |
transactionBlocking { } | Blocking variant of the programmatic transaction block. | Transactions |
StormConfig | Immutable configuration holder. Pass to dataSource.orm(config) to override defaults. | Configuration |