protected static class Query.JoinHelper extends Object
LEFT JOIN
for association expressions.
For example:
QueryResults in:q = Contact.all().filter("self.title.code = ?1 OR self.age > ?2", "mr", 20);
SELECT self FROM Contact self LEFT JOIN self.title _title WHERE _title.code = ?1 OR self.age > ?2So that all the records are matched even if
title
field is null.Constructor and Description |
---|
JoinHelper(Class<?> beanClass) |
Modifier and Type | Method and Description |
---|---|
String |
fixSelect(String query) |
String |
joinName(String name) |
String |
parse(String filter,
boolean translate)
Parse the given filter string and return transformed filter expression.
|
String |
toString() |
String |
toString(boolean fetch) |
public JoinHelper(Class<?> beanClass)
public String parse(String filter, boolean translate)
Automatically calculate LEFT JOIN
for association path expressions and the
path expressions are replaced with the join variables.
filter
- the filter expressiontranslate
- whether to generate translation joinpublic String toString(boolean fetch)