Interface ProductRepository
-
- All Superinterfaces:
org.springframework.data.repository.CrudRepository<Product,java.lang.String>,org.springframework.data.mongodb.repository.MongoRepository<Product,java.lang.String>,org.springframework.data.repository.PagingAndSortingRepository<Product,java.lang.String>,org.springframework.data.repository.query.QueryByExampleExecutor<Product>,org.springframework.data.repository.Repository<Product,java.lang.String>
@Repository public interface ProductRepository extends org.springframework.data.mongodb.repository.MongoRepository<Product,java.lang.String>
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description java.lang.LongcountAll()java.util.List<Product>findAllByCategoryId(java.lang.String categoryId)java.util.Optional<Product>findById(java.lang.String id)ProductfindByName(java.lang.String name)ProductfindByTranslationsEquals(LocalizedText translation)java.util.List<Product>matchProductsByName(java.lang.String name)org.springframework.data.domain.Page<Product>search(java.lang.String query, org.springframework.data.domain.Pageable page)-
Methods inherited from interface org.springframework.data.repository.CrudRepository
count, delete, deleteAll, deleteAll, deleteAllById, deleteById, existsById, findAllById, save
-
Methods inherited from interface org.springframework.data.mongodb.repository.MongoRepository
findAll, findAll, findAll, findAll, insert, insert, saveAll
-
-
-
-
Method Detail
-
countAll
@Query(value="{}", count=true) java.lang.Long countAll()
-
findByName
Product findByName(java.lang.String name)
-
findById
@NotNull java.util.Optional<Product> findById(@NotNull java.lang.String id)
- Specified by:
findByIdin interfaceorg.springframework.data.repository.CrudRepository<Product,java.lang.String>
-
search
@Query("{ $or: [{ name : {$regex:?0,$options:\'i\'}},{ keywords : {$regex:?0,$options:\'i\'}},{ searchTerms : {$regex:?0,$options:\'i\'}} ]}") org.springframework.data.domain.Page<Product> search(java.lang.String query, org.springframework.data.domain.Pageable page)
-
matchProductsByName
@Query("{ $or: [{ name : {$regex:?0,$options:\'i\'}},{ keywords : {$regex:?0,$options:\'i\'}},{ searchTerms : {$regex:?0,$options:\'i\'}} ]}") java.util.List<Product> matchProductsByName(java.lang.String name)
-
findAllByCategoryId
@Query("{ \'fallIntoCategories._id\' : ?0}") java.util.List<Product> findAllByCategoryId(java.lang.String categoryId)
-
findByTranslationsEquals
Product findByTranslationsEquals(LocalizedText translation)
-
-