T
- public class Query<T> extends Object implements Serializable
The attributes of the object and related object become Query attributes; which can then be used for querying their respective entities.
Queryable
,
Serialized FormConstructor and Description |
---|
Query() |
Query(String json) |
Query(String json,
Class<T> entityClass) |
Query(String json,
Class<T> entityClass,
Map<String,?> paramsTypeMap) |
Query(String json,
String entityClassName,
Map<String,?> paramsTypeMap) |
Query(T entity)
The Query represents the entity
|
Query(T entity,
PageInfo pageInfo) |
Modifier and Type | Method and Description |
---|---|
void |
appendWhereExtension(String whereExtension)
{
setWhereExtension(String)
Additionally ; if a whereExtension exists already, this will Append it via an AND |
T |
getEntity() |
Set<String> |
getExcludedFields()
Set of names of fields whose values will not be included in ResultSet. |
String |
getFromExtension()
Special Strings; if Not null is Appended after the last default entity in FROM clause
|
List<String> |
getIncludedFields()
List of field Names that will only be included in the Result Set.
Note: included and excluded fields are mutually exclusive (Optional) |
Set<String> |
getNullSet()
Set of names of fields which if null will still be compared against |
String |
getOrderString()
ORDER BY clause without the words 'ORDER BY '
|
PageInfo |
getPageInfo() |
Map<String,Object> |
getParams()
Using Where extension we can put parameters that can be set as objects instead of hard coded strings.
|
Object |
getRelatedAttribute(String attributeName)
Deprecated.
|
Map<String,Object> |
getRelatedAttributes()
Deprecated.
|
String |
getSelectOverride()
If we are using Joins via
whereExtension ;
and say we want the Select to get only data from the Join. |
String |
getWhereExtension()
Special Strings; if Not null is Appended after WHERE or last Query statement.
Example(s): "OR ent.fieldName = :fieldValue" "ent.fieldName = :fieldValue" Note: if no conjunction is provided, AND is assumed by default and if there is no Conditions already then its prepended by WHERE in the final SQL |
boolean |
isIgnoreEntityFieldsInWhere()
If true will Not add the Query entity fields to the WHERE clause
|
void |
setEntity(T entity) |
void |
setExcludedFields(Set<String> excludedFields)
Set of names of fields whose values will not be included in ResultSet. |
void |
setFromExtension(String fromExtension)
Special Strings; if Not null is Appended after the last default entity in FROM clause
|
void |
setIgnoreEntityFieldsInWhere(boolean ignoreEntityFields)
If true will Not add the Query entity fields to the WHERE clause
|
void |
setIncludedFields(List<String> includedFields)
List of field Names that will only be included in the Result Set.
Note: included and excluded fields are mutually exclusive (Optional) |
void |
setNullSet(Set<String> nullSet)
Set of names of fields which if null will still be compared against |
void |
setOrderString(String orderString)
ORDER BY clause without the words 'ORDER BY '
|
void |
setPageInfo(PageInfo pageInfo) |
void |
setParam(String name,
Object value)
Using Where extension we can put parameters that can be set as objects instead of hard coded strings.
|
void |
setParams(Map<String,Object> params)
Using Where extension we can put parameters that can be set as objects instead of hard coded strings.
|
Query<T> |
setRelatedAttribute(String attributeName,
Object value)
Deprecated.
|
void |
setRelatedAttributes(Map<String,Object> relatedAttributes)
Deprecated.
|
void |
setSelectOverride(String selectOverride)
If we are using Joins via
whereExtension ;
and say we want the Select to get only data from the Join. |
void |
setWhereExtension(String whereExtension)
Special Strings; if Not null is Appended after WHERE or last Query statement.
Example(s): "OR ent.fieldName = :fieldValue" "ent.fieldName = :fieldValue" Note: if no conjunction is provided, AND is assumed by default and if there is no Conditions already then its prepended by WHERE in the final SQL |
String |
toString() |
public Query()
public Query(String json)
public Query(T entity)
entity
- public T getEntity()
public void setEntity(T entity)
public PageInfo getPageInfo()
public void setPageInfo(PageInfo pageInfo)
public String getOrderString()
public void setOrderString(String orderString)
@Deprecated public Map<String,Object> getRelatedAttributes()
@Deprecated public void setRelatedAttributes(Map<String,Object> relatedAttributes)
public Set<String> getExcludedFields()
Set
of names of fields whose values will not be included in ResultSet. They will be set to null.Column
annotation, if provided.
public void setExcludedFields(Set<String> excludedFields)
Set
of names of fields whose values will not be included in ResultSet. They will be set to null.Column
annotation, if provided.
public List<String> getIncludedFields()
public void setIncludedFields(List<String> includedFields)
public Set<String> getNullSet()
Set
of names of fields which if null will still be compared againstpublic void setNullSet(Set<String> nullSet)
Set
of names of fields which if null will still be compared against@Deprecated public Object getRelatedAttribute(String attributeName)
@Deprecated public Query<T> setRelatedAttribute(String attributeName, Object value)
public String getWhereExtension()
public void setWhereExtension(String whereExtension)
public void appendWhereExtension(String whereExtension)
setWhereExtension(String)
whereExtension
exists already, this will Append it via an ANDpublic String getFromExtension()
public void setFromExtension(String fromExtension)
public Map<String,Object> getParams()
public void setParams(Map<String,Object> params)
public void setParam(String name, Object value)
public boolean isIgnoreEntityFieldsInWhere()
public void setIgnoreEntityFieldsInWhere(boolean ignoreEntityFields)
public String getSelectOverride()
whereExtension
;
and say we want the Select to get only data from the Join.
public void setSelectOverride(String selectOverride)
whereExtension
;
and say we want the Select to get only data from the Join.
Copyright © 2018. All rights reserved.