org.kuali.rice.kns.dao.impl
Class LookupDaoJpa

java.lang.Object
  extended by org.kuali.rice.kns.dao.impl.LookupDaoJpa
All Implemented Interfaces:
LookupDao

public class LookupDaoJpa
extends Object
implements LookupDao

This class is the OJB implementation of the LookupDao interface.


Field Summary
private  BusinessObjectDictionaryService businessObjectDictionaryService
           
private  DateTimeService dateTimeService
           
private  javax.persistence.EntityManager entityManager
           
private static org.apache.log4j.Logger LOG
           
private  PersistenceStructureService persistenceStructureService
           
 
Constructor Summary
LookupDaoJpa()
           
 
Method Summary
private  void addAndCriteria(String propertyName, String propertyValue, Class propertyType, boolean caseInsensitive, Criteria criteria)
           
private  void addCriteria(String propertyName, String propertyValue, Class propertyType, boolean caseInsensitive, boolean treatWildcardsAndOperatorsAsLiteral, Criteria criteria)
           
private  void addDateRangeCriteria(String propertyName, String propertyValue, Criteria criteria)
           
protected  void addInactivateableFromToActiveCriteria(Object example, String activeSearchValue, Criteria criteria, Map searchValues)
          Translates criteria for active status to criteria on the active from and to fields
protected  void addInactivateableFromToCurrentCriteria(Object example, String currentSearchValue, Criteria criteria, Map searchValues)
          Translates criteria for current status to a sub-query on active begin date
private  void addLogicalOperatorCriteria(String propertyName, String propertyValue, Class propertyType, boolean caseInsensitive, Criteria criteria, String splitValue)
           
private  void addNotCriteria(String propertyName, String propertyValue, Class propertyType, boolean caseInsensitive, Criteria criteria)
           
private  void addNumericRangeCriteria(String propertyName, String propertyValue, Criteria criteria)
           
private  void addOrCriteria(String propertyName, String propertyValue, Class propertyType, boolean caseInsensitive, Criteria criteria)
           
private  void addStringRangeCriteria(String propertyName, String propertyValue, Criteria criteria)
           
private  PersistableBusinessObject checkBusinessObjectClass(Class businessObjectClass)
           
private  BigDecimal cleanNumeric(String value)
           
 boolean createCriteria(Object example, String searchValue, String propertyName, boolean caseInsensitive, boolean treatWildcardsAndOperatorsAsLiteral, Object criteria)
          Create OJB criteria based on business object, search field and value
 boolean createCriteria(Object example, String searchValue, String propertyName, boolean caseInsensitive, boolean treatWildcardsAndOperatorsAsLiteral, Object criteria, Map searchValues)
           
 boolean createCriteria(Object example, String searchValue, String propertyName, Object criteria)
          Create OJB criteria based on business object, search field and value
private  Collection executeSearch(Class businessObjectClass, Criteria criteria, boolean unbounded)
           
 Collection findCollectionBySearchHelper(Class businessObjectClass, Map formProps, boolean unbounded, boolean usePrimaryKeyValuesOnly)
           
 Collection findCollectionBySearchHelper(Class businessObjectClass, Map formProps, boolean unbounded, boolean usePrimaryKeyValuesOnly, Object additionalCriteria)
           
 Long findCountByMap(Object example, Map formProps)
          Returns a count of objects based on the given search parameters.
 Object findObjectByMap(Object example, Map formProps)
          Retrieves a Object based on the search criteria, which should uniquely identify a record.
 Criteria getCollectionCriteriaFromMap(PersistableBusinessObject example, Map formProps)
           
 Criteria getCollectionCriteriaFromMapUsingPrimaryKeysOnly(Class businessObjectClass, Map formProps)
           
 javax.persistence.EntityManager getEntityManager()
           
private  boolean isWriteable(Object o, String p)
          Return whether or not an attribute is writeable.
private  Date parseDate(String dateString)
           
 void setBusinessObjectDictionaryService(BusinessObjectDictionaryService businessObjectDictionaryService)
           
 void setDateTimeService(DateTimeService dateTimeService)
           
 void setEntityManager(javax.persistence.EntityManager entityManager)
           
 void setPersistenceStructureService(PersistenceStructureService persistenceStructureService)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

LOG

private static final org.apache.log4j.Logger LOG

dateTimeService

private DateTimeService dateTimeService

persistenceStructureService

private PersistenceStructureService persistenceStructureService

businessObjectDictionaryService

private BusinessObjectDictionaryService businessObjectDictionaryService

entityManager

private javax.persistence.EntityManager entityManager
Constructor Detail

LookupDaoJpa

public LookupDaoJpa()
Method Detail

findCountByMap

public Long findCountByMap(Object example,
                           Map formProps)
Description copied from interface: LookupDao
Returns a count of objects based on the given search parameters.

Specified by:
findCountByMap in interface LookupDao
Returns:
Long returned from the search

findCollectionBySearchHelper

public Collection findCollectionBySearchHelper(Class businessObjectClass,
                                               Map formProps,
                                               boolean unbounded,
                                               boolean usePrimaryKeyValuesOnly)
Specified by:
findCollectionBySearchHelper in interface LookupDao

findCollectionBySearchHelper

public Collection findCollectionBySearchHelper(Class businessObjectClass,
                                               Map formProps,
                                               boolean unbounded,
                                               boolean usePrimaryKeyValuesOnly,
                                               Object additionalCriteria)
