Class MongoNodeRepositoryImpl
- All Implemented Interfaces:
org.springframework.beans.factory.Aware
,org.springframework.context.ApplicationContextAware
,org.springframework.data.mongodb.repository.MongoRepository<NodeWrapper,
,String> org.springframework.data.repository.CrudRepository<NodeWrapper,
,String> org.springframework.data.repository.ListCrudRepository<NodeWrapper,
,String> org.springframework.data.repository.ListPagingAndSortingRepository<NodeWrapper,
,String> org.springframework.data.repository.PagingAndSortingRepository<NodeWrapper,
,String> org.springframework.data.repository.query.QueryByExampleExecutor<NodeWrapper>
,org.springframework.data.repository.Repository<NodeWrapper,
String>
- Direct Known Subclasses:
EncryptedMongoNodeRepositoryImpl
Implements the MongoRepository interface using MongoOperations to perform database operations.
Activation of this repository is controlled by the property 'application.service.vault.encryption.enabled': it is enabled when the value is "false" or the property is missing.
Offers various CRUD operations such as insertion, save, batch operations, find by example, find by sort or pageable criteria, counting, and removal of entities. Supports custom queries using Example, Sort, and Pageable.
The findBy(Example, Function) method is not implemented and will always throw an UnsupportedOperationException.
This class extends BaseComponent and is intended for scenarios where node encryption is disabled at the application level.
Depends on MongoOperations for thread-safe persistence handling of NodeWrapper documents.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionlong
count()
<S extends NodeWrapper>
longcount
(@NonNull org.springframework.data.domain.Example<S> example) void
delete
(@NonNull NodeWrapper entity) void
void
deleteAll
(@NonNull Iterable<? extends NodeWrapper> entities) void
deleteAllById
(@NonNull Iterable<? extends String> ids) void
deleteById
(@NonNull String id) <S extends NodeWrapper>
booleanexists
(@NonNull org.springframework.data.domain.Example<S> example) boolean
existsById
(@NonNull String id) @NonNull List
<NodeWrapper> findAll()
<S extends NodeWrapper>
@NonNull List<S> findAll
(@NonNull org.springframework.data.domain.Example<S> example) <S extends NodeWrapper>
@NonNull org.springframework.data.domain.Page<S> findAll
(@NonNull org.springframework.data.domain.Example<S> example, @NonNull org.springframework.data.domain.Pageable pageable) <S extends NodeWrapper>
@NonNull List<S> findAll
(@NonNull org.springframework.data.domain.Example<S> example, @NonNull org.springframework.data.domain.Sort sort) @NonNull org.springframework.data.domain.Page
<NodeWrapper> findAll
(@NonNull org.springframework.data.domain.Pageable pageable) @NonNull List
<NodeWrapper> findAll
(@NonNull org.springframework.data.domain.Sort sort) @NonNull List
<NodeWrapper> findAllById
(@NonNull Iterable<String> ids) <S extends NodeWrapper,
R>
RfindBy
(@NonNull org.springframework.data.domain.Example<S> example, @NonNull Function<org.springframework.data.repository.query.FluentQuery.FetchableFluentQuery<S>, R> queryFunction) @NonNull Optional
<NodeWrapper> <S extends NodeWrapper>
@NonNull Optional<S> findOne
(@NonNull org.springframework.data.domain.Example<S> example) void
init()
Called after dependency injection is complete.<S extends NodeWrapper>
@NonNull List<S> <S extends NodeWrapper>
Sinsert
(S entity) <S extends NodeWrapper>
Ssave
(S entity) <S extends NodeWrapper>
@NonNull List<S> Methods inherited from class org.saidone.component.BaseComponent
setApplicationContext, shutDown, stop
-
Constructor Details
-
MongoNodeRepositoryImpl
public MongoNodeRepositoryImpl()
-
-
Method Details
-
init
@PostConstruct public void init()Description copied from class:BaseComponent
Called after dependency injection is complete. Logs a startup message indicating that the component is ready.- Overrides:
init
in classBaseComponent
-
insert
- Specified by:
insert
in interfaceorg.springframework.data.mongodb.repository.MongoRepository<NodeWrapper,
String>
-
insert
@NonNull public <S extends NodeWrapper> @NonNull List<S> insert(@NonNull @NonNull Iterable<S> entities) - Specified by:
insert
in interfaceorg.springframework.data.mongodb.repository.MongoRepository<NodeWrapper,
String>
-
save
- Specified by:
save
in interfaceorg.springframework.data.repository.CrudRepository<NodeWrapper,
String>
-
saveAll
@NonNull public <S extends NodeWrapper> @NonNull List<S> saveAll(@NonNull @NonNull Iterable<S> entities) - Specified by:
saveAll
in interfaceorg.springframework.data.repository.CrudRepository<NodeWrapper,
String> - Specified by:
saveAll
in interfaceorg.springframework.data.repository.ListCrudRepository<NodeWrapper,
String>
-
findOne
@NonNull public <S extends NodeWrapper> @NonNull Optional<S> findOne(@NonNull @NonNull org.springframework.data.domain.Example<S> example) - Specified by:
findOne
in interfaceorg.springframework.data.repository.query.QueryByExampleExecutor<NodeWrapper>
-
findAll
@NonNull public <S extends NodeWrapper> @NonNull List<S> findAll(@NonNull @NonNull org.springframework.data.domain.Example<S> example) - Specified by:
findAll
in interfaceorg.springframework.data.mongodb.repository.MongoRepository<NodeWrapper,
String> - Specified by:
findAll
in interfaceorg.springframework.data.repository.query.QueryByExampleExecutor<NodeWrapper>
-
findAll
@NonNull public <S extends NodeWrapper> @NonNull List<S> findAll(@NonNull @NonNull org.springframework.data.domain.Example<S> example, @NonNull @NonNull org.springframework.data.domain.Sort sort) - Specified by:
findAll
in interfaceorg.springframework.data.mongodb.repository.MongoRepository<NodeWrapper,
String> - Specified by:
findAll
in interfaceorg.springframework.data.repository.query.QueryByExampleExecutor<NodeWrapper>
-
findAll
@NonNull public <S extends NodeWrapper> @NonNull org.springframework.data.domain.Page<S> findAll(@NonNull @NonNull org.springframework.data.domain.Example<S> example, @NonNull @NonNull org.springframework.data.domain.Pageable pageable) - Specified by:
findAll
in interfaceorg.springframework.data.repository.query.QueryByExampleExecutor<NodeWrapper>
-
findBy
@NonNull public <S extends NodeWrapper,R> R findBy(@NonNull @NonNull org.springframework.data.domain.Example<S> example, @NonNull @NonNull Function<org.springframework.data.repository.query.FluentQuery.FetchableFluentQuery<S>, R> queryFunction) - Specified by:
findBy
in interfaceorg.springframework.data.repository.query.QueryByExampleExecutor<NodeWrapper>
-
findById
- Specified by:
findById
in interfaceorg.springframework.data.repository.CrudRepository<NodeWrapper,
String>
-
existsById
- Specified by:
existsById
in interfaceorg.springframework.data.repository.CrudRepository<NodeWrapper,
String>
-
findAll
- Specified by:
findAll
in interfaceorg.springframework.data.repository.CrudRepository<NodeWrapper,
String> - Specified by:
findAll
in interfaceorg.springframework.data.repository.ListCrudRepository<NodeWrapper,
String>
-
findAllById
- Specified by:
findAllById
in interfaceorg.springframework.data.repository.CrudRepository<NodeWrapper,
String> - Specified by:
findAllById
in interfaceorg.springframework.data.repository.ListCrudRepository<NodeWrapper,
String>
-
count
public long count()- Specified by:
count
in interfaceorg.springframework.data.repository.CrudRepository<NodeWrapper,
String>
-
deleteById
- Specified by:
deleteById
in interfaceorg.springframework.data.repository.CrudRepository<NodeWrapper,
String>
-
delete
- Specified by:
delete
in interfaceorg.springframework.data.repository.CrudRepository<NodeWrapper,
String>
-
deleteAllById
- Specified by:
deleteAllById
in interfaceorg.springframework.data.repository.CrudRepository<NodeWrapper,
String>
-
deleteAll
- Specified by:
deleteAll
in interfaceorg.springframework.data.repository.CrudRepository<NodeWrapper,
String>
-
deleteAll
public void deleteAll()- Specified by:
deleteAll
in interfaceorg.springframework.data.repository.CrudRepository<NodeWrapper,
String>
-
findAll
@NonNull public @NonNull List<NodeWrapper> findAll(@NonNull @NonNull org.springframework.data.domain.Sort sort) - Specified by:
findAll
in interfaceorg.springframework.data.repository.ListPagingAndSortingRepository<NodeWrapper,
String> - Specified by:
findAll
in interfaceorg.springframework.data.repository.PagingAndSortingRepository<NodeWrapper,
String>
-
findAll
@NonNull public @NonNull org.springframework.data.domain.Page<NodeWrapper> findAll(@NonNull @NonNull org.springframework.data.domain.Pageable pageable) - Specified by:
findAll
in interfaceorg.springframework.data.repository.PagingAndSortingRepository<NodeWrapper,
String>
-
count
public <S extends NodeWrapper> long count(@NonNull @NonNull org.springframework.data.domain.Example<S> example) - Specified by:
count
in interfaceorg.springframework.data.repository.query.QueryByExampleExecutor<NodeWrapper>
-
exists
public <S extends NodeWrapper> boolean exists(@NonNull @NonNull org.springframework.data.domain.Example<S> example) - Specified by:
exists
in interfaceorg.springframework.data.repository.query.QueryByExampleExecutor<NodeWrapper>
-