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>, GenericDao<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> findAllByIdListOrderedByName(List<Long> testCasesIds)
          Deprecated. not used
 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.tm.core.foundation.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<Execution> findAllExecutionByTestCase(Long tcId)
          Returns all the execution associated to this test-case
 List<TestStep> findAllStepsByIdFiltered(long testCaseId, org.squashtest.tm.core.foundation.collection.Paging 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<TestCaseLibraryNode> findBySearchCriteria(TestCaseSearchCriteria criteria)
           
 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)
          Will find all names of folderes content starting with the input string.
 List<String> findNamesInLibraryStartingWith(long libraryId, String nameStart)
          Will find all names of library root content starting with the input string.
 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<ExportTestCaseData> findTestCaseToExportFromNodes(List<Long> params)
           
 List<ExportTestCaseData> findTestCaseToExportFromProject(List<Long> projectIds)
           
 List<TestCase> findUnsortedAllByVerifiedRequirementVersion(long requirementVersionId)
          Returns unsorted collection of test cases verifying the requirement version of given id.
 List<ActionTestStep> getTestCaseSteps(Long testCaseId)
           
 
Methods inherited from class org.squashtest.csp.tm.internal.repository.hibernate.HibernateEntityDao
findAll, findAllByIds, findById, findDescendantIds, findSorted, findSorted, findSorted, getIdPropertyName
 
Methods inherited from class org.squashtest.csp.tm.internal.repository.hibernate.HibernateDao
clearFromCache, clearFromCache, currentSession, executeEntityNamedQuery, executeEntityNamedQuery, executeEntityNamedQuery, executeListNamedQuery, executeListNamedQuery, executeListNamedQuery, executeListNamedQuery, executeUpdateListQuery, flush, getEntity, persist, persist, persistEntity, remove, 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
findAll, findAllByIds, findById
 
Methods inherited from interface org.squashtest.csp.tm.internal.repository.GenericDao
clearFromCache, clearFromCache, 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

findAllByIdListOrderedByName

@Deprecated
public List<TestCase> findAllByIdListOrderedByName(List<Long> testCasesIds)
Deprecated. not used

Specified by:
findAllByIdListOrderedByName in interface TestCaseDao

findNamesInFolderStartingWith

public List<String> findNamesInFolderStartingWith(long folderId,
                                                  String nameStart)
Description copied from interface: TestCaseDao
Will find all names of folderes content starting with the input string. Will not return sub-folder's content names.

Specified by:
findNamesInFolderStartingWith in interface TestCaseDao
Parameters:
folderId - the id of a TestCaseFolder
nameStart - the search param
Returns:

findNamesInLibraryStartingWith

public List<String> findNamesInLibraryStartingWith(long libraryId,
                                                   String nameStart)
Description copied from interface: TestCaseDao
Will find all names of library root content starting with the input string. Will not return library folders and sub-folder's content names.

Specified by:
findNamesInLibraryStartingWith in interface TestCaseDao
Parameters:
libraryId - the id of a TestCaseLibrary
nameStart - the search param
Returns:

findAllStepsByIdFiltered

public List<TestStep> findAllStepsByIdFiltered(long testCaseId,
                                               org.squashtest.tm.core.foundation.collection.Paging 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.tm.core.foundation.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)

findUnsortedAllByVerifiedRequirementVersion

public List<TestCase> findUnsortedAllByVerifiedRequirementVersion(long requirementVersionId)
Description copied from interface: TestCaseDao
Returns unsorted collection of test cases verifying the requirement version of given id.

Specified by:
findUnsortedAllByVerifiedRequirementVersion in interface TestCaseDao
Returns:

findBySearchCriteria

public List<TestCaseLibraryNode> findBySearchCriteria(TestCaseSearchCriteria criteria)
Specified by:
findBySearchCriteria in interface TestCaseDao

findAllExecutionByTestCase

public List<Execution> findAllExecutionByTestCase(Long tcId)
Description copied from interface: TestCaseDao
Returns all the execution associated to this test-case

Specified by:
findAllExecutionByTestCase in interface TestCaseDao
Returns:

findTestCaseToExportFromProject

public List<ExportTestCaseData> findTestCaseToExportFromProject(List<Long> projectIds)
Specified by:
findTestCaseToExportFromProject in interface TestCaseDao

findTestCaseToExportFromNodes

public List<ExportTestCaseData> findTestCaseToExportFromNodes(List<Long> params)
Specified by:
findTestCaseToExportFromNodes in interface TestCaseDao


Copyright © 2010-2012 Henix, henix.fr. All Rights Reserved.