org.kuali.kfs.gl
Class OJBUtility

java.lang.Object
  extended by org.kuali.kfs.gl.OJBUtility

public class OJBUtility
extends Object

This class provides a set of utilities that can handle common tasks related to business objects.


Field Summary
static String LOOKUP_DAO
           
 
Constructor Summary
OJBUtility()
           
 
Method Summary
static org.apache.ojb.broker.query.Criteria buildCriteriaFromMap(Map fieldValues, Object businessObject)
          This method builds an OJB query criteria based on the input field map
static LinkedHashMap buildPropertyMap(Object businessObject)
          This method builds a map of business object with its property names and values
static boolean createCriteria(Object businessObject, String propertyValue, String propertyName, org.apache.ojb.broker.query.Criteria criteria)
          This method build OJB criteria from the given property value and name
static Long getResultActualSize(Collection result, Integer recordCount, Map fieldValues, Object businessObject)
          This method calculates the actual size of given selection results
static Integer getResultLimit()
          This method gets the limit of the selection results
static Long getResultSizeFromMap(Map fieldValues, Object businessObject)
          This method gets the size of a result set from the given search criteria
static void limitResultSize(org.apache.ojb.broker.query.Query query)
          Limit the size of the result set from the given query operation
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

LOOKUP_DAO

public static final String LOOKUP_DAO
See Also:
Constant Field Values
Constructor Detail

OJBUtility

public OJBUtility()
Method Detail

buildPropertyMap

public static LinkedHashMap buildPropertyMap(Object businessObject)
This method builds a map of business object with its property names and values

Parameters:
businessObject - the given business object
Returns:
the map of business object with its property names and values

buildCriteriaFromMap

public static org.apache.ojb.broker.query.Criteria buildCriteriaFromMap(Map fieldValues,
                                                                        Object businessObject)
This method builds an OJB query criteria based on the input field map

Parameters:
fieldValues - the input field map
businessObject - the given business object
Returns:
an OJB query criteria

limitResultSize

public static void limitResultSize(org.apache.ojb.broker.query.Query query)
Limit the size of the result set from the given query operation

Parameters:
query - the given query operation

getResultActualSize

public static Long getResultActualSize(Collection result,
                                       Integer recordCount,
                                       Map fieldValues,
                                       Object businessObject)
This method calculates the actual size of given selection results

Parameters:
result - the given selection results
recordCount - the possible number of the given results
fieldValues - the input field map
businessObject - the given business object
Returns:
the actual size of given selection results

getResultSizeFromMap

public static Long getResultSizeFromMap(Map fieldValues,
                                        Object businessObject)
This method gets the size of a result set from the given search criteria

Parameters:
fieldValues - the input field map
businessObject - the given business object
Returns:
the size of a result set from the given search criteria

getResultLimit

public static Integer getResultLimit()
This method gets the limit of the selection results

Returns:
the limit of the selection results

createCriteria

public static boolean createCriteria(Object businessObject,
                                     String propertyValue,
                                     String propertyName,
                                     org.apache.ojb.broker.query.Criteria criteria)
This method build OJB criteria from the given property value and name



Copyright © 2005-2012 The Kuali Foundation. All Rights Reserved.