public class AnyToAnyRestriction extends Object implements Restriction
Modifier and Type | Field and Description |
---|---|
private String |
alias |
private boolean |
hasLink |
private EntityQuery |
linkedQuery |
private Restriction |
linkedRestriction |
private Item |
linkedTo |
private String |
linkName |
private String |
parameterName |
Modifier | Constructor and Description |
---|---|
private |
AnyToAnyRestriction(String alias,
String linkName,
Item linkedTo,
boolean hasLink,
EntityQuery linkedQuery) |
Modifier and Type | Method and Description |
---|---|
boolean |
equals(Object other)
This expression is equal to another AnyToAnyRestriction if their
named link, 'hasLink' and subquery restriction are the same.
|
static AnyToAnyRestriction |
exists(String alias,
String linkName,
Item linkedTo,
EntityQuery linkedQuery)
Create a restriction that restrict a query to return
items that has a linked item with the given link name.
|
Collection<? extends QueryElement> |
getChildren()
Get the children of this query element or null if it has no children.
|
int |
hashCode() |
static AnyToAnyRestriction |
missing(String alias,
String linkName,
Item linkedTo,
EntityQuery linkedQuery)
Create a restriction that restrict a query to return
items that is missing a linked item with the given link
name.
|
String |
toQl(Query query,
DbControl dc)
Create a query language string of the query element.
|
String |
toString() |
private final String alias
private final String linkName
private final Item linkedTo
private final boolean hasLink
private final EntityQuery linkedQuery
private final Restriction linkedRestriction
private String parameterName
private AnyToAnyRestriction(String alias, String linkName, Item linkedTo, boolean hasLink, EntityQuery linkedQuery)
public static AnyToAnyRestriction exists(String alias, String linkName, Item linkedTo, EntityQuery linkedQuery)
alias
- Alias to resolve the link against, use
null to resolve the link agains the root entitylinkName
- The name of the link (required)linkedTo
- The type of the linked item (optional)linkedQuery
- An optional query that the linked items must matchpublic static AnyToAnyRestriction missing(String alias, String linkName, Item linkedTo, EntityQuery linkedQuery)
alias
- Alias to resolve the link against, use
null to resolve the link agains the root entitylinkName
- The name of the link (required)linkedTo
- The type of the linked item (optional)linkedQuery
- An optional query that the linked items must not matchpublic String toQl(Query query, DbControl dc)
QueryElement
Query.getQueryType()
method to find out which query language is wanted
in case the element requires different syntax for different languages.toQl
in interface QueryElement
query
- The query that is about to be executeddc
- The DbControl
object used to execute the querypublic Collection<? extends QueryElement> getChildren()
QueryElement
AddExpression
has two children, the expression
beeing added.getChildren
in interface QueryElement
public boolean equals(Object other)