Package com.axelor.db
Class Query.JoinHelper
java.lang.Object
com.axelor.db.Query.JoinHelper
JoinHelper class is used to auto generate
LEFT JOIN
for 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 > ?2So that all the records are matched even if
title
field is null.-
Constructor Summary
Constructors -
Method Summary
-
Constructor Details
-
JoinHelper
-
-
Method Details
-
parse
Parse the given filter string and return transformed filter expression.Automatically calculate
LEFT JOIN
for 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
-
joinName
-
fixSelect
-
toString
-
toString
-