use of org.dbflute.cbean.chelper.HpCBPurpose in project dbflute-core by dbflute.
the class AbstractConditionBean method xhandleOrSQPurposeChange.
protected HpCBPurpose xhandleOrSQPurposeChange() {
// might be overridden before Java8
final HpCBPurpose originalPurpose = getPurpose();
xsetupForOrScopeQuery();
return originalPurpose;
}
use of org.dbflute.cbean.chelper.HpCBPurpose in project dbflute-core by dbflute.
the class AbstractConditionBean method xdoOrSQ.
protected <CB extends ConditionBean> void xdoOrSQ(CB cb, OrQuery<CB> orQuery) {
getSqlClause().beginOrScopeQuery();
final HpCBPurpose originalPurpose = xhandleOrSQPurposeChange();
try {
// cannot lock base condition-bean for now
// because it uses same instance in or-scope query
orQuery.query(cb);
} finally {
xhandleOrSQPurposeClose(originalPurpose);
getSqlClause().endOrScopeQuery();
}
}
use of org.dbflute.cbean.chelper.HpCBPurpose in project dbflute-core by dbflute.
the class AbstractConditionBean method useInScopeSubQuery.
// [DBFlute-1.1.0]
// ===================================================================================
// ExistsReferrer Way
// ==================
/**
* Use in-scope sub-query for exists-referrer, basically for performance tuning. <br>
* The exists-referrer uses plain sub-query way instead of correlation way. <br>
* <pre>
* cb.query().existsPurchase(purchaseCB -> {
* purchaseCB.<span style="color: #CC4747">useInScopeSubQuery()</span>;
* purchaseCB.query().set...
* purchaseCB.query().set...
* });
* </pre>
*/
public void useInScopeSubQuery() {
assertOptionThatBadTiming("useInScopeSubQuery()");
final HpCBPurpose purpose = getPurpose();
if (!purpose.isAny(HpCBPurpose.EXISTS_REFERRER, HpCBPurpose.MYSELF_EXISTS)) {
String msg = "The method 'useInScopeSubQuery()' can be called only when ExistsReferrer.";
throw new IllegalConditionBeanOperationException(msg);
}
getSqlClause().useInScopeSubQueryForExistsReferrer();
}
Aggregations