@Repository public interface CategoryRepository extends org.springframework.data.jpa.repository.JpaRepository<CategoryJPA,java.lang.Integer>
| Modifier and Type | Method and Description |
|---|---|
void |
deleteByDocIdAndCategoryId(int docId,
int categoryId)
Note: method will delete document-> category relation but not the category itself
|
void |
deleteDocumentCategory(int categoryId)
Note: method will delete document-> category relation but not the category itself
|
java.util.List<CategoryJPA> |
findById(int id) |
CategoryJPA |
findByNameAndType(java.lang.String name,
CategoryTypeJPA type) |
java.util.List<CategoryJPA> |
findByType(CategoryTypeJPA type) |
java.util.List<java.lang.Integer> |
findCategoryDocIds(int categoryId) |
deleteAllInBatch, deleteInBatch, findAll, findAll, findAll, findAll, findAll, flush, getOne, save, saveAndFlushfindAlljava.util.List<CategoryJPA> findByType(CategoryTypeJPA type)
@Query(value="select c.* from categories c where category_type_id = ?1",
nativeQuery=true)
java.util.List<CategoryJPA> findById(int id)
CategoryJPA findByNameAndType(java.lang.String name, CategoryTypeJPA type)
@Query(value="select meta_id from document_categories where category_id = ?1",
nativeQuery=true)
java.util.List<java.lang.Integer> findCategoryDocIds(int categoryId)
@Modifying
@Query(value="DELETE FROM document_categories WHERE meta_id = ?1 and category_id = ?2",
nativeQuery=true)
void deleteByDocIdAndCategoryId(int docId,
int categoryId)
@Modifying
@Query(value="DELETE FROM document_categories WHERE category_id = ?1",
nativeQuery=true)
void deleteDocumentCategory(int categoryId)