Specified by:
findCollectionBySearchHelper in interface LookupDao

getCollectionCriteriaFromMap

public Criteria getCollectionCriteriaFromMap(PersistableBusinessObject example,
                                             Map formProps)

getCollectionCriteriaFromMapUsingPrimaryKeysOnly

public Criteria getCollectionCriteriaFromMapUsingPrimaryKeysOnly(Class businessObjectClass,
                                                                 Map formProps)

checkBusinessObjectClass

private PersistableBusinessObject checkBusinessObjectClass(Class businessObjectClass)

executeSearch

private Collection executeSearch(Class businessObjectClass,
                                 Criteria criteria,
                                 boolean unbounded)

isWriteable

private boolean isWriteable(Object o,
                            String p)
                     throws IllegalArgumentException
Return whether or not an attribute is writeable. This method is aware that that Collections may be involved and handles them consistently with the way in which OJB handles specifying the attributes of elements of a Collection.

Parameters:
o -
p -
Returns:
Throws:
IllegalArgumentException

createCriteria

public boolean createCriteria(Object example,
                              String searchValue,
                              String propertyName,
                              Object criteria)
Description copied from interface: LookupDao
Create OJB criteria based on business object, search field and value

Specified by:
createCriteria in interface LookupDao
Returns:
true if the criteria is created successfully; otherwise, return false

createCriteria

public boolean createCriteria(Object example,
                              String searchValue,
                              String propertyName,
                              boolean caseInsensitive,
                              boolean treatWildcardsAndOperatorsAsLiteral,
                              Object criteria)
Description copied from interface: LookupDao
Create OJB criteria based on business object, search field and value

Specified by:
createCriteria in interface LookupDao
Returns:
true if the criteria is created successfully; otherwise, return false

createCriteria

public boolean createCriteria(Object example,
                              String searchValue,
                              String propertyName,
                              boolean caseInsensitive,
                              boolean treatWildcardsAndOperatorsAsLiteral,
                              Object criteria,
                              Map searchValues)

findObjectByMap

public Object findObjectByMap(Object example,
                              Map formProps)
Description copied from interface: LookupDao
Retrieves a Object based on the search criteria, which should uniquely identify a record.

Specified by:
findObjectByMap in interface LookupDao
Returns:
Object returned from the search
See Also:
LookupDao.findObjectByMap(java.lang.Object, java.util.Map)

addCriteria

private void addCriteria(String propertyName,
                         String propertyValue,
                         Class propertyType,
                         boolean caseInsensitive,
                         boolean treatWildcardsAndOperatorsAsLiteral,
                         Criteria criteria)

addInactivateableFromToActiveCriteria

protected void addInactivateableFromToActiveCriteria(Object example,
                                                     String activeSearchValue,
                                                     Criteria criteria,
                                                     Map searchValues)
Translates criteria for active status to criteria on the active from and to fields

Parameters:
example - - business object being queried on
activeSearchValue - - value for the active search field, should convert to boolean
criteria - - Criteria object being built
searchValues - - Map containing all search keys and values

addInactivateableFromToCurrentCriteria

protected void addInactivateableFromToCurrentCriteria(Object example,
                                                      String currentSearchValue,
                                                      Criteria criteria,
                                                      Map searchValues)
Translates criteria for current status to a sub-query on active begin date

Parameters:
example - - business object being queried on
currentSearchValue - - value for the current search field, should convert to boolean
criteria - - Criteria object being built

addOrCriteria

private void addOrCriteria(String propertyName,
                           String propertyValue,
                           Class propertyType,
                           boolean caseInsensitive,
                           Criteria criteria)

addAndCriteria

private void addAndCriteria(String propertyName,
                            String propertyValue,
                            Class propertyType,
                            boolean caseInsensitive,
                            Criteria criteria)

addNotCriteria

private void addNotCriteria(String propertyName,
                            String propertyValue,
                            Class propertyType,
                            boolean caseInsensitive,
                            Criteria criteria)

addLogicalOperatorCriteria

private void addLogicalOperatorCriteria(String propertyName,
                                        String propertyValue,
                                        Class propertyType,
                                        boolean caseInsensitive,
                                        Criteria criteria,
                                        String splitValue)

parseDate

private Date parseDate(String dateString)

addDateRangeCriteria

private void addDateRangeCriteria(String propertyName,
                                  String propertyValue,
                                  Criteria criteria)

cleanNumeric

private BigDecimal cleanNumeric(String value)

addNumericRangeCriteria

private void addNumericRangeCriteria(String propertyName,
                                     String propertyValue,
                                     Criteria criteria)

addStringRangeCriteria

private void addStringRangeCriteria(String propertyName,
                                    String propertyValue,
                                    Criteria criteria)

setDateTimeService

public void setDateTimeService(DateTimeService dateTimeService)
Parameters:
dateTimeService - the dateTimeService to set

getEntityManager

public javax.persistence.EntityManager getEntityManager()
Returns:
the entityManager

setEntityManager

public void setEntityManager(javax.persistence.EntityManager entityManager)
Parameters:
entityManager - the entityManager to set

setPersistenceStructureService

public void setPersistenceStructureService(PersistenceStructureService persistenceStructureService)

setBusinessObjectDictionaryService

public void setBusinessObjectDictionaryService(BusinessObjectDictionaryService businessObjectDictionaryService)


Copyright © 2007-2011 The Kuali Foundation. All Rights Reserved.