use of org.dbflute.exception.IllegalConditionBeanOperationException 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();
}
use of org.dbflute.exception.IllegalConditionBeanOperationException in project dbflute-core by dbflute.
the class AbstractConditionBean method acceptPrimaryKeyMap.
// ===================================================================================
// Accept PrimaryKey
// =================
/**
* {@inheritDoc}
*/
public void acceptPrimaryKeyMap(Map<String, ? extends Object> primaryKeyMap) {
if (!asDBMeta().hasPrimaryKey()) {
String msg = "The table has no primary-keys: " + asTableDbName();
throw new IllegalConditionBeanOperationException(msg);
}
final Entity entity = asDBMeta().newEntity();
asDBMeta().acceptPrimaryKeyMap(entity, primaryKeyMap);
final Map<String, Object> filteredMap = asDBMeta().extractPrimaryKeyMap(entity);
for (Entry<String, Object> entry : filteredMap.entrySet()) {
localCQ().invokeQuery(entry.getKey(), "equal", entry.getValue());
}
}
use of org.dbflute.exception.IllegalConditionBeanOperationException in project dbflute-core by dbflute.
the class AbstractConditionBean method inviteDerivedToDreamCruise.
/**
* {@inheritDoc}
*/
public SpecifiedColumn inviteDerivedToDreamCruise(String derivedAlias) {
if (!xisDreamCruiseShip()) {
String msg = "This invitation is only allowed by Dream Cruise Ship: " + derivedAlias;
throw new IllegalConditionBeanOperationException(msg);
}
final SqlClause portClause = xgetDreamCruiseDeparturePort().getSqlClause();
if (!portClause.hasSpecifiedDerivingSubQuery(derivedAlias)) {
String msg = "Not found the derived info by the argument 'derivedAlias': " + derivedAlias;
throw new IllegalArgumentException(msg);
}
final ColumnInfo columnInfo = portClause.getSpecifiedDerivingColumnInfo(derivedAlias);
if (columnInfo == null) {
String msg = "Not found the derived column by the argument 'derivedAlias': " + derivedAlias;
throw new IllegalArgumentException(msg);
}
return new SpecifiedColumn(null, columnInfo, this, derivedAlias, true);
}
use of org.dbflute.exception.IllegalConditionBeanOperationException in project dbflute-core by dbflute.
the class HpQDRParameter method throwFromToDateBothNullException.
protected void throwFromToDateBothNullException(FromToOption option) {
final ExceptionMessageBuilder br = new ExceptionMessageBuilder();
br.addNotice("The both arguments of from-to for (Query)DerivedReferrer were null.");
br.addItem("Advice");
br.addElement("Basically it cannot allow double null");
br.addElement("of the from-to method, even if allowOneSide().");
br.addItem("FromToOption");
br.addElement(option);
final String msg = br.buildExceptionMessage();
throw new IllegalConditionBeanOperationException(msg);
}
use of org.dbflute.exception.IllegalConditionBeanOperationException in project dbflute-core by dbflute.
the class HpQDRParameter method throwFromToFromDateOnlyNullNotAllowedException.
protected void throwFromToFromDateOnlyNullNotAllowedException(Date toDate, FromToOption option) {
final ExceptionMessageBuilder br = new ExceptionMessageBuilder();
br.addNotice("The from-date of from-to for (Query)DerivedReferrer were null.");
br.addItem("Advice");
br.addElement("Basically it cannot allow from-date to be null.");
br.addElement("If you need to specify null, use allowOneSide() option.");
br.addItem("toDate");
br.addElement(toDate);
br.addItem("FromToOption");
br.addElement(option);
final String msg = br.buildExceptionMessage();
throw new IllegalConditionBeanOperationException(msg);
}
Aggregations