public class SearchJPAQueryBuilderTransformer extends Object implements org.apache.commons.collections.Transformer, Serializable
transform(Object) is an Object array of query, params which is a Map of name to value.
It accepts a map of FacetMeta or Identifiable or Strings to query input value for the field (FacetMeta).
A FacetMeta or Identifiable or String, where multiple DB fields map to the same input, can be comma separated in the FacetMeta.getName() or meta name| Modifier and Type | Field and Description |
|---|---|
static String |
AND_CLAUSE
If the input Map has a meta Name with this constant, it will append it with the Join Clause
This key maps to the ADN clause raw JPA String |
static String |
AND_CLAUSE_PARAMS
|
| Constructor and Description |
|---|
SearchJPAQueryBuilderTransformer(String entityNameAliasMapping) |
SearchJPAQueryBuilderTransformer(String entityNameAliasMapping,
String defaultEntityAlias) |
| Modifier and Type | Method and Description |
|---|---|
String |
getDefaultEntityAlias()
If the field names in FacetMeta dont contain any alias; the
defaultEntityAlias will be prefixed. |
String |
getEntityNameAliasMapping()
Example "Product e" and all the
FacetMeta.getName()s would use the field name directly or can use p.fieldName
If defining a single entity and an alias, check defaultEntityAlias. |
String |
getJoinClauses()
Example: e1.name = e2.name OR e1.id = e2.id
|
void |
setDefaultEntityAlias(String defaultEntityAlias)
If the field names in FacetMeta dont contain any alias; the
defaultEntityAlias will be prefixed. |
void |
setEntityNameAliasMapping(String entityNameAliasMapping)
Example "Product e" and all the
FacetMeta.getName()s would use the field name directly or can use p.fieldName
If defining a single entity and an alias, check defaultEntityAlias. |
void |
setJoinClauses(String joinClauses)
Example: e1.name = e2.name OR e1.id = e2.id
|
Object |
transform(Object input) |
public static final String AND_CLAUSE
public static final String AND_CLAUSE_PARAMS
public SearchJPAQueryBuilderTransformer(String entityNameAliasMapping)
public Object transform(Object input)
transform in interface org.apache.commons.collections.Transformerpublic String getEntityNameAliasMapping()
FacetMeta.getName()s would use the field name directly or can use p.fieldName
If defining a single entity and an alias, check defaultEntityAlias.public void setEntityNameAliasMapping(String entityNameAliasMapping)
FacetMeta.getName()s would use the field name directly or can use p.fieldName
If defining a single entity and an alias, check defaultEntityAlias.public String getDefaultEntityAlias()
defaultEntityAlias will be prefixed.public void setDefaultEntityAlias(String defaultEntityAlias)
defaultEntityAlias will be prefixed.public String getJoinClauses()
public void setJoinClauses(String joinClauses)
Copyright © 2018. All rights reserved.