use of org.dbflute.cbean.dream.SpecifiedColumn in project dbflute-core by dbflute.
the class HpDerivingSubQueryInfo method extractDerivingColumn.
// ===================================================================================
// Meta Provider
// =============
public SpecifiedColumn extractDerivingColumn() {
final SqlClause subQuerySqlClause = _derivedReferrer.getSubQuerySqlClause();
final SpecifiedColumn specifiedColumn = subQuerySqlClause.getSpecifiedColumnAsOne();
if (specifiedColumn != null) {
return specifiedColumn;
}
// nested
return subQuerySqlClause.getSpecifiedDerivingColumnAsOne();
}
use of org.dbflute.cbean.dream.SpecifiedColumn in project dbflute-core by dbflute.
the class FunctionFilterOption method buildDreamCruiseTicketStatement.
protected String buildDreamCruiseTicketStatement(Object value) {
final String bindPath;
final SpecifiedColumn specifiedColumn = ((SpecifiedColumn) value);
final String columnExp;
if (_removeCalcAlias) {
// e.g. VaryingUpdate
columnExp = specifiedColumn.toColumnSqlName().toString();
} else {
// normally here
columnExp = specifiedColumn.toColumnRealName().toString();
}
if (specifiedColumn.hasSpecifyCalculation()) {
specifiedColumn.xinitSpecifyCalculation();
final HpCalcSpecification<ConditionBean> calcSpecification = specifiedColumn.getSpecifyCalculation();
if (_removeCalcAlias) {
// e.g. VaryingUpdate
bindPath = calcSpecification.buildStatementToSpecifidNameRemovedCalcAlias(columnExp);
} else {
// normally here
bindPath = calcSpecification.buildStatementToSpecifidName(columnExp);
}
} else {
bindPath = columnExp;
}
return bindPath;
}
use of org.dbflute.cbean.dream.SpecifiedColumn in project dbflute-core by dbflute.
the class ConditionKey method resolveCompoundColumn.
protected ColumnRealName resolveCompoundColumn(ColumnRealName baseRealName, ConditionOption option) {
if (option == null || !option.hasCompoundColumn()) {
return baseRealName;
}
if (!option.hasStringConnector()) {
// basically no way
String msg = "The option should have string connector when compound column is specified: " + option;
throw new IllegalConditionBeanOperationException(msg);
}
final List<SpecifiedColumn> compoundColumnList = option.getCompoundColumnList();
final List<ColumnRealName> realNameList = new ArrayList<ColumnRealName>();
// already cipher
realNameList.add(doResolveCompoundColumnOption(option, baseRealName));
for (SpecifiedColumn specifiedColumn : compoundColumnList) {
realNameList.add(doResolveCompoundColumnOption(option, doResolveCompoundColumnCipher(option, specifiedColumn)));
}
final OnQueryStringConnector stringConnector = option.getStringConnector();
final String connected = stringConnector.connect(realNameList.toArray());
return ColumnRealName.create(null, new ColumnSqlName(connected));
}
use of org.dbflute.cbean.dream.SpecifiedColumn in project dbflute-core by dbflute.
the class QueryDerivedReferrer method buildRightClauseDreamCruiseExp.
protected void buildRightClauseDreamCruiseExp(StringBuilder sb) {
final SpecifiedColumn specifiedColumn = (SpecifiedColumn) _value;
final String columnExp = specifiedColumn.toColumnRealName().toString();
final String appended;
if (specifiedColumn.hasSpecifyCalculation()) {
specifiedColumn.xinitSpecifyCalculation();
final HpCalcSpecification<ConditionBean> calcSpecification = specifiedColumn.getSpecifyCalculation();
appended = calcSpecification.buildStatementToSpecifidName(columnExp);
} else {
appended = columnExp;
}
sb.append(appended);
}
use of org.dbflute.cbean.dream.SpecifiedColumn in project dbflute-core by dbflute.
the class AbstractConditionQuery method xcreateManualOrderSpecifiedColumn.
protected SpecifiedColumn xcreateManualOrderSpecifiedColumn(ConditionBean dreamCruiseCB) {
final OrderByElement orderByLastElement = xgetSqlClause().getOrderByLastElement();
final String aliasName = orderByLastElement.getAliasName();
final String columnName = orderByLastElement.getColumnName();
final ColumnInfo columnInfo = orderByLastElement.getColumnInfo();
final boolean derived = orderByLastElement.isDerivedOrderBy();
return new SpecifiedColumn(aliasName, columnInfo, dreamCruiseCB, columnName, derived);
}
Aggregations