CB - The type of condition-bean.RESULT - The type of result for scalar selectpublic class HpSLSFunction<CB extends ConditionBean,RESULT> extends Object
| 修飾子とタイプ | フィールドと説明 |
|---|---|
protected CB |
_conditionBean
The condition-bean for scalar select.
|
protected HpSLSExecutor<CB,RESULT> |
_executor
The executor of scalar select.
|
protected Class<RESULT> |
_resultType
The condition-bean for scalar select.
|
| コンストラクタと説明 |
|---|
HpSLSFunction(CB conditionBean,
Class<RESULT> resultType,
HpSLSExecutor<CB,RESULT> executor) |
protected final CB extends ConditionBean _conditionBean
protected final Class<RESULT> _resultType
protected final HpSLSExecutor<CB extends ConditionBean,RESULT> _executor
public HpSLSFunction(CB conditionBean, Class<RESULT> resultType, HpSLSExecutor<CB,RESULT> executor)
conditionBean - The condition-bean initialized only for scalar select. (NotNull)resultType - The type as result. (NotNull)executor - The executor of scalar select with select clause type. (NotNull)public RESULT count(ScalarQuery<CB> cbLambda)
memberBhv.scalarSelect(Integer.class).count(cb -> { cb.specify().columnMemberId(); // the required specification of (basically) primary key column cb.query().setMemberStatusCode_Equal_Formalized(); // query as you like it });
cbLambda - The callback to select scalar value. (NotNull)public RESULT count(ScalarQuery<CB> cbLambda, FunctionFilterOptionCall<ScalarSelectOption> opLambda)
memberBhv.scalarSelect(Integer.class).count(cb -> { cb.specify().columnMemberId(); // the required specification of (basically) primary key column cb.query().setMemberStatusCode_Equal_Formalized(); // query as you like it }, op -> op.coalesce(0));
cbLambda - The callback to select scalar value. (NotNull)opLambda - The callback for option of scalar. (NotNull)protected RESULT doCount(ScalarQuery<CB> scalarQuery, ScalarSelectOption option)
public RESULT countDistinct(ScalarQuery<CB> cbLambda)
memberBhv.scalarSelect(Integer.class).countDistinct(cb -> { cb.specify().columnMemberId(); // the required specification of (basically) primary key column cb.query().setMemberStatusCode_Equal_Formalized(); // query as you like it });
cbLambda - The callback to select scalar value. (NotNull)public RESULT countDistinct(ScalarQuery<CB> cbLambda, FunctionFilterOptionCall<ScalarSelectOption> opLambda)
memberBhv.scalarSelect(Integer.class).countDistinct(cb -> { cb.specify().columnMemberId(); // the required specification of (basically) primary key column cb.query().setMemberStatusCode_Equal_Formalized(); // query as you like it }, op -> op.coalesce(0));
cbLambda - The callback to select scalar value. (NotNull)opLambda - The callback for option of scalar. (NotNull)protected RESULT doCountDistinct(ScalarQuery<CB> scalarQuery, ScalarSelectOption option)
public OptionalScalar<RESULT> max(ScalarQuery<CB> cbLambda)
memberBhv.scalarSelect(Date.class).max(cb -> { cb.specify().columnBirthdate(); // the required specification of target column cb.query().setMemberStatusCode_Equal_Formalized(); // query as you like it });
cbLambda - The callback to select scalar value. (NotNull)public OptionalScalar<RESULT> max(ScalarQuery<CB> cbLambda, FunctionFilterOptionCall<ScalarSelectOption> opLambda)
memberBhv.scalarSelect(Date.class).max(cb -> { cb.specify().columnBirthdate(); // the required specification of target column cb.query().setMemberStatusCode_Equal_Formalized(); // query as you like it }, op -> op.coalesce(0));
cbLambda - The callback to select scalar value. (NotNull)opLambda - The callback for option of scalar. (NotNull)protected OptionalScalar<RESULT> doMax(ScalarQuery<CB> scalarQuery, ScalarSelectOption option)
public OptionalScalar<RESULT> min(ScalarQuery<CB> cbLambda)
memberBhv.scalarSelect(Date.class).min(cb -> { cb.specify().columnBirthdate(); // the required specification of target column cb.query().setMemberStatusCode_Equal_Formalized(); // query as you like it });
cbLambda - The callback to select scalar value. (NotNull)public OptionalScalar<RESULT> min(ScalarQuery<CB> cbLambda, FunctionFilterOptionCall<ScalarSelectOption> opLambda)
memberBhv.scalarSelect(Date.class).min(cb -> { cb.specify().columnBirthdate(); // the required specification of target column cb.query().setMemberStatusCode_Equal_Formalized(); // query as you like it }, op -> op.coalesce(0));
cbLambda - The callback to select scalar value. (NotNull)opLambda - The callback for option of scalar. (NotNull)protected OptionalScalar<RESULT> doMin(ScalarQuery<CB> scalarQuery, ScalarSelectOption option)
public OptionalScalar<RESULT> sum(ScalarQuery<CB> cbLambda)
purchaseBhv.scalarSelect(Integer.class).sum(cb -> { cb.specify().columnPurchaseCount(); // the required specification of target column cb.query().setPurchaseDatetime_GreaterEqual(date); // query as you like it });
cbLambda - The callback to select scalar value. (NotNull)public OptionalScalar<RESULT> sum(ScalarQuery<CB> cbLambda, FunctionFilterOptionCall<ScalarSelectOption> opLambda)
purchaseBhv.scalarSelect(Integer.class).sum(cb -> { cb.specify().columnPurchaseCount(); // the required specification of target column cb.query().setPurchaseDatetime_GreaterEqual(date); // query as you like it }, op -> op.coalesce(0));
cbLambda - The callback to select scalar value. (NotNull)opLambda - The callback for option of scalar. (NotNull)protected OptionalScalar<RESULT> doSum(ScalarQuery<CB> scalarQuery, ScalarSelectOption option)
public OptionalScalar<RESULT> avg(ScalarQuery<CB> cbLambda)
purchaseBhv.scalarSelect(Integer.class).avg(cb -> { cb.specify().columnPurchaseCount(); // the required specification of target column cb.query().setPurchaseDatetime_GreaterEqual(date); // query as you like it });
cbLambda - The callback to select scalar value. (NotNull)public OptionalScalar<RESULT> avg(ScalarQuery<CB> cbLambda, FunctionFilterOptionCall<ScalarSelectOption> opLambda)
purchaseBhv.scalarSelect(Integer.class).avg(cb -> { cb.specify().columnPurchaseCount(); // the required specification of target column cb.query().setPurchaseDatetime_GreaterEqual(date); // query as you like it }, op -> op.coalesce(0));
cbLambda - The callback to select scalar value. (NotNull)opLambda - The callback for option of scalar. (NotNull)protected OptionalScalar<RESULT> doAvg(ScalarQuery<CB> scalarQuery, ScalarSelectOption option)
protected OptionalScalar<RESULT> optionalOf(String title, RESULT result)
protected void throwScalarSelectValueNotFoundException(String title)
protected RESULT exec(ScalarQuery<CB> scalarQuery, SelectClauseType selectClauseType, ScalarSelectOption option)
protected void setupTargetColumnInfo(ScalarSelectOption option)
protected void setupScalarSelectOption(ScalarSelectOption option)
protected void assertScalarSelectRequiredSpecifyColumn()
protected void throwScalarSelectInvalidColumnSpecificationException()
protected ScalarSelectOption createScalarSelectOption()
protected ScalarSelectOption newScalarSelectOption()
protected BehaviorExceptionThrower createBhvExThrower()
protected ConditionBeanExceptionThrower createCBExThrower()
protected void assertScalarQuery(ScalarQuery<?> scalarQuery)
protected void assertScalarSelectOption(ScalarSelectOption option)
protected void assertObjectNotNull(String variableName, Object value)
variableName - The variable name for message. (NotNull)value - The value the checked variable. (NotNull)IllegalArgumentException - When the variable name or the variable is null.Copyright © 2014–2015 The DBFlute Project. All rights reserved.