All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.sakaiproject.genericdao.api.finders.AllFinder Maven / Gradle / Ivy

Go to download

Generic Dao is a Java package which allows a developer to skip writing DAOs for their persistence objects when they are using Spring and/or Hibernate. The package was originally created by Aaron Zeckoski for the Evaluation System project but was repackaged to make it distributable by request. It is used in the RSF framework (http://www2.caret.cam.ac.uk/rsfwiki/). Note about the BeanUtils provided dependency: BeanUtils is not required if you are not using it in your project. Note about the Hibernate provided dependency: Hibernate is not required if you are not using it in your project.

The newest version!
/******************************************************************************
 * AllFinder.java - created by [email protected]
 * 
 * Copyright (c) 2006 Aaron Zeckoski
 * Licensed under the Apache License, Version 2
 * 
 * A copy of the Apache License, Version 2 has been included in this 
 * distribution and is available at: http://www.apache.org/licenses/LICENSE-2.0.txt
 * 
 * Contributors:
 * Aaron Zeckoski ([email protected]) - primary
 * 
 *****************************************************************************/

package org.sakaiproject.genericdao.api.finders;

import java.util.List;

/**
 * This Finder provides methods to find all persistent objects of a
 * certain type
 * 
 * @author Aaron Zeckoski ([email protected])
 */
public interface AllFinder {

	/**
	 * Find all objects of the type entityClass and return them in a List.
	 * 
	 * @param entityClass class type of the persistent object
	 * @return a List of 0 or more persistent objects
	 */
	public  List findAll(Class entityClass);

	/**
	 * Find all objects of the type entityClass and return them in a List,
	 * apply limits to the number of items returned. Order of returned items is not
	 * guaranteed.
	 * 
	 * @param entityClass class type of the persistent object
	 * @param firstResult the index of the first result object to be retrieved (numbered from 0)
	 * @param maxResults the maximum number of result objects to retrieve (or <=0 for no limit)
	 * @return a List of 0 or more persistent objects
	 */
	public  List findAll(Class entityClass, int firstResult, int maxResults);

	/**
	 * Get a count of all items of the type entityClass.
	 * 
	 * @param entityClass class type of the persistent object
	 * @return the number of items found
	 */
	public  int countAll(Class entityClass);

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy