Package com.axelor.db
Class Query.JoinHelper
- java.lang.Object
-
- com.axelor.db.Query.JoinHelper
-
protected static class Query.JoinHelper extends Object
JoinHelper class is used to auto generateLEFT JOINfor association expressions.For example:
Query<Contact> q = Contact.all().filter("self.title.code = ?1 OR self.age > ?2", "mr", 20);Results in:SELECT self FROM Contact self LEFT JOIN self.title _title WHERE _title.code = ?1 OR self.age > ?2
So that all the records are matched even iftitlefield is null.
-
-
Constructor Summary
Constructors Constructor Description JoinHelper(Class<?> beanClass)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description StringfixSelect(String query)StringjoinName(String name)Stringparse(String filter, boolean translate)Parse the given filter string and return transformed filter expression.StringtoString()StringtoString(boolean fetch)
-
-
-
Constructor Detail
-
JoinHelper
public JoinHelper(Class<?> beanClass)
-
-
Method Detail
-
parse
public String parse(String filter, boolean translate)
Parse the given filter string and return transformed filter expression.Automatically calculate
LEFT JOINfor association path expressions and the path expressions are replaced with the join variables.- Parameters:
filter- the filter expressiontranslate- whether to generate translation join- Returns:
- the transformed filter expression
-
toString
public String toString(boolean fetch)
-
-