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

Maven artefacts

Artefact Role

io.vidocq.mansart:mansart-data-api

Annotations (@Entity, @Repository, @Find, @Query, @Insert, @Update, @Delete, @Save) — re-export of jakarta.data + Mansart specifics (@Dialect, @JdbcRepository, @MansartDataSource).

io.vidocq.mansart:mansart-data-core

Runtime: RepositoryRuntime, QueryPlan execution, ResultSet mapping.

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

MansartTransactionManager, UserTransaction, @Transactional interceptor, @TransactionScoped, Vauban BCE.

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

Jakarta Persistence 3.2 implementation.

JPMS modules

Module Exports

io.vidocq.mansart.data

io.vidocq.mansart.data (annotations + MansartData factory), io.vidocq.mansart.data.runtime (SPI), io.vidocq.mansart.data.dialect.spi.

io.vidocq.mansart.pool

io.vidocq.mansart.pool (MansartDataSource, PoolConfig, PoolMetrics).

io.vidocq.mansart.transactions

io.vidocq.mansart.transactions (MansartTransactionManager, UserTransaction providers).

io.vidocq.mansart.persistence (M7 pending)

TBD.

All modules are JPMS-strict — minimal exports, no unjustified opens, no classpath.

Entity annotations

Mansart (zero-dep) JPA equivalent recognized

@io.vidocq.mansart.data.Entity

@jakarta.persistence.Entity

@Id

@Id

@GeneratedValue(strategy)

@GeneratedValue(strategy)IDENTITY, SEQUENCE, UUID, AUTO

@Column(name, nullable, unique, length)

@Column(…​)

@Table(name, schema)

@Table(…​)

@Version

@Version — optimistic locking

@Enumerated(STRING|ORDINAL)

@Enumerated(…​)

@Embedded / @Embeddable

same

@ManyToOne(fetch) / @OneToOne(fetch)

same (owning relations only in v1)

@JoinColumn(name)

@JoinColumn(…​)

@Transient

@Transient

APT rule: if @jakarta.persistence.Entity is present → JPA annotations. Otherwise, @io.vidocq.mansart.data.Entity → Mansart annotations. Both at once → explicit compile-time error.

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("attribute")

Static order on a finder.

@io.vidocq.mansart.data.MansartDataSource("name")

Overrides the DataSource injected into the repository (default @Inject DataSource).

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.

minSize

int

Pre-warmed minimum connections (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).

validationMode

ValidationMode

IS_VALID, QUERY, NONE.

validationQuery

String

SQL when validationMode=QUERY.

leakDetectionThreshold

Duration

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

connectionInitSql

List<String>

SQL run on first acquire (SET TIMEZONE, etc.).

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

  • lien:https://codeberg.org/Vidocq/mansart/src/branch/main/PLAN.md[Mansart PLAN.md] — global vision and work order.

  • lien:https://codeberg.org/Vidocq/mansart/src/branch/main/mansart-jakarta-data/PLAN.md[mansart-jakarta-data PLAN.md] — detailed plan of the Data module.

  • lien:https://codeberg.org/Vidocq/mansart/src/branch/main/mansart-pool/PLAN.md[mansart-pool PLAN.md] — pool design.

  • lien:https://codeberg.org/Vidocq/mansart/src/branch/main/mansart-transactions/PLAN.md[mansart-transactions PLAN.md] — transactions roadmap.