com.silverpeas.pdc.dao
Interface PdcClassificationRepository

All Superinterfaces:
org.springframework.data.repository.CrudRepository<PdcClassification,Long>, org.springframework.data.jpa.repository.JpaRepository<PdcClassification,Long>, org.springframework.data.repository.PagingAndSortingRepository<PdcClassification,Long>, org.springframework.data.repository.Repository<PdcClassification,Long>

public interface PdcClassificationRepository
extends org.springframework.data.jpa.repository.JpaRepository<PdcClassification,Long>

DAO that handles the persistence of PdcClassification beans.


Method Summary
 List<PdcClassification> findClassificationsByPdcAxisValues(List<PdcAxisValue> values)
          Finds all classifications on the PdC that have at least one position with the one or more of the specified axis values.
 PdcClassification findPredefinedClassificationByComponentInstanceId(String instanceId)
          Finds the predefined classification on the PdC that is set for the whole specified component instance.
 PdcClassification findPredefinedClassificationByNodeId(String nodeId, String instanceId)
          Finds the predefined classification on the PdC that is set for the contents in the specified node of the specified component instance.
 
Methods inherited from interface org.springframework.data.jpa.repository.JpaRepository
deleteAllInBatch, deleteInBatch, findAll, findAll, flush, save, saveAndFlush
 
Methods inherited from interface org.springframework.data.repository.PagingAndSortingRepository
findAll
 
Methods inherited from interface org.springframework.data.repository.CrudRepository
count, delete, delete, delete, deleteAll, exists, findAll, findOne, save
 

Method Detail

findPredefinedClassificationByComponentInstanceId

@Query(value="from PdcClassification where instanceId=:instanceId and contentId is null and nodeId is null")
PdcClassification findPredefinedClassificationByComponentInstanceId(@Param(value="instanceId")
                                                                          String instanceId)
Finds the predefined classification on the PdC that is set for the whole specified component instance.

Parameters:
instanceId - the unique identifier of the component instance.
Returns:
the predefined classification that is set to the component instance, or null if no predefined classification was set for the component instance.

findPredefinedClassificationByNodeId

@Query(value="from PdcClassification where instanceId=:instanceId and contentId is null and nodeId=:nodeId)")
PdcClassification findPredefinedClassificationByNodeId(@Param(value="nodeId")
                                                             String nodeId,
                                                             @Param(value="instanceId")
                                                             String instanceId)
Finds the predefined classification on the PdC that is set for the contents in the specified node of the specified component instance.

Parameters:
nodeId - the unique identifier of the node.
instanceId - the unique identifier of the component instance to which the node belongs.
Returns:
either the predefined classification associated with the node or null if no predefined classification exists for that node.

findClassificationsByPdcAxisValues

@Query(value="select distinct c from PdcClassification c join c.positions p join p.axisValues v where v in :values")
List<PdcClassification> findClassificationsByPdcAxisValues(@Param(value="values")
                                                                 List<PdcAxisValue> values)
Finds all classifications on the PdC that have at least one position with the one or more of the specified axis values. If no such values exist, then an empty list is returned.

Parameters:
values - a list of PdC's axis values.
Returns:
a list of classifications having at least one of the specified values or an empty list.


Copyright © 2016 Silverpeas. All Rights Reserved.