org.squashtest.csp.tm.internal.repository.hibernate
Class HibernateTestCaseDao

java.lang.Object
  extended by org.squashtest.csp.tm.internal.repository.hibernate.HibernateDao<ENTITY_TYPE>
      extended by org.squashtest.csp.tm.internal.repository.hibernate.HibernateEntityDao<TestCase>
          extended by org.squashtest.csp.tm.internal.repository.hibernate.HibernateTestCaseDao
All Implemented Interfaces:
EntityDao<TestCase>, TestCaseDao

@Repository
public class HibernateTestCaseDao
extends HibernateEntityDao<TestCase>
implements TestCaseDao

DAO for org.squashtest.csp.tm.domain.testcase.TestCase

Author:
bsiri

Field Summary
 
Fields inherited from class org.squashtest.csp.tm.internal.repository.hibernate.HibernateDao
entityType
 
Constructor Summary
HibernateTestCaseDao()
           
 
Method Summary
 long countByVerifiedRequirementVersion(long verifiedId)
           
 long countCallingTestSteps(long testCaseId)
          Counts the calling test steps of a test case
 List<TestCase> findAllByIdList(List<Long> testCasesIds)
           
 List<TestCase> findAllByIdListNonOrdered(List<Long> testCasesIds)
           
 List<TestCaseLibraryNode> findAllByNameContaining(String tokenInName, boolean groupByProject)
          Finds all TestCaseLibraryNode which name contains the given token.
 List<TestCase> findAllByRequirement(RequirementSearchCriteria criteria, boolean isProjectOrdered)
          Returns the test cases associated with at least a requirement that meets the criteria
 List<TestCase> findAllByVerifiedRequirementVersion(long verifiedId, org.squashtest.csp.core.infrastructure.collection.PagingAndSorting sorting)
          Returns paged and sorted collection of test cases verifying the requirement version of given id.
 List<TestCase> findAllCallingTestCases(long testCaseId, CollectionSorting sorting)
          returns the ids of all the test cases having at least one call test step referencing the given test case.
 List<TestStep> findAllStepsByIdFiltered(long testCaseId, CollectionFilter filter)
           
 List<Long> findAllTestCasesIdsCalledByTestCase(long testCaseId)
          Finds all the ids of the test cases called by a given test case.
 List<Long> findAllTestCasesIdsCalledByTestCases(List<Long> testCasesIds)
          Finds all the ids of the test cases called by a given list of test cases.
 TestCase findAndInit(Long testCaseId)
           
 TestCase findByIdWithInitializedSteps(long testCaseId)
           
 List<Long> findCalledTestCaseOfCallSteps(List<Long> testStepsIds)
          Returns the test cases ids first called by the call steps found in the list of given test steps ids.
 List<Long> findDistinctTestCasesIdsCalledByTestCase(Long testCaseId)
           
 List<String> findNamesInFolderStartingWith(long folderId, String nameStart)
           
 List<String> findNamesInLibraryStartingWith(long libraryId, String nameStart)
           
 TestCase findTestCaseByTestStepId(long testStepId)
          This method returns the test step's associated TestCase
 List<Long> findTestCasesHavingCaller(Collection<Long> testCasesIds)
          Given a list of test case ids, returns a sublist of the test case ids.
 List<Object[]> findTestCasesHavingCallerDetails(Collection<Long> testCaseIds)
          Given a list of test case ids, returns a list of the following structure : - caller id (null if no match), - caller name (null if no match), - called id, - called name Note that only first-level callers will be included if found, additional invokations will be needed to fetch all the hierarchy.
 List<ActionTestStep> getTestCaseSteps(Long testCaseId)
           
 
Methods inherited from class org.squashtest.csp.tm.internal.repository.hibernate.HibernateEntityDao
findById, flush, getIdPropertyName, persist, persist, remove
 
Methods inherited from class org.squashtest.csp.tm.internal.repository.hibernate.HibernateDao
currentSession, executeEntityNamedQuery, executeListNamedQuery, executeListNamedQuery, executeListNamedQuery, getEntity, persistEntity, removeEntity
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.squashtest.csp.tm.internal.repository.EntityDao
findById, flush, persist, persist, remove
 

Constructor Detail

HibernateTestCaseDao

public HibernateTestCaseDao()
Method Detail

findAndInit

public TestCase findAndInit(Long testCaseId)
Specified by:
findAndInit in interface TestCaseDao

findByIdWithInitializedSteps

public TestCase findByIdWithInitializedSteps(long testCaseId)
Specified by:
findByIdWithInitializedSteps in interface TestCaseDao

getTestCaseSteps

public List<ActionTestStep> getTestCaseSteps(Long testCaseId)
Specified by:
getTestCaseSteps in interface TestCaseDao

findAllByIdList

public List<TestCase> findAllByIdList(List<Long> testCasesIds)
Specified by:
findAllByIdList in interface EntityDao<TestCase>
Specified by:
findAllByIdList in interface TestCaseDao
Overrides:
findAllByIdList in class HibernateEntityDao<TestCase>

findAllByIdListNonOrdered

public List<TestCase> findAllByIdListNonOrdered(List<Long> testCasesIds)
Specified by:
findAllByIdListNonOrdered in interface TestCaseDao

findNamesInFolderStartingWith

public List<String> findNamesInFolderStartingWith(long folderId,
                                                  String nameStart)
Specified by:
findNamesInFolderStartingWith in interface TestCaseDao

