Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
Copyright 2005-2013 The Kuali Foundation Licensed under the Educational Community License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.opensource.org/licenses/ecl2.php Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
 
 package org.kuali.rice.krad.dao;
 
 import java.util.List;
 import java.util.Map;
 
This is the generic data access interface for business objects. This should be used for unit testing purposes only.
 
 public interface BusinessObjectDao {
    
Saves any object that implements the BusinessObject interface.

Parameters:
bo
 
Saves a List of BusinessObjects.

Parameters:
businessObjects
 
     public List<? extends PersistableBusinessObjectsave(List businessObjects);

    
Retrieves an object instance identified by its primary key. For composite keys, use findByPrimaryKey(java.lang.Class,java.util.Map)

Parameters:
clazz
primaryKey
Returns:
 
     public <T extends BusinessObject> T findBySinglePrimaryKey(Class<T> clazzObject primaryKey);
    
    
Retrieves an object instance identified bys it primary keys and values. This can be done by constructing a map where the key to the map entry is the primary key attribute and the value of the entry being the primary key value. For composite keys, pass in each primaryKey attribute and its value as a map entry.

Parameters:
clazz
primaryKeys
Returns:
 
     public <T extends BusinessObject> T findByPrimaryKey(Class<T> clazzMap<String, ?> primaryKeys);
    
    
Retrieves an object, based on its PK object

Parameters:
clazz the class of the object to retrieve
pkObject the value of the primary key
Returns:
the retrieved PersistableBusinessObject
 
 	public abstract <T  extends BusinessObject> T findByPrimaryKeyUsingKeyObject(Class<T> clazzObject pkObject);

    
Retrieves an object instance identified by the class of the given object and the object's primary key values.

Parameters:
object
Returns:
 
Retrieves a collection of business objects populated with data, such that each record in the database populates a new object instance. This will only retrieve business objects by class type.

Parameters:
clazz
Returns:
 
     public <T extends BusinessObjectCollection<T> findAll(Class<T> clazz);
    
    
Retrieves a collection of business objects populated with data, such that each record in the database populates a new object instance. This will only retrieve business objects by class type. Adds criteria on active column to return only active records. Assumes there exist a mapping for PropertyConstants.Active

Parameters:
clazz
Returns:
 
    public <T extends BusinessObjectCollection<T> findAllActive(Class<T> clazz);
    public <T extends BusinessObjectCollection<T> findAllInactive(Class<T> clazz);
    
    
Retrieves a collection of business objects populated with data, such that each record in the database populates a new object instance. This will only retrieve business objects by class type. Orders the results by the given field.

Parameters:
clazz
Returns:
    public <T extends BusinessObjectCollection<T> findAllOrderBy(Class<T> clazzString sortFieldboolean sortAscending);
    
    
Retrieves a collection of business objects populated with data, such that each record in the database populates a new object instance. This will only retrieve business objects by class type. Orders the results by the given field. Adds criteria on active column to return only active records. Assumes there exist a mapping for PropertyConstants.Active

Parameters:
clazz
Returns:
    public <T extends BusinessObjectCollection<T> findAllActiveOrderBy(Class<T> clazzString sortFieldboolean sortAscending);

    
This method retrieves a collection of business objects populated with data, such that each record in the database populates a new object instance. This will retrieve business objects by class type and also by criteria passed in as key-value pairs, specifically attribute name-expected value.

Parameters:
clazz
fieldValues
Returns:
    public <T extends BusinessObjectCollection<T> findMatching(Class<T> clazzMap<String, ?> fieldValues);
    
    
Finds all entities matching the passed in Rice JPA criteria

Parameters:
<T> the type of the entity that will be returned
criteria the criteria to form the query with
Returns:
a Collection (most likely a List) of all matching entities
    //public abstract <T extends BusinessObject> Collection<T> findMatching(Criteria criteria);
    
    
This method retrieves a collection of business objects populated with data, such that each record in the database populates a new object instance. This will retrieve business objects by class type and also by criteria passed in as key-value pairs, specifically attribute name-expected value. Adds criteria on active column to return only active records. Assumes there exist a mapping for PropertyConstants.Active

Parameters:
clazz
fieldValues
Returns:
    public <T extends BusinessObjectCollection<T> findMatchingActive(Class<T> clazzMap<String, ?> fieldValues);

    

Parameters:
clazz
fieldValues
Returns:
count of BusinessObjects of the given class whose fields match the values in the given Map.
    public int countMatching(Class clazzMap<String, ?> fieldValues);

    
    
This method returns the number of matching result given the positive criterias and negative criterias. The negative criterias are the ones that will be set to "notEqualTo" or "notIn"

Parameters:
clazz
positiveFieldValues Map of fields and values for positive criteria
negativeFieldValues Map of fields and values for negative criteria
Returns:
    public int countMatching(Class clazzMap<String, ?> positiveFieldValuesMap<String, ?> negativeFieldValues);
    
    
This method retrieves a collection of business objects populated with data, such that each record in the database populates a new object instance. This will retrieve business objects by class type and also by criteria passed in as key-value pairs, specifically attribute name-expected value. Orders the results by the given field.

Parameters:
clazz
fieldValues
Returns:
    public <T extends BusinessObjectCollection<T> findMatchingOrderBy(Class<T> clazzMap<String, ?> fieldValuesString sortFieldboolean sortAscending);

    
Deletes a business object from the database.

Parameters:
bo
    public void delete(PersistableBusinessObject bo);

    
Deletes each business object in the given List from the database.

Parameters:
boList
    public void delete(List<? extends PersistableBusinessObjectboList);

    
Deletes the business objects matching the given fieldValues

Parameters:
clazz
fieldValues
    public void deleteMatching(Class clazzMap<String, ?> fieldValues);
    
    
Merges the given business object, but tells the ORM that the object is to be treated as Read Only, and even if it has changes, it will not be persisted to the database

Parameters:
bo the business object to managed
Returns:
the managed copied of the business object
New to GrepCode? Check out our FAQ X