0% found this document useful (0 votes)
2 views2 pages

Repository (Spring Framework 7.0.8 API)

Uploaded by

nupsurer
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
2 views2 pages

Repository (Spring Framework 7.0.8 API)

Uploaded by

nupsurer
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

Spring Framework

Annotation Interface Repository


@Target (TYPE )
@Retention (RUNTIME )
@Documented
@Component
public @interface Repository

Indicates that an annotated class is a "Repository", originally defined by Domain-Driven


Design (Evans, 2003) as "a mechanism for encapsulating storage, retrieval, and search
behavior which emulates a collection of objects".

Teams implementing traditional Jakarta EE patterns such as "Data Access Object" may
also apply this stereotype to DAO classes, though care should be taken to understand the
distinction between Data Access Object and DDD-style repositories before doing so. This
annotation is a general-purpose stereotype and individual teams may narrow their
semantics and use as appropriate.

A class thus annotated is eligible for Spring DataAccessException translation when used
in conjunction with a PersistenceExceptionTranslationPostProcessor. The annotated
class is also clarified as to its role in the overall application architecture for the purpose
of tooling, aspects, etc.

This annotation also serves as a specialization of @Component, allowing for


implementation classes to be autodetected through classpath scanning.

Since:

2.0

Author:

Rod Johnson, Juergen Hoeller


See Also:

Component,
Service,
DataAccessException,
PersistenceExceptionTranslationPostProcessor

Optional Element Summary

Optional Elements

Modifier and Type Optional Element Description

String value Alias for [Link]().

Element Details
value

@AliasFor(annotation=[Link])
String value

Alias for [Link]().


Default:

""

You might also like