copilot-setting spring-hibernate.instructions.md

copilot-setting spring-hibernate.instructions.md is an instructions file for GitHub Copilot from zexion7873/copilot-setting. It costs 1,366 tokens per session, scanned A, original, MIT.

Coding rules for applications built with Spring Framework 3.2 and Hibernate 4.2, including Spring MVC, native Hibernate sessions, XML mappings, and transaction setup.

In plain words
What is it for?
Use them when writing or reviewing Java controllers, services, Hibernate mappings, HQL, XML configuration, and transaction handling.
Why use it?
They stop newer Spring, Spring Boot, and JPA patterns from being mixed into a project that uses older, specific configuration methods.

Instructions file for GitHub Copilot

Install

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.

agentmods
npx agentmods add instructions/zexion7873/copilot-setting/spring-hibernate
Clone the repo
git clone --depth 1 https://github.com/zexion7873/copilot-setting

Made for: GitHub Copilot.

Wrote 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.

agentmods badge for copilot-setting spring-hibernate.instructions.md

README.md
[![agentmods](https://agentmods.dev/badge/instructions/zexion7873/copilot-setting/spring-hibernate.svg)](https://agentmods.dev/instructions/zexion7873/copilot-setting/spring-hibernate)
Your own site
<a href="https://agentmods.dev/instructions/zexion7873/copilot-setting/spring-hibernate"><img src="https://agentmods.dev/badge/instructions/zexion7873/copilot-setting/spring-hibernate.svg" alt="Measured on agentmods" height="20"></a>
Per session 1,366 This file is loaded in full into every session.
When invoked 1,366 The same file — it is already loaded in full.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

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.

ModelPer sessionOnce invoked
Fable 5 $0.01366 $0.01366
Opus 5 $0.00683 $0.00683
Sonnet 5 $0.00273 $0.00273
Haiku 4.5 $0.00137 $0.00137

Measured 5d ago against content hash eb4072352c55, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

copilot-setting spring-hibernate.instructions.md 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 5d 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.

.github/instructions/spring-hibernate.instructions.md · 69 lines

How it starts

The opening of the file, as written. The whole thing — 69 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Spring 3.2 + Hibernate 4.2 Conventions

No Spring Boot, no Spring 4+, no JPA annotations — AI defaults to all three. SQL rules: instructions/sql.instructions.md.

Spring 3.2 Boundary — Forbidden (Spring 4+)

  • @RestController@Controller + @ResponseBody
  • @GetMapping / @PostMapping / @PutMapping / @DeleteMapping / @PatchMapping@RequestMapping(method = RequestMethod.GET) etc.
  • @Conditional (Spring 4.0) — note: @Profile itself is Spring 3.1 and allowed, and single-profile negation (!dev, SPR-8728) works since 3.2; only compound profile expressions (& / | in the value, Spring 5.1) are out
  • AsyncRestTemplate, ListenableFuture
  • Spring 4 test annotations (@Sql, @SqlGroup)

Forbidden by Project Convention (valid in 3.2, not used here)

  • AbstractAnnotationConfigDispatcherServletInitializer — exists since Spring 3.2, but this project bootstraps via web.xml; do not introduce servlet initializers

Hibernate 4.2 API

  • Native Session only — SessionFactory.getCurrentSession(), never JPA EntityManager
  • hbm.xml mappings, one per entity beside its POJO — no @Entity / @Column / @OneToMany
  • Queries: HQL via session.createQuery(); classic Criteria for dynamic; createSQLQuery() last resort
  • Named parameters (:param) only — never concatenation, even in HQL
  • session.get() over session.load() unless you need a lazy proxy
  • StatelessSession for large batches — bypasses the first-level cache (no dirty-check / flush / cascade); switch when persistence-context growth or flush cost dominates, not at a fixed row count
  • session.byId() / session.byNaturalId() (fluent load-access, added in Hibernate 4.1) work in 4.2 — allowed, but prefer session.get() / HQL / Criteria for house consistency
  • MySQL 8.0 dialect/driver gap: Hibernate 4.2 ships no MySQL 8 dialect — use org.hibernate.dialect.MySQL5Dialect (or MySQL5InnoDBDialect); MySQL57Dialect / MySQL8Dialect arrived in Hibernate 5.x / 5.3 and do NOT exist in 4.2, so never copy them from a 5.x or Spring Boot tutorial. MySQL 8.0's default caching_sha2_password auth needs Connector/J 8.0.x (or set the DB account to mysql_native_password)

Read the full file on GitHub · 69 lines

Changes

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.

  1. 5d ago First seen · 69 lines · 1,366 tokens per session scan A eb4072352c55

Subscribe to this mod's changes

copilot-setting spring-hibernate.instructions.md is an instructions file published in the GitHub repository zexion7873/copilot-setting (1 stars, last pushed 1mo ago), licensed MIT. It adds 1,366 tokens to every session, about $0.0068 per session on Opus 5. 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-31.