skills/.system/guicedee-persistence/SKILL.md
Reactive JPA persistence with Hibernate Reactive 7, Vert.x 5 SQL clients, and Mutiny sessions inside GuicedEE: DatabaseModule setup, persistence.xml configuration, multi-database support, @EntityManager scoping, and environment variable resolution. Use when adding database persistence, configuring Hibernate Reactive, creating DatabaseModule subclasses, wiring Mutiny.SessionFactory, or managing multiple persistence units.
npx skillsauth add guicedee/ai-rules guicedee-persistenceInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Reactive JPA persistence using Hibernate Reactive 7 and Vert.x 5 SQL clients, fully managed by the GuicedEE lifecycle.
Extend DatabaseModule, point it at a persistence.xml unit, and the module wires a Mutiny.SessionFactory into Guice — fully reactive, annotation-driven, with built-in support for PostgreSQL, MySQL, SQL Server, Oracle, and DB2.
com.guicedee:persistence dependency.persistence.xml with ReactivePersistenceProvider:
<persistence xmlns="https://jakarta.ee/xml/ns/persistence" version="3.0">
<persistence-unit name="mydb">
<provider>org.hibernate.reactive.provider.ReactivePersistenceProvider</provider>
<class>com.example.entities.User</class>
<properties>
<property name="jakarta.persistence.jdbc.url"
value="${DB_URL:jdbc:postgresql://localhost:5432/mydb}"/>
<property name="jakarta.persistence.jdbc.user" value="${DB_USER:postgres}"/>
<property name="jakarta.persistence.jdbc.password" value="${DB_PASSWORD:secret}"/>
<property name="hibernate.hbm2ddl.auto" value="update"/>
</properties>
</persistence-unit>
</persistence>
DatabaseModule subclass:
public class MyDatabaseModule extends DatabaseModule<MyDatabaseModule> {
@Override
protected String getPersistenceUnitName() { return "mydb"; }
@Override
protected ConnectionBaseInfo getConnectionBaseInfo(
PersistenceUnitDescriptor unit, Properties properties) {
return ConnectionBaseInfoFactory.createConnectionBaseInfo("postgresql");
}
}
module my.app {
requires com.guicedee.persistence;
provides com.guicedee.client.services.lifecycle.IGuiceModule
with my.app.MyDatabaseModule;
}
Mutiny.SessionFactory and use reactive sessions:
@Inject
private Mutiny.SessionFactory sessionFactory;
public Uni<User> createUser(String name) {
User user = new User();
user.setName(name);
return sessionFactory.withTransaction(session ->
session.persist(user).replaceWith(user));
}
IGuiceContext.instance().inject()
└─ IGuiceModule hooks
└─ MyDatabaseModule (extends DatabaseModule)
├─ Parse persistence.xml
├─ IPropertiesEntityManagerReader SPIs (env var resolution, DB-specific props)
├─ IPropertiesConnectionInfoReader SPIs
├─ ConnectionBaseInfo.toPooledDatasource() (Vert.x SQL pool init)
└─ JtaPersistModule
├─ bind PersistService @Named("mydb")
└─ bind Mutiny.SessionFactory @Named("mydb") + default
└─ IGuicePostStartup hooks
└─ DatabaseModule.postLoad()
└─ PersistService.start() (creates EntityManagerFactory on Vert.x context)
└─ IGuicePreDestroy hooks
└─ DatabaseModule.onDestroy()
└─ PersistService.stop()
| Attribute | Default | Purpose |
|---|---|---|
| value | "" | Persistence unit name (maps to persistence.xml) |
| allClasses | true | Include all entity classes or only the annotated package |
| defaultEm | true | Mark as the default SessionFactory binding |
Apply at class level (on DatabaseModule subclasses) or package level (package-info.java) to scope entities to specific persistence units.
Bind multiple DatabaseModule subclasses with distinct @Named qualifiers. One should be marked as the default with defaultEm = true:
@Inject @Named("orders")
private Mutiny.SessionFactory ordersFactory;
@Inject @Named("users")
private Mutiny.SessionFactory usersFactory;
Built-in ConnectionBaseInfo implementations:
postgresql — PostgreSQL via Vert.x PG Clientmysql — MySQL via Vert.x MySQL Clientsqlserver — SQL Server via Vert.x MSSQL Clientoracle — Oracle via Vert.x Oracle Clientdb2 — DB2 via Vert.x DB2 Client${VAR_NAME} placeholders in persistence.xml properties are resolved from system properties or environment variables. Default values supported with ${VAR_NAME:default} syntax.
ReactivePersistenceProvider — standard JPA providers are not supported.persistence.xml must exist in META-INF/.IGuiceModule SPI.opens to com.fasterxml.jackson.databind and org.hibernate.orm.core.requires com.guicedee.persistence;.module-info.java + META-INF/services/).development
Install Codex skills into $CODEX_HOME/skills from a curated list or a GitHub repo path. Use when a user asks to list installable skills, install a curated skill, or install a skill from another repo (including private repos).
tools
Guide for creating effective skills. This skill should be used when users want to create a new skill (or update an existing skill) that extends Codex's capabilities with specialized knowledge, workflows, or tool integrations.
development
WebAwesome icon integration for JWebMP — modern, open-source icon library. Provides 1,500+ icons with solid/regular styles, sizing, rotation, animation, and CSS utilities. Drop-in FontAwesome alternative with fresh designs. Use when working with WebAwesome icons, modern icon designs, or as FontAwesome alternative in JWebMP applications.
development
WebAwesome Pro integration for JWebMP with premium icons and features. Extends jwebmp-webawesome with additional styles, premium icons, and advanced features. Use when working with WebAwesome Pro icons or premium WebAwesome features in JWebMP applications.