findNamesInLibraryStartingWith

public List<String> findNamesInLibraryStartingWith(long libraryId,
                                                   String nameStart)
Specified by:
findNamesInLibraryStartingWith in interface TestCaseDao

findAllStepsByIdFiltered

public List<TestStep> findAllStepsByIdFiltered(long testCaseId,
                                               CollectionFilter filter)
Specified by:
findAllStepsByIdFiltered in interface TestCaseDao

findAllByNameContaining

public List<TestCaseLibraryNode> findAllByNameContaining(String tokenInName,
                                                         boolean groupByProject)
Description copied from interface: TestCaseDao
Finds all TestCaseLibraryNode which name contains the given token.

Specified by:
findAllByNameContaining in interface TestCaseDao
Returns:

findTestCaseByTestStepId

public TestCase findTestCaseByTestStepId(long testStepId)
Description copied from interface: TestCaseDao
This method returns the test step's associated TestCase

Specified by:
findTestCaseByTestStepId in interface TestCaseDao
Parameters:
testStepId - the test step id
Returns:
the associated test Case

countCallingTestSteps

public long countCallingTestSteps(long testCaseId)
Description copied from interface: TestCaseDao
Counts the calling test steps of a test case

Specified by:
countCallingTestSteps in interface TestCaseDao
Returns:

findTestCasesHavingCaller

public List<Long> findTestCasesHavingCaller(Collection<Long> testCasesIds)
Description copied from interface: TestCaseDao
Given a list of test case ids, returns a sublist of the test case ids. An id will be included in the output list if at least one test case calls the given test case.

Specified by:
findTestCasesHavingCaller in interface TestCaseDao
Returns:
a sublist of the input list, with test cases never called filtered out.

findAllTestCasesIdsCalledByTestCase

public List<Long> findAllTestCasesIdsCalledByTestCase(long testCaseId)
Description copied from interface: TestCaseDao
Finds all the ids of the test cases called by a given test case.

Specified by:
findAllTestCasesIdsCalledByTestCase in interface TestCaseDao
Returns:

findDistinctTestCasesIdsCalledByTestCase

public List<Long> findDistinctTestCasesIdsCalledByTestCase(Long testCaseId)
Specified by:
findDistinctTestCasesIdsCalledByTestCase in interface TestCaseDao

findAllTestCasesIdsCalledByTestCases

public List<Long> findAllTestCasesIdsCalledByTestCases(List<Long> testCasesIds)
Description copied from interface: TestCaseDao
Finds all the ids of the test cases called by a given list of test cases.

Specified by:
findAllTestCasesIdsCalledByTestCases in interface TestCaseDao
Returns:

findAllCallingTestCases

public List<TestCase> findAllCallingTestCases(long testCaseId,
                                              CollectionSorting sorting)
Description copied from interface: TestCaseDao
returns the ids of all the test cases having at least one call test step referencing the given test case.

Specified by:
findAllCallingTestCases in interface TestCaseDao
Parameters:
testCaseId - the id of the test case.
sorting - the sorting attributes and the like.
Returns:
the list of test cases having at least one call step calling the input test case.

findTestCasesHavingCallerDetails

public List<Object[]> findTestCasesHavingCallerDetails(Collection<Long> testCaseIds)
Description copied from interface: TestCaseDao
Given a list of test case ids, returns a list of the following structure : - caller id (null if no match), - caller name (null if no match), - called id, - called name Note that only first-level callers will be included if found, additional invokations will be needed to fetch all the hierarchy.

Specified by:
findTestCasesHavingCallerDetails in interface TestCaseDao
Parameters:
testCaseIds - the list of test case ids under inquiry.
Returns:
a structure described just like above.

findAllByRequirement

public List<TestCase> findAllByRequirement(RequirementSearchCriteria criteria,
                                           boolean isProjectOrdered)
Description copied from interface: TestCaseDao
Returns the test cases associated with at least a requirement that meets the criteria

Specified by:
findAllByRequirement in interface TestCaseDao
Parameters:
criteria - the requirement search criteria
isProjectOrdered - if set to true, the list of test case is ordered by project
Returns:
the list of test case (order by project if specified)

findCalledTestCaseOfCallSteps

public List<Long> findCalledTestCaseOfCallSteps(List<Long> testStepsIds)
Description copied from interface: TestCaseDao
Returns the test cases ids first called by the call steps found in the list of given test steps ids. Note: only first level called test case are returned. To get the whole test case tree you should use CallStepManagerService.getTestCaseCallTree(Long).

Specified by:
findCalledTestCaseOfCallSteps in interface TestCaseDao
Returns:
the list of test case ids called by test steps

findAllByVerifiedRequirementVersion

public List<TestCase> findAllByVerifiedRequirementVersion(long verifiedId,
                                                          org.squashtest.csp.core.infrastructure.collection.PagingAndSorting sorting)
Description copied from interface: TestCaseDao
Returns paged and sorted collection of test cases verifying the requirement version of given id.

Specified by:
findAllByVerifiedRequirementVersion in interface TestCaseDao
Returns:

countByVerifiedRequirementVersion

public long countByVerifiedRequirementVersion(long verifiedId)
Specified by:
countByVerifiedRequirementVersion in interface TestCaseDao
Returns:
See Also:
TestCaseDao.countByVerifiedRequirementVersion(long)


Copyright © 2010-2012 Squashtest TM, Squashtest.org. All Rights Reserved.