Recommended Free Tools
Hibernate’s @Find marks a method signature as a finder; the Hibernate Metamodel Generator supplies its implementation. You declare the entity fields to match as method parameters, and Hibernate selects a lookup strategy based on those fields. It is intended for straightforward finders, not as a replacement for JPQL when a query needs more involved logic.
What @Find does
@Find is in org.hibernate.annotations.processing. Hibernate’s API describes it as identifying a method on an abstract class or interface as a finder signature, with an implementation generated by the Hibernate Metamodel Generator. The annotation is marked incubating in the Hibernate ORM 7.4 Javadoc and is documented as available since Hibernate 6.3. Those labels describe the API documented for those versions; check the Javadoc for the Hibernate version your project uses before relying on a particular feature. Hibernate ORM 7.4 @Find Javadoc.
| # | Preview | Product | Price | |
|---|---|---|---|---|
| 1 |
|
Murach's Java Programming: Training & Reference | $34.15 | Buy on Amazon |
| 2 |
|
Java and Jpa and Hibernate Programming | $30.00 | Buy on Amazon |
| 3 |
|
Java Persistence with Spring Data and Hibernate | $50.41 | Buy on Amazon |
| 4 |
|
Java Persistence with Hibernate | $20.61 | Buy on Amazon |
| 5 |
|
Java Persistence With Hibernate | $45.00 | Buy on Amazon |
Declare a finder method
For the ordinary form, a method’s parameter names and types identify persistent fields on the returned entity. The method name is arbitrary: the fields and supported argument types determine the finder behavior.
@Find
Book book(String isbn);
@Find
List<Book> books(String title);
For example, if Book has a persistent isbn field of type String, the first signature identifies that field as the lookup criterion. The second requests multiple books matching title. A name such as book or books does not itself specify a query.
The Tool Desk
Outbyte PC Repair FREEClear out junk files and repair common Windows errorsFree Scan →Outbyte Driver Updater FREEFix the driver behind crashes, sound loss and screen glitchesFind Drivers →#1 Best Overall
The API documents additional signature options, including range-valued arguments, embedded or associated-field navigation using names such as publisher$name, ordering and page arguments for multiple results, and a Restriction argument for filtering. Hibernate’s Data Repositories guide also illustrates pattern matching with @Pattern, membership conditions using arrays or lists, and underscore navigation for associations. These options are version-sensitive; follow the guide and API for your dependency rather than assuming every Hibernate release supports the same syntax. Hibernate ORM 7.4 @Find Javadoc · Hibernate ORM 7.4 Introduction, Data Repositories.
How Hibernate chooses the lookup
The Hibernate ORM 7.4 API describes these strategies for supported finder signatures:
- One identifier argument: A single argument corresponding to an entity’s
@Idor@EmbeddedIdfield usesEntityManager.find(Class, Object). - An
IdClassargument: A single argument with the entity’sIdClasstype also usesEntityManager.find. For this special case, the argument name does not matter. - Natural-id fields: Arguments matching exactly the entity’s
@NaturalIdfield or fields useSession.byNaturalId(Class). - Other supported combinations: Hibernate builds and executes a criteria query.
This annotation is not the same API as Session.find(). @Find is a compile-time finder declaration; Session.find() is a runtime operation that retrieves an entity by primary key. Hibernate ORM 7.4 @Find Javadoc · Hibernate ORM 7.4 Session.find() Javadoc.
Where the generated finder is available
The generator exposes implementations through a generated static metamodel class, conventionally named with a trailing underscore, such as Books_. In the static form, call the generated method with an EntityManager or compatible session object as its first argument.
Quick wins for a faster PC:
Repair Windows errors before they cause bigger problemsFix Now →Scan for outdated or missing drivers - takes under a minuteDriver Scan →Rank #3
Alternatively, the abstract class or interface can declare a zero-argument accessor returning an EntityManager, Session, or StatelessSession (including relevant Reactive session forms). The generated implementation can then use that accessor, exposing finder methods as instance methods on the generated implementation. Consult the matching version’s Javadoc for supported session and reactive types. Hibernate ORM 7.4 @Find Javadoc.
Return types and pagination options
The Hibernate ORM 7.4 Javadoc lists these return forms: an entity E, List<E>, Stream<E>, Optional<E>, Reactive Uni<E>, Hibernate Query<E> or SelectionQuery<E>, and Jakarta Persistence Query<E> or TypedQuery<E>. Availability depends on Hibernate version and integration. For a single possibly absent result, the repositories guide documents Optional; it also describes a nullable extension. Check the relevant version’s documentation for exact supported forms.
Rank #4
For multi-result finders, the API documents page and ordering parameters. Key-based pagination uses a KeyedResultList return type with a KeyedPage parameter. The annotation also has an enabledFetchProfiles string-array option. These are API capabilities, not a guarantee that every combination is available in older releases. Hibernate ORM 7.4 @Find Javadoc · Hibernate ORM 7.4 Introduction, Data Repositories.
When to choose @Find instead of JPQL
Use a finder signature when the entity fields and argument types make a simple lookup clear. Prefer an explicit JPQL query when joins, complex expressions, or query-specific behavior would make the inferred finder difficult to understand. Hibernate’s Data Repositories guide makes the same broad distinction: generated query methods are a convenience for simple finders, while more involved queries should be expressed explicitly.
Best Value
- A good fit: a direct lookup by an identifier, natural id, or a small number of clearly named fields.
- Consider JPQL: the query spans multiple entities, needs a complex expression, or its intended semantics are not obvious from the method signature.
- Verify first: the project’s Hibernate version supports the return type, argument form, and pagination or filtering feature you plan to use.
The Javadoc specifies lookup behavior, but it does not establish a general performance advantage for @Find. Runtime behavior depends on the generated query, mappings, indexes, database, fetching, and workload; assess those in the context of the application rather than assuming the annotation makes a query faster.
Check the documentation for your Hibernate version
The detailed API behavior above is described in the Hibernate ORM 7.4 Javadoc. Hibernate documents @Find as available since 6.3, but newer or older releases may differ in supported return types and signature options. Match the Javadoc and setup guidance to the Hibernate dependency actually used by the project. The official documentation index, as observed on October 4, 2026, listed 7.2.25.Final dated September 17, 2026, and 8.0.0.Beta1 dated June 16, 2026; the latter is a beta, not a stable release. Hibernate ORM documentation index.
Quick Recap
Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.




