org.shredzone.repowatch.repository.hib
Class PackageDAOHibImpl

java.lang.Object
  extended by org.shredzone.repowatch.repository.hib.BaseDAOHibImpl<Package>
      extended by org.shredzone.repowatch.repository.hib.PackageDAOHibImpl
All Implemented Interfaces:
BaseDAO<Package>, PackageDAO

@Repository
@Transactional
public class PackageDAOHibImpl
extends BaseDAOHibImpl<Package>
implements PackageDAO

A Hibernate implementation of PackageDAO.

Version:
$Revision: 328 $

Constructor Summary
PackageDAOHibImpl()
           
 
Method Summary
 long countAllPackages()
          Counts all packages known.
 long countPackages(Repository repo)
          Counts all packages that belong to the given Repository.
 long countSearchResult(SearchDTO data)
          Counts the number of returned packages matching the given search.
 void deleteAllPackagesForDomain(Domain domain)
          Deletes all packages refering to the given domain.
 Package fetch(long id)
          Fetches the entity with the given ID.
 List<Package> findAllPackages(Domain domain, int start, int limit)
          Finds all packages for a Domain, within certain limits.
 SortedMap<String,String> findAllPackages(int start, int limit)
          Finds all packages for a Domain, within certain limits.
 List<Package> findAllPackagesForDomain(Domain domain)
          Finds all packages for a Domain.
 Package findLatestPackage(String name)
          Finds the latest version of a package with the given name.
 Package findPackage(Domain domain, String name)
          Finds a package with the given name, in the given Domain.
 List<Package> findSearchResult(SearchDTO data, int start, int limit)
          Returns the packages matching the given search.
 
Methods inherited from class org.shredzone.repowatch.repository.hib.BaseDAOHibImpl
delete, getCurrentSession, insert, merge
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.shredzone.repowatch.repository.BaseDAO
delete, insert, merge
 

Constructor Detail

PackageDAOHibImpl

public PackageDAOHibImpl()
Method Detail

fetch

@Transactional(readOnly=true)
public Package fetch(long id)
Description copied from interface: BaseDAO
Fetches the entity with the given ID.

Specified by:
fetch in interface BaseDAO<Package>
Parameters:
id - Entity ID
Returns:
Entity

countPackages

@Transactional(readOnly=true)
public long countPackages(Repository repo)
Description copied from interface: PackageDAO
Counts all packages that belong to the given Repository.

Specified by:
countPackages in interface PackageDAO
Parameters:
repo - A Repository
Returns:
Number of packages belonging to the repository.

findPackage

@Transactional(readOnly=true)
public Package findPackage(Domain domain,
                                         String name)
Description copied from interface: PackageDAO
Finds a package with the given name, in the given Domain.

Specified by:
findPackage in interface PackageDAO
Parameters:
domain - Domain to find the package in.
name - Name of the package.
Returns:
Package matching the name, or null if there is none.

findLatestPackage

@Transactional(readOnly=true)
public Package findLatestPackage(String name)
Description copied from interface: PackageDAO
Finds the latest version of a package with the given name.

Specified by:
findLatestPackage in interface PackageDAO
Parameters:
name - Name of the package
Returns:
Latest Package matching the name, or null if there is no package with that name at all.

countAllPackages

@Transactional(readOnly=true)
public long countAllPackages()
Description copied from interface: PackageDAO
Counts all packages known.

Specified by:
countAllPackages in interface PackageDAO
Returns:
Number of all packages.

findAllPackages

@Transactional(readOnly=true)
public SortedMap<String,String> findAllPackages(int start,
                                                              int limit)
Description copied from interface: PackageDAO
Finds all packages for a Domain, within certain limits. Returns the package name along with a package description.

Specified by:
findAllPackages in interface PackageDAO
Parameters:
start - The first entity to start with
limit - The maximum number of returned entities
Returns:
A sorted map of all Package names belonging to that Domain. The map's value contains a description of the package.

findAllPackagesForDomain

@Transactional(readOnly=true)
public List<Package> findAllPackagesForDomain(Domain domain)
Description copied from interface: PackageDAO
Finds all packages for a Domain.

Specified by:
findAllPackagesForDomain in interface PackageDAO
Parameters:
domain - A Domain
Returns:
A list of all Packages belonging to that Domain.

findAllPackages

@Transactional(readOnly=true)
public List<Package> findAllPackages(Domain domain,
                                                   int start,
                                                   int limit)
Description copied from interface: PackageDAO
Finds all packages for a Domain, within certain limits.

Specified by:
findAllPackages in interface PackageDAO
Parameters:
domain - A Domain
start - The first entity to start with
limit - The maximum number of returned entities
Returns:
A list of all Packages belonging to that Domain.

countSearchResult

@Transactional(readOnly=true)
public long countSearchResult(SearchDTO data)
Description copied from interface: PackageDAO
Counts the number of returned packages matching the given search.

Specified by:
countSearchResult in interface PackageDAO
Parameters:
data - SearchDTO with the search parameters
Returns:
Number of packages that were found.

findSearchResult

@Transactional(readOnly=true)
public List<Package> findSearchResult(SearchDTO data,
                                                    int start,
                                                    int limit)
Description copied from interface: PackageDAO
Returns the packages matching the given search.

Specified by:
findSearchResult in interface PackageDAO
Parameters:
data - SearchDTO with the search parameters
start - The first entity to start with
limit - The maximum number of returned entities
Returns:
A list of all Packages matching the search.

deleteAllPackagesForDomain

public void deleteAllPackagesForDomain(Domain domain)
Description copied from interface: PackageDAO
Deletes all packages refering to the given domain.

Specified by:
deleteAllPackagesForDomain in interface PackageDAO
Parameters:
domain - Domain to delete all packages of.


Copyright © 2007-2011 shredzone.org. All Rights Reserved.