512-frameworks-micronaut-data

Solid

Use when you need data access with Micronaut Data — @MappedEntity, CrudRepository/PageableRepository, @Query with parameters, @Transactional services, projections, @Version, and @MicronautTest with TestPropertyProvider and Testcontainers. For raw java.sql access without generated repositories, use @511-frameworks-micronaut-jdbc. Part of the skills-for-java project

AI & Automation 393 stars 78 forks Updated today Apache-2.0

Install

View on GitHub

Quality Score: 89/100

Stars 20%
86
Recency 20%
100
Frontmatter 20%
70
Documentation 15%
71
Issue Health 10%
50
License 10%
100
Description 5%
100

Skill Content

# Micronaut Data Guidelines Apply Micronaut Data patterns for relational repositories and safe SQL. **What is covered in this Skill?** - @MappedEntity, @Id, @GeneratedValue, @MappedProperty for column mapping - @Repository interfaces extending CrudRepository / PageableRepository - Derived finder methods and @Query with named parameters - @Transactional on @Singleton services (readOnly where appropriate) - Page and Pageable for list endpoints - DTO/interface projections for read-heavy queries - @Version for optimistic locking - Integration tests: @MicronautTest + TestPropertyProvider + Testcontainers **Scope:** Apply recommendations based on the reference rules and good/bad code examples. ## Constraints Compile before persistence changes; verify the full build after. - **MANDATORY**: Run `./mvnw compile` or `mvn compile` before applying any change - **SAFETY**: If compilation fails, stop immediately - **VERIFY**: Run `./mvnw clean verify` or `mvn clean verify` after applying improvements - **BEFORE APPLYING**: Read the reference for detailed rules and examples ## When to use this skill - Review or implement Micronaut Data repositories and entities - Add transactions, pagination, or projections in Micronaut persistence layer ## Reference For detailed guidance, examples, and constraints, see [references/512-frameworks-micronaut-data.md](references/512-frameworks-micronaut-data.md).

Details

Author
jabrena
Repository
jabrena/cursor-rules-java
Created
1 years ago
Last Updated
today
Language
Java
License
Apache-2.0

Integrates with

Similar Skills

Semantically similar based on skill content — not just same category

AI & Automation Solid

511-frameworks-micronaut-jdbc

Use when you need programmatic JDBC in Micronaut — pooled DataSource, parameterized SQL, io.micronaut.transaction.annotation.Transactional, batching, and domain exception translation. Part of the skills-for-java project

393 Updated today
jabrena
AI & Automation Solid

513-frameworks-micronaut-db-migrations-flyway

Use when you need to add or review Flyway database migrations in a Micronaut application — micronaut-flyway, db/migration scripts, flyway.datasources.* configuration, and alignment with JDBC or Micronaut Data. Part of the skills-for-java project

393 Updated today
jabrena
AI & Automation Solid

501-frameworks-micronaut-core

Use when building or reviewing Micronaut applications — Micronaut.run bootstrap, @Singleton/@Prototype, @Factory beans, @ConfigurationProperties, environments, @Requires, @Controller vs services, @Scheduled, graceful shutdown, @ExecuteOn for blocking work, and Jakarta-consistent APIs. Part of the skills-for-java project

393 Updated today
jabrena
Testing & QA Solid

521-frameworks-micronaut-testing-unit-tests

Use when you need to write unit tests for Micronaut applications — Mockito-first with @ExtendWith(MockitoExtension.class), @MicronautTest with @MockBean, HttpClient @Client("/") assertions, @Property overrides, @ParameterizedTest, and *Test vs *IT naming. For framework-agnostic Java use @131-java-testing-unit-testing. Part of the skills-for-java project

393 Updated today
jabrena
API & Backend Solid

502-frameworks-micronaut-rest

Use when you need to design, review, or improve REST APIs with Micronaut — including @Controller routes, HTTP status codes, DTOs, Bean Validation, exception handlers, pagination, idempotency, ETag/If-Match, caching headers, versioning, contract-first OpenAPI (OpenAPI Generator), optional runtime OpenAPI via micronaut-openapi, and security annotations. Part of the skills-for-java project

393 Updated today
jabrena