public class ManualOrderOption extends Object implements ColumnCalculator
MemberCB cb = new MemberCB(); ManualOrderOption mob = new ManualOrderOption(); mob.when_GreaterEqual(priorityDate); // e.g. 2000/01/01 cb.query().addOrderBy_Birthdate_Asc().withManualOrder(mob); // order by // case // when BIRTHDATE >= '2000/01/01' then 0 // else 1 // end asc, ... MemberCB cb = new MemberCB(); ManualOrderOption mob = new ManualOrderOption(); mob.when_Equal(CDef.MemberStatus.Withdrawal); mob.when_Equal(CDef.MemberStatus.Formalized); mob.when_Equal(CDef.MemberStatus.Provisional); cb.query().addOrderBy_MemberStatusCode_Asc().withManualOrder(mob); // order by // case // when MEMBER_STATUS_CODE = 'WDL' then 0 // when MEMBER_STATUS_CODE = 'FML' then 1 // when MEMBER_STATUS_CODE = 'PRV' then 2 // else 3 // end asc, ...
This function with Union is unsupported!
The order values are bound (treated as bind parameter).
| 修飾子とタイプ | フィールドと説明 |
|---|---|
protected HpCalcSpecification<ConditionBean> |
_calcSpecification |
protected List<HpMobCaseWhenElement> |
_caseWhenAcceptedList |
protected List<HpMobCaseWhenElement> |
_caseWhenBoundList |
protected HpMobConnectionMode |
_connectionMode |
protected Object |
_elseAcceptedValue |
protected Object |
_elseBoundValue |
protected boolean |
_suppressElseBinding |
protected boolean |
_suppressThenBinding |
static String |
THEME_KEY |
| コンストラクタと説明 |
|---|
ManualOrderOption() |
protected final List<HpMobCaseWhenElement> _caseWhenAcceptedList
protected final List<HpMobCaseWhenElement> _caseWhenBoundList
protected HpCalcSpecification<ConditionBean> _calcSpecification
protected HpMobConnectionMode _connectionMode
protected Object _elseAcceptedValue
protected Object _elseBoundValue
protected boolean _suppressThenBinding
protected boolean _suppressElseBinding
public HpMobConnectedBean when_Equal(Object orderValue)
orderValue - The value for ordering. (NullAllowed: if null, means invalid condition)public HpMobConnectedBean when_NotEqual(Object orderValue)
orderValue - The value for ordering. (NullAllowed: if null, means invalid condition)public HpMobConnectedBean when_GreaterThan(Object orderValue)
orderValue - The value for ordering. (NullAllowed: if null, means invalid condition)public HpMobConnectedBean when_LessThan(Object orderValue)
orderValue - The value for ordering. (NullAllowed: if null, means invalid condition)public HpMobConnectedBean when_GreaterEqual(Object orderValue)
orderValue - The value for ordering. (NullAllowed: if null, means invalid condition)public HpMobConnectedBean when_LessEqual(Object orderValue)
orderValue - The value for ordering. (NullAllowed: if null, means invalid condition)public HpMobConnectedBean when_IsNull()
public HpMobConnectedBean when_IsNotNull()
public HpMobConnectedBean when_FromTo(LocalDate fromDate, LocalDate toDate, ConditionOptionCall<FromToOption> opLambda)
FromToOption class for the details.fromDate - The local date as from-date. (basically NotNull: null allowed if one-side allowed)toDate - The local date as to-date. (basically NotNull: null allowed if one-side allowed)opLambda - The callback for option of from-to. (NotNull)public HpMobConnectedBean when_FromTo(LocalDateTime fromDate, LocalDateTime toDate, ConditionOptionCall<FromToOption> opLambda)
FromToOption class for the details.fromDate - The local date-time as from-date. (basically NotNull: null allowed if one-side allowed)toDate - The local date-time as to-date. (basically NotNull: null allowed if one-side allowed)opLambda - The callback for option of from-to. (NotNull)public HpMobConnectedBean when_FromTo(Date fromDate, Date toDate, ConditionOptionCall<FromToOption> opLambda)
FromToOption class for the details.fromDate - The date as from-date. (basically NotNull: null allowed if one-side allowed)toDate - The date as to-date. (basically NotNull: null allowed if one-side allowed)opLambda - The callback for option of from-to. (NotNull)protected FromToOption createFromToOption(ConditionOptionCall<FromToOption> opLambda)
protected void assertFromToOptionCall(ConditionOptionCall<FromToOption> opLambda)
protected FromToOption newFromToOption()
protected HpMobConnectedBean doWhen_FromTo(Date fromDate, Date toDate, FromToOption option)
protected void assertFromToOption(FromToOption option)
protected void assertFromToDateBothExistsOrOneSideAllowed(Date fromDate, Date toDate, FromToOption option)
public void acceptOrderValueList(List<? extends Object> orderValueList)
List<CDef.MemberStatus> orderValueList = new ArrayList<CDef.MemberStatus>(); orderValueList.add(CDef.MemberStatus.Withdrawal); orderValueList.add(CDef.MemberStatus.Formalized); orderValueList.add(CDef.MemberStatus.Provisional); cb.query().addOrderBy_MemberStatusCode_Asc().withManualOrder(op -> { op.acceptOrderValueList(orderValueList); }); // order by // case // when MEMBER_STATUS_CODE = 'WDL' then 0 // when MEMBER_STATUS_CODE = 'FML' then 1 // when MEMBER_STATUS_CODE = 'PRV' then 2 // else 3 // end asc, ...
orderValueList - The list of order value. (NotNull)protected HpMobConnectedBean doWhen(ConditionKey conditionKey, Object orderValue)
protected boolean isManualOrderConditionKeyNullHandling(ConditionKey conditionKey)
protected HpMobCaseWhenElement getAcceptedLastElement()
protected HpMobConnectedBean createConnectedBean()
protected void throwManualOrderPreviousConditionNotFoundException(HpMobConnectionMode mode, ConditionKey conditionKey, Object orderValue)
protected void throwManualOrderTwoConnectorUnsupportedException(ConditionKey conditionKey, Object orderValue, HpMobCaseWhenElement lastElement)
public void xregisterThenValueToLastElement(Object thenValue)
protected void throwManualOrderThenValueCaseWhenElementNotFoundException(Object thenValue)
public void elseEnd(Object elseValue)
elseValue - The value for 'else', String, Integer, Date, DreamCruiseTicket... (NotNull)protected void throwManualOrderElseValueCaseWhenElementNotFoundException(Object elseValue)
public ColumnCalculator plus(Number plusValue)
plus インタフェース内 ColumnCalculatorplusValue - The number value for plus. (NotNull)public ColumnCalculator plus(SpecifiedColumn plusColumn)
e.g. ManualOrder: order by PURCHASE_PRICE + PURCHASE_COUNT cb.query().addOrderBy_PurchasePrice_Asc().withManualOrder(op -> { op.plus(cb.dreamCruiseCB().specify().columnPurchaseCount()); }); e.g. ColumnQuery: ... > PURCHASE_PRICE + PURCHASE_COUNT cb.columnQuery(colCB -> { cb.column...(); }).greaterThan(colCB -> { cb.columnPurchasePrice(); }).plus(cb.dreamCruiseCB().specify().columnPurchaseCount());
plus インタフェース内 ColumnCalculatorplusColumn - The plus column specified by your Dream Cruise. (NotNull)public ColumnCalculator minus(Number minusValue)
minus インタフェース内 ColumnCalculatorminusValue - The number value for minus. (NotNull)public ColumnCalculator minus(SpecifiedColumn minusColumn)
e.g. ManualOrder: order by PURCHASE_PRICE - PURCHASE_COUNT cb.query().addOrderBy_PurchasePrice_Asc().withManualOrder(op -> { op.minus(cb.dreamCruiseCB().specify().columnPurchaseCount()); }); e.g. ColumnQuery: ... > PURCHASE_PRICE - PURCHASE_COUNT cb.columnQuery(colCB -> { cb.column...(); }).greaterThan(colCB -> { cb.columnPurchasePrice(); }).minus(cb.dreamCruiseCB().specify().columnPurchaseCount());
minus インタフェース内 ColumnCalculatorminusColumn - The minus column specified by your Dream Cruise. (NotNull)public ColumnCalculator multiply(Number multiplyValue)
multiply インタフェース内 ColumnCalculatormultiplyValue - The number value for multiply. (NotNull)public ColumnCalculator multiply(SpecifiedColumn multiplyColumn)
e.g. ManualOrder: order by PURCHASE_PRICE * PURCHASE_COUNT cb.query().addOrderBy_PurchasePrice_Asc().withManualOrder(op -> { op.multiply(cb.dreamCruiseCB().specify().columnPurchaseCount()); }); e.g. ColumnQuery: ... > PURCHASE_PRICE * PURCHASE_COUNT cb.columnQuery(colCB -> { cb.column...(); }).greaterThan(colCB -> { cb.columnPurchasePrice(); }).multiply(cb.dreamCruiseCB().specify().columnPurchaseCount());
multiply インタフェース内 ColumnCalculatormultiplyColumn - The multiply column specified by your Dream Cruise. (NotNull)public ColumnCalculator divide(Number divideValue)
divide インタフェース内 ColumnCalculatordivideValue - The number value for divide. (NotNull)public ColumnCalculator divide(SpecifiedColumn divideColumn)
e.g. ManualOrder: order by PURCHASE_PRICE / PURCHASE_COUNT cb.query().addOrderBy_PurchasePrice_Asc().withManualOrder(op -> { op.divide(cb.dreamCruiseCB().specify().columnPurchaseCount()); }); e.g. ColumnQuery: ... > PURCHASE_PRICE / PURCHASE_COUNT cb.columnQuery(colCB -> { cb.column...(); }).greaterThan(colCB -> { cb.columnPurchasePrice(); }).divide(cb.dreamCruiseCB().specify().columnPurchaseCount());
divide インタフェース内 ColumnCalculatordivideColumn - The divide column specified by your Dream Cruise. (NotNull)public ColumnCalculator convert(FunctionFilterOptionCall<ColumnConversionOption> opLambda)
...).convert(op -> op.addDay(8).truncTime());
convert インタフェース内 ColumnCalculatoropLambda - The callback for conversion option of column. (NotNull)public ColumnCalculator left()
left インタフェース内 ColumnCalculatorpublic ColumnCalculator right()
right インタフェース内 ColumnCalculatorprotected void initializeCalcSpecificationIfNeeds()
protected HpCalcSpecification<ConditionBean> createEmptyCalcSpecification()
protected SpecifyQuery<ConditionBean> createEmptySpecifyQuery()
protected HpCalcSpecification<ConditionBean> newCalcSpecification(SpecifyQuery<ConditionBean> emptySpecifyQuery)
public boolean hasOrderByCalculation()
public HpCalcSpecification<ConditionBean> getOrderByCalculation()
public void xinitOrderByCalculation(ConditionBean baseCB, ConditionBean dreamCruiseCB)
public void toBeConnectionModeAsAnd()
public void toBeConnectionModeAsOr()
public void clearConnectionMode()
protected HpMobCaseWhenElement createElement(ConditionKey conditionKey, Object orderValue)
public void bind(HpManualOrderThemeListHandler handler)
handler - The handler for free parameters. (NotNull)protected HpMobCaseWhenElement doBindCaseWhen(HpManualOrderThemeListHandler handler, HpMobCaseWhenElement element)
protected void doBindElseEnd(HpManualOrderThemeListHandler handler)
protected Object resolveBoundValue(HpManualOrderThemeListHandler handler, Object plainValue, boolean suppressBinding)
protected Object handleClassificationOrderValue(Classification cls)
protected boolean canBeLiteralClassificationCodeType(ClassificationCodeType codeType)
protected boolean isAnyLocalDate(Object plainValue)
protected void throwUnsupportedTypeSpecifiedException(String notice, Object plainValue)
public ManualOrderOption suppressThenBinding()
public ManualOrderOption suppressElseBinding()
public void validate()
protected void doValidateCaseWhenConstraint()
protected void throwManualOrderRequiredThenNotFoundException(HpMobCaseWhenElement current)
protected void throwManualOrderUnnecessaryThenFoundException(HpMobCaseWhenElement current)
protected void throwManualOrderRequiredElseNotFoundException()
protected void throwManualOrderUnnecessaryElseNotFoundException()
public boolean hasManualOrder()
protected void assertCalculationColumnNumber(SpecifiedColumn specifiedColumn)
protected void assertSpecifiedDreamCruiseTicket(SpecifiedColumn column)
protected TimeZone getFromToConversionTimeZone()
protected TimeZone getDBFluteSystemFinalTimeZone()
public List<HpMobCaseWhenElement> getCaseWhenAcceptedList()
public List<HpMobCaseWhenElement> getCaseWhenBoundList()
public Object getElseValue()
Copyright © 2014–2015 The DBFlute Project. All rights reserved.