Repository class
Marks a class as a bean that stores and loads data.
It does exactly what Component does; the name tells the reader that the class is the data-access layer. Spring also translates database exceptions for such beans; this package does not.
@Repository()
class OrderRepository {
final _orders = <int, Order>{};
Order? findById(int id) => _orders[id];
}
Spring (Java):
@Repository
class OrderRepository {
Order findById(int id) { ... }
}
Constructors
- Repository([String? name])
-
Declares the bean;
namereplaces the default bean name.const
Properties
Methods
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited