Exhaustive Mansart reference. For onboarding, see Getting started. For everyday patterns, see Usage.

Maven artefacts

Artefact Role

io.vidocq.mansart:mansart-data-core

Runtime: RepositoryRuntime, query execution, ResultSet mapping. Annotations come from the standard jakarta.data-api / jakarta.persistence-api.

io.vidocq.mansart:mansart-data-cdi

CDI 4.1 Lite bootstrap (BCE): @Repository beans, RepositoryRuntime producer, dataStore routing.

io.vidocq.mansart:mansart-data-dialect-h2 / mansart-data-dialect-postgresql

Shipped SQL dialects (mansart-data-dialect-spi is pulled transitively).

io.vidocq.mansart:mansart-data-processor

APT — static metamodel + *RepositoryImpl generation. Declare under <annotationProcessorPaths>.

io.vidocq.mansart:mansart-data-dialect-spi

Dialect SPI (Dialect, DialectFactory, neutral query AST).

io.vidocq.mansart:mansart-data-dialect-h2

H2 dialect (test reference + embedded).

io.vidocq.mansart:mansart-data-dialect-postgresql

PostgreSQL dialect (production target).

io.vidocq.mansart:mansart-data-cdi

CDI 4.1 bootstrap — Vauban-compatible BCE that discovers @Repository via META-INF/mansart-repositories.list.

io.vidocq.mansart:mansart-pool-api

Pool public API: PoolConfig, PoolMetrics, PoolException, ValidationMode.

io.vidocq.mansart:mansart-pool-core

MansartDataSource implementation.

io.vidocq.mansart:mansart-transactions-{api,core,cdi,jdbc}

mansart-transactions itself is a POM aggregator — depend on -cdi (@Transactional interceptor, @TransactionScoped, Vauban BCE; pulls -core’s `MansartTransactionManager/UserTransaction) and -jdbc for the connection bridge.

io.vidocq.mansart:mansart-persistence (M7 pending)

Jakarta Persistence 3.2 implementation.

Java modules

Module Exports

io.vidocq.mansart.data.core

io.vidocq.mansart.data.core (MansartData, RepositoryRuntime); requires transitive the dialect SPI and jakarta.inject.

io.vidocq.mansart.pool.api / io.vidocq.mansart.pool.core

io.vidocq.mansart.pool (PoolConfig, PoolMetrics, ValidationMode) / io.vidocq.mansart.pool.core (MansartDataSource).

io.vidocq.mansart.transactions.api / .core / .cdi / .jdbc

…transactions.api (re-exports jakarta.transaction) / …transactions.core (MansartTransactionManager) / CDI interceptor + BCE / JDBC enlistment bridge.

io.vidocq.mansart.persistence (M7 pending)

TBD.

All modules are strict Java Modules — minimal exports, no unjustified opens, no classpath.

Entity annotations

Entities use the standard jakarta.persistence annotations: @Entity, @Table, @Id, @GeneratedValue, @Column, @Version, @Enumerated, @Embedded/@Embeddable, @ManyToOne, @OneToOne, @JoinColumn, @Transient. The processor reads them at compile time; no other annotation set is recognized (the early zero-dep Mansart annotations were retired in M7-29).

Out of scope v1: @OneToMany, @ManyToMany, @MappedSuperclass, @Inheritance, @Convert/AttributeConverter. Deferred to mansart-persistence (M7).

Repository annotations

Annotation Usage

@jakarta.data.repository.Repository

On the interface — triggers APT generation.

@Find

Finder method by typed parameters (Java parameter = entity attribute).

@Query("…​")

JDQL — SELECT/UPDATE/DELETE with named parameters (:name).

@Insert, @Update, @Delete, @Save

Lifecycle annotations — parameter = entity, collection or varargs; return void/T/Iterable<T>/int/long/boolean.

`OrderBy<Attr><Asc

Desc>` (method-name infix)

Static order on a derived finder; dynamic order via Sort/Order/Limit call parameters.

@Repository(dataStore = "name")

Transaction annotations

Annotation Usage

@jakarta.transaction.Transactional(TxType)

CDI interceptor. TxType: REQUIRED (default), REQUIRES_NEW, MANDATORY, SUPPORTS, NEVER, NOT_SUPPORTED.

@jakarta.transaction.TransactionScoped

CDI scope whose lifetime matches the transaction.

PoolConfig configuration

Property Type Description

jdbcUrl

String

Full JDBC URL.

username

String

DB login.

password

String

Password.

minIdle

int

Idle connections kept warm (default 0).

maxSize

int

Hard pool bound (default 10).

acquireTimeout

Duration

Timeout on getConnection() (default 30 s).

idleTimeout

Duration

Eviction of an idle connection (default 10 min).

maxLifetime

Duration

Eviction of an old connection (default 30 min).

validation

ValidationMode

NEVER, ON_BORROW (default when validationQuery is set), PERIODIC.

validationQuery

String

SQL used by ON_BORROW (falls back to Connection.isValid).

leakDetectionThreshold

Duration

Leak stack-trace if a connection is borrowed longer than the threshold.

validationTimeout

Duration

Bound on a validation probe (default 1 s).

driverProperties

Map<String,String>

Extra driver properties (driverProperty(k, v) on the builder).

xaDataSourceClassName

String

Explicit XADataSource class when auto-detection from the URL is not enough.

Pluggable dialects

Dialect Status Notes

H2

✅ Delivered

Test reference + embedded. MERGE INTO upsert, LIMIT/OFFSET pagination.

PostgreSQL

⏳ M4

Production target. ON CONFLICT, RETURNING, UUID/JSONB types.

MariaDB / MySQL

❌ Backlog

—

SQL Server

❌ Backlog

—

Oracle

❌ Backlog

—

SQLite

❌ Backlog

—

Discovered via ServiceLoader (provides DialectFactory with H2DialectFactory).

Compatibility

See also