Getting it into your agent
One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.
npx agentmods add rules/jabrena/cursor-rules-spring-boot/303-frameworks-spring-data-jdbcgit clone --depth 1 https://github.com/jabrena/cursor-rules-spring-bootWrote this? Show the measurements
A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.
[](https://agentmods.dev/rules/jabrena/cursor-rules-spring-boot/303-frameworks-spring-data-jdbc)<a href="https://agentmods.dev/rules/jabrena/cursor-rules-spring-boot/303-frameworks-spring-data-jdbc"><img src="https://agentmods.dev/badge/rules/jabrena/cursor-rules-spring-boot/303-frameworks-spring-data-jdbc.svg" alt="Measured on agentmods" height="20"></a>What it costs to keep this loaded
Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5 | $0.00000 | $0.04709 |
| Opus 5 | $0.00000 | $0.02354 |
| Sonnet 5 | $0.00000 | $0.00942 |
| Haiku 4.5 | $0.00000 | $0.00471 |
Grade A, and why
303-frameworks-spring-data-jdbc scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 4d ago.
A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.
Nothing flagged
None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.
How it starts
The opening of the file, as written. The whole thing — 729 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Spring Data JDBC with Records
Spring Data JDBC provides a simpler alternative to JPA, offering direct SQL control while maintaining Spring's repository abstractions. When combined with Java records, it creates clean, immutable data models perfect for modern Java applications.
Implementing These Principles
These guidelines are built upon the following core principles:
- Immutability: Use records for immutable entities that are thread-safe and predictable
- Simplicity: Leverage Spring Data JDBC's straightforward approach over complex ORM mapping
- Constructor Injection: Always use constructor-based dependency injection for better testability
- Transaction Boundaries: Keep transactions at the service layer, not repository layer
- SQL Control: Use custom queries when needed for optimal performance
Table of contents
- Rule 1: Use Records for Entity Classes
- Rule 2: Implement Repository Pattern Correctly
- Rule 3: Handle Updates with Immutable Records
- Rule 4: Design Aggregate Relationships Properly
- Rule 5: Use Custom Queries for Complex Operations
- Rule 6: Implement Proper Transaction Management
- Rule 7: Embrace Single Query Loading to Eliminate N+1 Problems
Rule 1: Use Records for Entity Classes
Title: Prefer Records Over Classes for Entity Definitions Description: Records provide immutability, automatic equals/hashCode, and clean constructor-based mapping that works perfectly with Spring Data JDBC. They eliminate boilerplate code and ensure thread safety. Use @PersistenceCreator when you have multiple constructors to specify which one Spring Data JDBC should use. Use @Column to explicitly map record fields to database columns, especially when field names differ from column names.
Good example:
public record Customer(
@Id
@Column("customer_id")
Long id,
@Column("first_name")
String firstName,
@Column("last_name")
String lastName,
@Column("email_address")
String email,
@Column("created_at")
LocalDateTime createdAt
) {
// Constructor for Spring Data JDBC (explicit annotation when multiple constructors exist)
@PersistenceCreator
public Customer(Long id, String firstName, String lastName, String email, LocalDateTime createdAt) {
this.id = id;
this.firstName = firstName;
this.lastName = lastName;
this.email = email;
this.createdAt = createdAt;
}
// Factory method for new entities
public static Customer of(String firstName, String lastName, String email) {
return new Customer(null, firstName, lastName, email, LocalDateTime.now());
}
}
What this file has done since we first saw it
Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.
- 4d ago First seen · 729 lines · 0 tokens per session scan A 44bfb339ccf2
303-frameworks-spring-data-jdbc is a cursor rule published in the GitHub repository jabrena/cursor-rules-spring-boot (47 stars, last pushed 5mo ago), licensed Apache-2.0. It costs nothing until one of its globs matches a file; then it loads 4,709 tokens. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.
Other cursor rules, from other repositories
jooq-database-access
Cursor rule "jooq-database-access" from e-gov/cursor-prompts, covering jooq dsl and database access conventions, context, requirements, examples and critical rules.
jdbc
PURPOSE: JDBC driver patterns for Java applications connecting to Snowflake.
prefer-assertions-over-defensive-checks
Prefer assertions over defensive checks when data is guaranteed to be valid.
java-springboot-jpa-cursorrules-prompt-file
description: "Cursor rules for Java development with Springboot and JPA integration." globs: / alwaysApply: false.
java-springboot-standards
Java Spring Boot coding standards and patterns for your monorepo services.
contraponto-format-imports
Java formatting (formatter.xml) and import hygiene — required on every Java edit.