public class LookupCriteriaGeneratorImpl extends Object implements LookupCriteriaGenerator
Constructor and Description |
---|
LookupCriteriaGeneratorImpl() |
Modifier and Type | Method and Description |
---|---|
protected void |
addAnd(org.kuali.rice.krad.service.impl.LookupCriteriaGeneratorImpl.Predicates criteria,
org.kuali.rice.krad.service.impl.LookupCriteriaGeneratorImpl.Predicates criteria2) |
protected void |
addAndCriteria(String propertyName,
String propertyValue,
Class propertyType,
boolean caseInsensitive,
org.kuali.rice.krad.service.impl.LookupCriteriaGeneratorImpl.Predicates criteria) |
protected void |
addBetween(org.kuali.rice.krad.service.impl.LookupCriteriaGeneratorImpl.Predicates criteria,
String propertyName,
Object value1,
Object value2) |
protected void |
addBetween(org.kuali.rice.krad.service.impl.LookupCriteriaGeneratorImpl.Predicates criteria,
String propertyName,
String value1,
String value2,
boolean caseInsensitive) |
protected void |
addCriteria(String propertyName,
String propertyValue,
Class<?> propertyType,
boolean caseInsensitive,
boolean treatWildcardsAndOperatorsAsLiteral,
org.kuali.rice.krad.service.impl.LookupCriteriaGeneratorImpl.Predicates criteria)
Adds to the criteria object based on the property type and any query characters given.
|
protected boolean |
addCriteriaForPropertyValues(Object example,
String propertyName,
boolean caseInsensitive,
boolean treatWildcardsAndOperatorsAsLiteral,
org.kuali.rice.krad.service.impl.LookupCriteriaGeneratorImpl.Predicates criteria,
Map formProps,
String... searchValues)
Adds a criteria for the property for each search value, handling search value case
|
protected void |
addDateRangeCriteria(String propertyName,
String propertyValue,
boolean treatWildcardsAndOperatorsAsLiteral,
org.kuali.rice.krad.service.impl.LookupCriteriaGeneratorImpl.Predicates criteria)
Adds to the criteria object based on query characters given
|
protected void |
addEqual(org.kuali.rice.krad.service.impl.LookupCriteriaGeneratorImpl.Predicates criteria,
String propertyName,
Object searchValue) |
protected void |
addEqual(org.kuali.rice.krad.service.impl.LookupCriteriaGeneratorImpl.Predicates criteria,
String propertyName,
String searchValue,
boolean caseInsensitive) |
protected void |
addEqualNumeric(org.kuali.rice.krad.service.impl.LookupCriteriaGeneratorImpl.Predicates criteria,
String propertyName,
Class<?> propertyClass,
String searchValue) |
protected void |
addEqualTemporal(org.kuali.rice.krad.service.impl.LookupCriteriaGeneratorImpl.Predicates criteria,
String propertyName,
String searchValue) |
protected void |
addEqualToBoolean(org.kuali.rice.krad.service.impl.LookupCriteriaGeneratorImpl.Predicates criteria,
String propertyName,
String propertyValue) |
protected void |
addGreaterThan(org.kuali.rice.krad.service.impl.LookupCriteriaGeneratorImpl.Predicates criteria,
String propertyName,
Object propertyValue) |
protected void |
addGreaterThan(org.kuali.rice.krad.service.impl.LookupCriteriaGeneratorImpl.Predicates criteria,
String propertyName,
String propertyValue,
boolean caseInsensitive) |
protected void |
addGreaterThanOrEqual(org.kuali.rice.krad.service.impl.LookupCriteriaGeneratorImpl.Predicates criteria,
String propertyName,
Object propertyValue) |
protected void |
addGreaterThanOrEqual(org.kuali.rice.krad.service.impl.LookupCriteriaGeneratorImpl.Predicates criteria,
String propertyName,
String propertyValue,
boolean caseInsensitive) |
protected void |
addInactivateableFromToActiveCriteria(Object example,
String activeSearchValue,
org.kuali.rice.krad.service.impl.LookupCriteriaGeneratorImpl.Predicates criteria,
Map<String,String> searchValues)
Translates criteria for active status to criteria on the active from and to fields
|
protected void |
addInactivateableFromToCurrentCriteria(Object example,
String currentSearchValue,
org.kuali.rice.krad.service.impl.LookupCriteriaGeneratorImpl.Predicates criteria,
Map searchValues) |
protected void |
addIsNotNull(org.kuali.rice.krad.service.impl.LookupCriteriaGeneratorImpl.Predicates criteria,
String propertyName) |
protected void |
addIsNull(org.kuali.rice.krad.service.impl.LookupCriteriaGeneratorImpl.Predicates criteria,
String propertyName) |
protected void |
addLessThan(org.kuali.rice.krad.service.impl.LookupCriteriaGeneratorImpl.Predicates criteria,
String propertyName,
Object propertyValue) |
protected void |
addLessThan(org.kuali.rice.krad.service.impl.LookupCriteriaGeneratorImpl.Predicates criteria,
String propertyName,
String propertyValue,
boolean caseInsensitive) |
protected void |
addLessThanOrEqual(org.kuali.rice.krad.service.impl.LookupCriteriaGeneratorImpl.Predicates criteria,
String propertyName,
Object propertyValue) |
protected void |
addLessThanOrEqual(org.kuali.rice.krad.service.impl.LookupCriteriaGeneratorImpl.Predicates criteria,
String propertyName,
String propertyValue,
boolean caseInsensitive) |
protected void |
addLike(org.kuali.rice.krad.service.impl.LookupCriteriaGeneratorImpl.Predicates criteria,
String propertyName,
String propertyValue) |
protected void |
addLike(org.kuali.rice.krad.service.impl.LookupCriteriaGeneratorImpl.Predicates criteria,
String propertyName,
String propertyValue,
boolean caseInsensitive) |
protected void |
addLogicalOperatorCriteria(String propertyName,
String propertyValue,
Class<?> propertyType,
boolean caseInsensitive,
org.kuali.rice.krad.service.impl.LookupCriteriaGeneratorImpl.Predicates criteria,
String splitValue)
Builds a sub criteria object joined with an 'AND' or 'OR' (depending on splitValue) using the split values of propertyValue.
|
protected void |
addNotCriteria(String propertyName,
String propertyValue,
Class propertyType,
boolean caseInsensitive,
org.kuali.rice.krad.service.impl.LookupCriteriaGeneratorImpl.Predicates criteria) |
protected void |
addNotLike(org.kuali.rice.krad.service.impl.LookupCriteriaGeneratorImpl.Predicates criteria,
String propertyName,
String propertyValue) |
protected void |
addNotLike(org.kuali.rice.krad.service.impl.LookupCriteriaGeneratorImpl.Predicates criteria,
String propertyName,
String propertyValue,
boolean caseInsensitive) |
protected void |
addNumericRangeCriteria(String propertyName,
String propertyValue,
Class<?> propertyType,
boolean treatWildcardsAndOperatorsAsLiteral,
org.kuali.rice.krad.service.impl.LookupCriteriaGeneratorImpl.Predicates criteria)
Adds to the criteria object based on query characters given
|
protected void |
addOr(org.kuali.rice.krad.service.impl.LookupCriteriaGeneratorImpl.Predicates criteria,
org.kuali.rice.krad.service.impl.LookupCriteriaGeneratorImpl.Predicates criteria2) |
protected void |
addOrCriteria(String propertyName,
String propertyValue,
Class propertyType,
boolean caseInsensitive,
org.kuali.rice.krad.service.impl.LookupCriteriaGeneratorImpl.Predicates criteria) |
protected void |
addStringRangeCriteria(String propertyName,
String propertyValue,
boolean caseInsensitive,
org.kuali.rice.krad.service.impl.LookupCriteriaGeneratorImpl.Predicates criteria)
Adds to the criteria object based on query characters given
|
protected Number |
cleanNumeric(String value,
Class<?> propertyType) |
boolean |
createCriteria(Object example,
String searchValue,
String propertyName,
boolean caseInsensitive,
boolean treatWildcardsAndOperatorsAsLiteral,
org.kuali.rice.krad.service.impl.LookupCriteriaGeneratorImpl.Predicates criteria) |
protected boolean |
createCriteria(Object example,
String searchValue,
String propertyName,
boolean caseInsensitive,
boolean treatWildcardsAndOperatorsAsLiteral,
org.kuali.rice.krad.service.impl.LookupCriteriaGeneratorImpl.Predicates criteria,
Map<String,String> searchValues)
Deprecated.
|
protected boolean |
createCriteria(Object example,
String searchValue,
String propertyName,
org.kuali.rice.krad.service.impl.LookupCriteriaGeneratorImpl.Predicates criteria) |
QueryByCriteria.Builder |
createObjectCriteriaFromMap(Object example,
Map<String,String> formProps) |
protected boolean |
determineIfAttributeSearchShouldBeCaseInsensitive(Class<?> type,
String propertyName)
Returns whether we should perform comparisons in a case-insensitive manner for this attribute.
|
protected boolean |
doesLookupFieldTreatWildcardsAndOperatorsAsLiteral(Class<?> type,
String fieldName)
Deprecated.
|
QueryByCriteria.Builder |
generateCriteria(Class<?> type,
Map<String,String> formProps,
boolean usePrimaryKeysOnly)
Deprecated.
|
QueryByCriteria.Builder |
generateCriteria(Class<?> type,
Map<String,String> formProps,
List<String> wildcardAsLiteralPropertyNames,
boolean usePrimaryKeysOnly)
Generates QueryByCriteria for lookup search criteria obtained from the lookup form.
|
protected org.kuali.rice.krad.service.impl.LookupCriteriaGeneratorImpl.Predicates |
getCollectionCriteriaFromMap(Class<?> type,
Object example,
Map<String,String> formProps)
Deprecated.
please use
getCollectionCriteriaFromMap(Class, Object, java.util.Map, java.util.List) instead |
protected org.kuali.rice.krad.service.impl.LookupCriteriaGeneratorImpl.Predicates |
getCollectionCriteriaFromMap(Class<?> type,
Object example,
Map<String,String> formProps,
List<String> wildcardAsLiteralPropertyNames)
Adds a criteria Predicate for each property contained in the map.
|
protected org.kuali.rice.krad.service.impl.LookupCriteriaGeneratorImpl.Predicates |
getCollectionCriteriaFromMapUsingPrimaryKeysOnly(Class<?> type,
Object dataObject,
Map<String,String> formProps)
Deprecated.
|
protected org.kuali.rice.krad.service.impl.LookupCriteriaGeneratorImpl.Predicates |
getCollectionCriteriaFromMapUsingPrimaryKeysOnly(Class<?> type,
Object dataObject,
Map<String,String> formProps,
List<String> wildcardAsLiteralPropertyNames) |
DataDictionaryService |
getDataDictionaryService() |
DataObjectService |
getDataObjectService() |
DateTimeService |
getDateTimeService() |
DatabasePlatform |
getDbPlatform() |
protected Class<?> |
getPropertyType(Object example,
String propertyName) |
protected Object |
instantiateLookupDataObject(Class<?> type)
Instantiates a new instance of the data object for the given type.
|
protected boolean |
isWriteable(Object o,
String p)
Return whether or not an attribute is writeable.
|
protected List<String> |
listPrimaryKeyFieldNames(Class<?> type) |
protected Date |
parseDate(String dateString) |
protected Date |
parseDateUpperBound(String dateString) |
protected String |
parsePropertyName(org.kuali.rice.krad.service.impl.LookupCriteriaGeneratorImpl.Predicates criteria,
String fullyQualifiedPropertyName) |
void |
setDataDictionaryService(DataDictionaryService dataDictionaryService) |
void |
setDataObjectService(DataObjectService dataObjectService) |
void |
setDateTimeService(DateTimeService dateTimeService) |
void |
setDbPlatform(DatabasePlatform dbPlatform) |
protected String |
uppercasePropertyName(String propertyName)
Should return a string which is a server-side identifier for the uppercased property,
that is, this is not the uppercased version of the property name, but rather the property value uppercased
this is typically a builtin SQL function
|
public LookupCriteriaGeneratorImpl()
public DateTimeService getDateTimeService()
public void setDateTimeService(DateTimeService dateTimeService)
public DataDictionaryService getDataDictionaryService()
public void setDataDictionaryService(DataDictionaryService dataDictionaryService)
public DatabasePlatform getDbPlatform()
public void setDbPlatform(DatabasePlatform dbPlatform)
public DataObjectService getDataObjectService()
public void setDataObjectService(DataObjectService dataObjectService)
@Deprecated public QueryByCriteria.Builder generateCriteria(Class<?> type, Map<String,String> formProps, boolean usePrimaryKeysOnly)
LookupCriteriaGenerator
generateCriteria
in interface LookupCriteriaGenerator
public QueryByCriteria.Builder generateCriteria(Class<?> type, Map<String,String> formProps, List<String> wildcardAsLiteralPropertyNames, boolean usePrimaryKeysOnly)
LookupCriteriaGenerator
This implementation better isolates the UIFramework from the lookup service.
generateCriteria
in interface LookupCriteriaGenerator
type
- the class name of the object on which the lookup is performed.formProps
- a Map containing the form properties to be used as search criteria.wildcardAsLiteralPropertyNames
- list of properties that have wildcards disabled, any wildcard characters
are treated as literals.usePrimaryKeysOnly
- determines whether only primary keys are used in searchpublic QueryByCriteria.Builder createObjectCriteriaFromMap(Object example, Map<String,String> formProps)
createObjectCriteriaFromMap
in interface LookupCriteriaGenerator
protected Object instantiateLookupDataObject(Class<?> type)
type
- the type of the data object to pass, must not be nullprotected boolean createCriteria(Object example, String searchValue, String propertyName, org.kuali.rice.krad.service.impl.LookupCriteriaGeneratorImpl.Predicates criteria)
public boolean createCriteria(Object example, String searchValue, String propertyName, boolean caseInsensitive, boolean treatWildcardsAndOperatorsAsLiteral, org.kuali.rice.krad.service.impl.LookupCriteriaGeneratorImpl.Predicates criteria)
@Deprecated protected boolean createCriteria(Object example, String searchValue, String propertyName, boolean caseInsensitive, boolean treatWildcardsAndOperatorsAsLiteral, org.kuali.rice.krad.service.impl.LookupCriteriaGeneratorImpl.Predicates criteria, Map<String,String> searchValues)
@Deprecated protected org.kuali.rice.krad.service.impl.LookupCriteriaGeneratorImpl.Predicates getCollectionCriteriaFromMap(Class<?> type, Object example, Map<String,String> formProps)
getCollectionCriteriaFromMap(Class, Object, java.util.Map, java.util.List)
insteadtype
- class name of the Data Object being looked upexample
- sample object instance of the class typeformProps
- Map of search criteria propertiesprotected org.kuali.rice.krad.service.impl.LookupCriteriaGeneratorImpl.Predicates getCollectionCriteriaFromMap(Class<?> type, Object example, Map<String,String> formProps, List<String> wildcardAsLiteralPropertyNames)
Checks for case sensitivity for the search parameter, and whether or not wildcard characters are allowed. This implementation further separates the UIFramework from the LookupService and should be used in place of the deprecated method.
type
- class name of the Data Object being looked upexample
- sample object instance of the class typeformProps
- Map of search criteria propertieswildcardAsLiteralPropertyNames
- List of search criteria properties with wildcard characters disabled.protected boolean determineIfAttributeSearchShouldBeCaseInsensitive(Class<?> type, String propertyName)
type
- the type of the data objectpropertyName
- the business object propertyprotected boolean addCriteriaForPropertyValues(Object example, String propertyName, boolean caseInsensitive, boolean treatWildcardsAndOperatorsAsLiteral, org.kuali.rice.krad.service.impl.LookupCriteriaGeneratorImpl.Predicates criteria, Map formProps, String... searchValues)
example
- the example search objectpropertyName
- the object propertycaseInsensitive
- case sensitivity determinationtreatWildcardsAndOperatorsAsLiteral
- whether to treat wildcards and operators as literalcriteria
- the criteria we are modifyingformProps
- the search form propertiessearchValues
- the property search values@Deprecated protected org.kuali.rice.krad.service.impl.LookupCriteriaGeneratorImpl.Predicates getCollectionCriteriaFromMapUsingPrimaryKeysOnly(Class<?> type, Object dataObject, Map<String,String> formProps)
protected org.kuali.rice.krad.service.impl.LookupCriteriaGeneratorImpl.Predicates getCollectionCriteriaFromMapUsingPrimaryKeysOnly(Class<?> type, Object dataObject, Map<String,String> formProps, List<String> wildcardAsLiteralPropertyNames)
@Deprecated protected boolean doesLookupFieldTreatWildcardsAndOperatorsAsLiteral(Class<?> type, String fieldName)
protected Number cleanNumeric(String value, Class<?> propertyType)
NumberFormatException
- if value
is not a valid
representation of a Number
.protected void addOrCriteria(String propertyName, String propertyValue, Class propertyType, boolean caseInsensitive, org.kuali.rice.krad.service.impl.LookupCriteriaGeneratorImpl.Predicates criteria)
protected void addAndCriteria(String propertyName, String propertyValue, Class propertyType, boolean caseInsensitive, org.kuali.rice.krad.service.impl.LookupCriteriaGeneratorImpl.Predicates criteria)
protected void addCriteria(String propertyName, String propertyValue, Class<?> propertyType, boolean caseInsensitive, boolean treatWildcardsAndOperatorsAsLiteral, org.kuali.rice.krad.service.impl.LookupCriteriaGeneratorImpl.Predicates criteria)
protected void addNotCriteria(String propertyName, String propertyValue, Class propertyType, boolean caseInsensitive, org.kuali.rice.krad.service.impl.LookupCriteriaGeneratorImpl.Predicates criteria)
protected void addDateRangeCriteria(String propertyName, String propertyValue, boolean treatWildcardsAndOperatorsAsLiteral, org.kuali.rice.krad.service.impl.LookupCriteriaGeneratorImpl.Predicates criteria)
protected void addNumericRangeCriteria(String propertyName, String propertyValue, Class<?> propertyType, boolean treatWildcardsAndOperatorsAsLiteral, org.kuali.rice.krad.service.impl.LookupCriteriaGeneratorImpl.Predicates criteria)
protected void addStringRangeCriteria(String propertyName, String propertyValue, boolean caseInsensitive, org.kuali.rice.krad.service.impl.LookupCriteriaGeneratorImpl.Predicates criteria)
protected void addInactivateableFromToActiveCriteria(Object example, String activeSearchValue, org.kuali.rice.krad.service.impl.LookupCriteriaGeneratorImpl.Predicates criteria, Map<String,String> searchValues)
example
- - business object being queried onactiveSearchValue
- - value for the active search field, should convert to booleancriteria
- - Criteria object being builtsearchValues
- - Map containing all search keys and valuesprotected void addLogicalOperatorCriteria(String propertyName, String propertyValue, Class<?> propertyType, boolean caseInsensitive, org.kuali.rice.krad.service.impl.LookupCriteriaGeneratorImpl.Predicates criteria, String splitValue)
protected Date parseDate(String dateString) throws ParseException
ParseException
protected Date parseDateUpperBound(String dateString) throws ParseException
ParseException
protected List<String> listPrimaryKeyFieldNames(Class<?> type)
protected Class<?> getPropertyType(Object example, String propertyName)
protected boolean isWriteable(Object o, String p) throws IllegalArgumentException
o
- p
- IllegalArgumentException
protected void addEqualNumeric(org.kuali.rice.krad.service.impl.LookupCriteriaGeneratorImpl.Predicates criteria, String propertyName, Class<?> propertyClass, String searchValue)
protected void addEqualTemporal(org.kuali.rice.krad.service.impl.LookupCriteriaGeneratorImpl.Predicates criteria, String propertyName, String searchValue)
protected void addEqual(org.kuali.rice.krad.service.impl.LookupCriteriaGeneratorImpl.Predicates criteria, String propertyName, Object searchValue)
protected void addIsNull(org.kuali.rice.krad.service.impl.LookupCriteriaGeneratorImpl.Predicates criteria, String propertyName)
protected void addIsNotNull(org.kuali.rice.krad.service.impl.LookupCriteriaGeneratorImpl.Predicates criteria, String propertyName)
protected void addLike(org.kuali.rice.krad.service.impl.LookupCriteriaGeneratorImpl.Predicates criteria, String propertyName, String propertyValue)
protected void addNotLike(org.kuali.rice.krad.service.impl.LookupCriteriaGeneratorImpl.Predicates criteria, String propertyName, String propertyValue)
protected void addEqualToBoolean(org.kuali.rice.krad.service.impl.LookupCriteriaGeneratorImpl.Predicates criteria, String propertyName, String propertyValue)
protected String uppercasePropertyName(String propertyName)
propertyName
- the property/column nameprotected void addAnd(org.kuali.rice.krad.service.impl.LookupCriteriaGeneratorImpl.Predicates criteria, org.kuali.rice.krad.service.impl.LookupCriteriaGeneratorImpl.Predicates criteria2)
protected void addLessThan(org.kuali.rice.krad.service.impl.LookupCriteriaGeneratorImpl.Predicates criteria, String propertyName, Object propertyValue)
protected void addLessThanOrEqual(org.kuali.rice.krad.service.impl.LookupCriteriaGeneratorImpl.Predicates criteria, String propertyName, Object propertyValue)
protected void addGreaterThan(org.kuali.rice.krad.service.impl.LookupCriteriaGeneratorImpl.Predicates criteria, String propertyName, Object propertyValue)
protected void addGreaterThanOrEqual(org.kuali.rice.krad.service.impl.LookupCriteriaGeneratorImpl.Predicates criteria, String propertyName, Object propertyValue)
protected void addBetween(org.kuali.rice.krad.service.impl.LookupCriteriaGeneratorImpl.Predicates criteria, String propertyName, Object value1, Object value2)
protected void addOr(org.kuali.rice.krad.service.impl.LookupCriteriaGeneratorImpl.Predicates criteria, org.kuali.rice.krad.service.impl.LookupCriteriaGeneratorImpl.Predicates criteria2)
protected void addEqual(org.kuali.rice.krad.service.impl.LookupCriteriaGeneratorImpl.Predicates criteria, String propertyName, String searchValue, boolean caseInsensitive)
protected void addGreaterThan(org.kuali.rice.krad.service.impl.LookupCriteriaGeneratorImpl.Predicates criteria, String propertyName, String propertyValue, boolean caseInsensitive)
protected void addGreaterThanOrEqual(org.kuali.rice.krad.service.impl.LookupCriteriaGeneratorImpl.Predicates criteria, String propertyName, String propertyValue, boolean caseInsensitive)
protected void addLessThan(org.kuali.rice.krad.service.impl.LookupCriteriaGeneratorImpl.Predicates criteria, String propertyName, String propertyValue, boolean caseInsensitive)
protected void addLessThanOrEqual(org.kuali.rice.krad.service.impl.LookupCriteriaGeneratorImpl.Predicates criteria, String propertyName, String propertyValue, boolean caseInsensitive)
protected void addLike(org.kuali.rice.krad.service.impl.LookupCriteriaGeneratorImpl.Predicates criteria, String propertyName, String propertyValue, boolean caseInsensitive)
protected void addBetween(org.kuali.rice.krad.service.impl.LookupCriteriaGeneratorImpl.Predicates criteria, String propertyName, String value1, String value2, boolean caseInsensitive)
protected void addNotLike(org.kuali.rice.krad.service.impl.LookupCriteriaGeneratorImpl.Predicates criteria, String propertyName, String propertyValue, boolean caseInsensitive)
protected String parsePropertyName(org.kuali.rice.krad.service.impl.LookupCriteriaGeneratorImpl.Predicates criteria, String fullyQualifiedPropertyName)
protected void addInactivateableFromToCurrentCriteria(Object example, String currentSearchValue, org.kuali.rice.krad.service.impl.LookupCriteriaGeneratorImpl.Predicates criteria, Map searchValues)
Copyright © 2005–2016 The Kuali Foundation. All rights reserved.