Interface AttributeRepository
- All Superinterfaces:
org.springframework.data.repository.CrudRepository<Attribute,
,Long> org.springframework.data.jpa.repository.JpaSpecificationExecutor<Attribute>
,org.springframework.data.querydsl.QuerydslPredicateExecutor<Attribute>
,org.springframework.data.repository.Repository<Attribute,
Long>
@CacheConfig(cacheNames="Search_Attribute_Cache")
public interface AttributeRepository
extends org.springframework.data.repository.CrudRepository<Attribute,Long>, org.springframework.data.jpa.repository.JpaSpecificationExecutor<Attribute>, org.springframework.data.querydsl.QuerydslPredicateExecutor<Attribute>
This interface is the AttributeRepository. Handles CRUD operations of Attribute entity
-
Method Summary
Modifier and TypeMethodDescriptionvoid
deleteByConfigIdAndAttributeId
(long configId, String attributeId) This function deletes the attribute.default void
deleteByConfigIdAndAttributeIdWithCollectionId
(long configId, String attributeId, long collectionId) This function deletes the attribute.findByConfigIdAndAttributeIdAndVersion
(long configId, String attributeId, String version) This function is used to find the Attribute based on config id and attribute id.findByConfigIdAndAttributeIdAndVersionIgnoreCase
(long configId, String attributeId, String version) findByConfigIdAndAttributeIdWithCollectionIdAndVersion
(long configId, String attributeId, long collectionId, String version) It will find the attribute based on input.findByConfigIdAndCollectionId
(long configId, long collectionId, String version) This function finds the attributes.findByConfigIdAndVersion
(long configId, String version) This function finds the attributes.findByConfigIdAndVersionIgnoreCase
(long configId, String version) default Attribute
This function is used to update the existing attribute.default Attribute
This function is used to update the existing attribute.Methods inherited from interface org.springframework.data.repository.CrudRepository
count, delete, deleteAll, deleteAll, deleteAllById, deleteById, existsById, findAll, findAllById, findById, save, saveAll
Methods inherited from interface org.springframework.data.jpa.repository.JpaSpecificationExecutor
count, delete, exists, findAll, findAll, findAll, findBy, findOne
Methods inherited from interface org.springframework.data.querydsl.QuerydslPredicateExecutor
count, exists, findAll, findAll, findAll, findAll, findAll, findBy, findOne
-
Method Details
-
findByConfigIdAndAttributeIdAndVersion
Optional<Attribute> findByConfigIdAndAttributeIdAndVersion(long configId, String attributeId, String version) This function is used to find the Attribute based on config id and attribute id.- Parameters:
configId
- Holds the config identifier.attributeId
- Holds the attribute identifier.version
- Holds the version identifier.- Returns:
- It returns the attribute entity.
-
findByConfigIdAndAttributeIdAndVersionIgnoreCase
-
findByConfigIdAndAttributeIdWithCollectionIdAndVersion
@Cacheable(key="\'COL-ID_\'+#p2+\'*FindAttributeByConfigId_\'+#p0+\'AndAttributeId_\'+#p1", unless="#result==null") default Optional<Attribute> findByConfigIdAndAttributeIdWithCollectionIdAndVersion(long configId, String attributeId, long collectionId, String version) It will find the attribute based on input.- Parameters:
configId
- Holds the config identifier.attributeId
- It denotes the attribute identifier.collectionId
- holds the collection identifier.version
- holds the version identifier.- Returns:
- It returns the attribute entity.
-
deleteByConfigIdAndAttributeIdWithCollectionId
@CacheEvict(key="\'COL-ID_\'+#p2+\'*FindAttributeByConfigId_\'+#p0+\'AndAttributeId_\'+#p1") @CacheEvict(key="\'COL-ID_\'+#p2+\'*FindByConfigIdAndCollectionId_\'+#p0") @CacheEvict(key="\'COL-ID_\'+#p2+\'*CommonProcess_GetAttributesByConfigId\'+#p0") default void deleteByConfigIdAndAttributeIdWithCollectionId(long configId, String attributeId, long collectionId) This function deletes the attribute.- Parameters:
configId
- Holds the config identifier.attributeId
- It contains the attribute identifier.collectionId
- It have collection identifier.
-
deleteByConfigIdAndAttributeId
This function deletes the attribute.- Parameters:
configId
- Holds the config identifier.attributeId
- Holds the attribute identifier.
-
findByConfigIdAndVersion
This function finds the attributes.- Parameters:
configId
- Holds the config identifier.version
- Holds the version identifier.- Returns:
- It returns the list of attribute entity.
-
findByConfigIdAndVersionIgnoreCase
- Parameters:
configId
-version
-- Returns:
-
findByConfigIdAndCollectionId
@Cacheable(key="\'COL-ID_\'+#p1+\'*FindByConfigIdAndCollectionId_\'+#p0", unless="#result==null") default Iterable<Attribute> findByConfigIdAndCollectionId(long configId, long collectionId, String version) This function finds the attributes.- Parameters:
configId
- Holds the config identifier.collectionId
- Holds the collection identifier.version
- holds the version identifier.- Returns:
- It returns the list of attribute entity.
-
save
@CacheEvict(key="\'COL-ID_\'+#p1+\'*FindByConfigIdAndCollectionId_\'+#attribute.configId") @CacheEvict(key="\'COL-ID_\'+#p1+\'*CommonProcess_GetAttributesByConfigId\'+#attribute.configId") default Attribute save(Attribute attribute, long collectionId) This function is used to update the existing attribute.- Parameters:
attribute
- Holds the attribute data for updating.collectionId
- Holds the collection identifier.- Returns:
- It returns the attribute which is updated.
-
update
@CacheEvict(key="\'COL-ID_\'+#p1+\'*FindAttributeByConfigId_\'+#attribute.configId+\'AndAttributeId_\'+#attribute.attributeId",condition="#attribute!=null") @CacheEvict(key="\'COL-ID_\'+#p1+\'*FindByConfigIdAndCollectionId_\'+#attribute.configId",condition="#attribute!=null") @CacheEvict(key="\'COL-ID_\'+#p1+\'*CommonProcess_GetAttributesByConfigId\'+#attribute.configId",condition="#attribute!=null") default Attribute update(Attribute attribute, long collectionId) This function is used to update the existing attribute.- Parameters:
attribute
- Holds the attribute data for updating.collectionId
- Holds the collection identifier.- Returns:
- It returns the attribute which is updated.
-