Package rife.database.queries
Class QueryHelper
java.lang.Object
rife.database.queries.QueryHelper
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiongetBeanPropertyNames(Class beanClass, String[] excludedFields) getBeanPropertyTypes(Class beanClass, String[] includedFields, String[] excludedFields) getBeanPropertyValues(Object bean, String[] includedFields, String[] excludedFields, Datasource datasource) static StringgetColumnName(Constrained constrained, String propertyName) Retrieves the database column name that a bean property maps to.
-
Constructor Details
-
QueryHelper
public QueryHelper()
-
-
Method Details
-
getColumnName
Retrieves the database column name that a bean property maps to.This method will return the explicit column name when the property has been constrained with one, otherwise the column name is simply the property name. This makes it possible to use column names that can't be expressed as bean property names.
- Parameters:
constrained- the constrained bean to look the property up in; ornullwhen the bean isn't constrainedpropertyName- the name of the bean property- Returns:
- the column name to use for the property
- Since:
- 1.10
-
getBeanPropertyNames
public static Set<String> getBeanPropertyNames(Class beanClass, String[] excludedFields) throws DbQueryException - Throws:
DbQueryException
-
getBeanPropertyValues
public static Map<String,String> getBeanPropertyValues(Object bean, String[] includedFields, String[] excludedFields, Datasource datasource) throws DbQueryException - Throws:
DbQueryException
-
getBeanPropertyTypes
public static Map<String,Class> getBeanPropertyTypes(Class beanClass, String[] includedFields, String[] excludedFields) throws DbQueryException - Throws:
DbQueryException
-