VitalRepository
A volatile in-memory repository to store temporary data in a Spring-like repository implementation. It can store implementations of VitalEntity and the means to get, save and delete them.
Useful for temporary data that should be wiped when the server restarts.
@Component
public class MyRepository extends VitalRepository<MyEntity> {
}Content copied to clipboard
DO NOT ANNOTATE YOUR IMPLEMENTATIONS WITH org.springframework.stereotype.Repository. THIS WILL BREAK INSTANCE INTERNALS.
Functions
Link copied to clipboard
Link copied to clipboard
Gets the first VitalEntity that matches the given predicate.
Gets the first VitalEntity that matches the given type and predicate.
Link copied to clipboard
Link copied to clipboard
Gets a random entity from this repository that matches the given predicate. If no entity was found, this function returns null.