${database.allClassCopyright}package ${glPackageBaseCQ};
#set ($myClassName = "${myAbstractBaseConditionQueryClassName}")
import java.util.Collection;
import org.seasar.dbflute.cbean.*;
import org.seasar.dbflute.cbean.chelper.*;
import org.seasar.dbflute.cbean.ckey.*;
import org.seasar.dbflute.cbean.coption.*;
import org.seasar.dbflute.cbean.cvalue.ConditionValue;
import org.seasar.dbflute.cbean.sqlclause.SqlClause;
import org.seasar.dbflute.dbmeta.DBMetaProvider;
import ${glPackageBaseCommon}.*;
import ${glPackageCB}.*;
import ${glPackageCQ}.*;
/**
* The abstract condition-query of ${table.name}.
* @author ${database.classAuthor}
*/
public abstract class ${myClassName} extends AbstractConditionQuery {
// ===================================================================================
// Attribute
// =========
protected final DBMetaProvider _dbmetaProvider = new ${glDBMetaInstanceHandler}();
// ===================================================================================
// Constructor
// ===========
public ${myClassName}(ConditionQuery childQuery, SqlClause sqlClause, String aliasName, int nestLevel) {
super(childQuery, sqlClause, aliasName, nestLevel);
}
// ===================================================================================
// DBMeta Provider
// ===============
@Override
protected DBMetaProvider getDBMetaProvider() {
return _dbmetaProvider;
}
// ===================================================================================
// Table Name
// ==========
public String getTableDbName() {
return "${table.name}";
}
// ===================================================================================
// Query
// =====
#foreach ($col in $table.columns)
#set ($tmpJavaName = "${col.javaName}")
#set ($tmpUncapitalisedJavaName = "${col.uncapitalisedJavaName}")
#if (${col.isJavaNativeStringObject()})
/**
* Equal(=). And NullOrEmptyIgnored, OnlyOnceRegistered. {${col.columnDefinitionLineDisp}}
* @param ${tmpUncapitalisedJavaName} The value of ${col.uncapitalisedJavaName} as equal.
*/
public void set${tmpJavaName}_Equal(${col.javaNative} ${tmpUncapitalisedJavaName}) {
doSet${tmpJavaName}_Equal(fRES(${tmpUncapitalisedJavaName}));
}
#if (${col.isAvailableStringEmptyString()})
/**
* Equal(=). As the empty-string. And OnlyOnceRegistered.
*/
public void set${tmpJavaName}_Equal_EmptyString() {
doSet${tmpJavaName}_Equal("");
}
#end
#if (${col.hasClassification()})
#foreach ($classificationMap in $col.classificationMapList)
/**
* Equal(=). As ${classificationMap.get('name')}. And OnlyOnceRegistered.
* $database.buildClassificationApplicationComment($classificationMap)
*/
public void set${tmpJavaName}_Equal_${classificationMap.get('name')}() {
doSet${tmpJavaName}_Equal(${glCDef}.${col.classificationName}.${classificationMap.get('name')}.code());
}
#end
#end
protected void doSet${tmpJavaName}_Equal(${col.javaNative} ${tmpUncapitalisedJavaName}) {
#if ($database.isShortCharHandlingValid() && $col.isJdbcTypeChar())
reg${tmpJavaName}(CK_EQ, hSC("${col.name}", ${tmpUncapitalisedJavaName}, ${col.columnSizeSettingExpression}, "${database.shortCharHandlingModeCode}"));
#else
reg${tmpJavaName}(CK_EQ, ${tmpUncapitalisedJavaName});
#end
}
#if (${col.isAvailableStringNotEqual()})
/**
* NotEqual(!=). And NullOrEmptyIgnored, OnlyOnceRegistered.
* @param ${tmpUncapitalisedJavaName} The value of ${col.uncapitalisedJavaName} as notEqual.
*/
public void set${tmpJavaName}_NotEqual(${col.javaNative} ${tmpUncapitalisedJavaName}) {
doSet${tmpJavaName}_NotEqual(fRES(${tmpUncapitalisedJavaName}));
}
#if (${col.isAvailableStringEmptyString()})
/**
* Equal(!=). As the empty-string. And OnlyOnceRegistered.
*/
public void set${tmpJavaName}_NotEqual_EmptyString() {
doSet${tmpJavaName}_NotEqual("");
}
#end
#if (${col.hasClassification()})
#foreach ($classificationMap in $col.ClassificationMapList)
/**
* NotEqual(=). As ${classificationMap.get('name')}. And OnlyOnceRegistered.
* $database.buildClassificationApplicationComment($classificationMap)
*/
public void set${tmpJavaName}_NotEqual_${classificationMap.get('name')}() {
doSet${tmpJavaName}_NotEqual(${glCDef}.${col.classificationName}.${classificationMap.get('name')}.code());
}
#end
#end
protected void doSet${tmpJavaName}_NotEqual(${col.javaNative} ${tmpUncapitalisedJavaName}) {
#if ($database.isShortCharHandlingValid() && $col.isJdbcTypeChar())
reg${tmpJavaName}(CK_NE, hSC("${col.name}", ${tmpUncapitalisedJavaName}, ${col.columnSizeSettingExpression}, "${database.shortCharHandlingModeCode}"));
#else
reg${tmpJavaName}(CK_NE, ${tmpUncapitalisedJavaName});
#end
}
#end
#if (${col.isAvailableStringGreaterThan()})
/**
* GreaterThan(>). And NullOrEmptyIgnored, OnlyOnceRegistered.
* @param ${tmpUncapitalisedJavaName} The value of ${col.uncapitalisedJavaName} as greaterThan.
*/
public void set${tmpJavaName}_GreaterThan(${col.javaNative} ${tmpUncapitalisedJavaName}) {
reg${tmpJavaName}(CK_GT, fRES(${tmpUncapitalisedJavaName}));
}
#end
#if (${col.isAvailableStringLessThan()})
/**
* LessThan(<). And NullOrEmptyIgnored, OnlyOnceRegistered.
* @param ${tmpUncapitalisedJavaName} The value of ${col.uncapitalisedJavaName} as lessThan.
*/
public void set${tmpJavaName}_LessThan($col.javaNative ${tmpUncapitalisedJavaName}) {
reg${tmpJavaName}(CK_LT, fRES(${tmpUncapitalisedJavaName}));
}
#end
#if (${col.isAvailableStringGreaterEqual()})
/**
* GreaterEqual(>=). And NullOrEmptyIgnored, OnlyOnceRegistered.
* @param ${tmpUncapitalisedJavaName} The value of ${col.uncapitalisedJavaName} as greaterEqual.
*/
public void set${tmpJavaName}_GreaterEqual(${col.javaNative} ${tmpUncapitalisedJavaName}) {
reg${tmpJavaName}(CK_GE, fRES(${tmpUncapitalisedJavaName}));
}
#end
#if (${col.isAvailableStringLessEqual()})
/**
* LessEqual(<=). And NullOrEmptyIgnored, OnlyOnceRegistered.
* @param ${tmpUncapitalisedJavaName} The value of ${col.uncapitalisedJavaName} as lessEqual.
*/
public void set${tmpJavaName}_LessEqual(${col.javaNative} ${tmpUncapitalisedJavaName}) {
reg${tmpJavaName}(CK_LE, fRES(${tmpUncapitalisedJavaName}));
}
#end
#if (${col.isAvailableStringPrefixSearch()})
/**
* PrefixSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, SeveralRegistered.
* @param ${tmpUncapitalisedJavaName} The value of ${col.uncapitalisedJavaName} as prefixSearch.
*/
public void set${tmpJavaName}_PrefixSearch(${col.javaNative} ${tmpUncapitalisedJavaName}) {
set${tmpJavaName}_LikeSearch(${tmpUncapitalisedJavaName}, cLSOP());
}
#end
#if (${col.isAvailableStringInScope()})
/**
* InScope(in ('a', 'b')). And NullOrEmptyIgnored, NullOrEmptyElementIgnored, SeveralRegistered.
* @param ${tmpUncapitalisedJavaName}List The collection of ${col.uncapitalisedJavaName} as inScope.
*/
public void set${tmpJavaName}_InScope(Collection<${col.javaNative}> ${tmpUncapitalisedJavaName}List) {
regINS(CK_INS, cTL(${tmpUncapitalisedJavaName}List), getCValue${tmpJavaName}(), "${col.name}");
}
#end
#if (${col.isAvailableStringNotInScope()})
/**
* NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, NullOrEmptyElementIgnored, SeveralRegistered.
* @param ${tmpUncapitalisedJavaName}List The collection of ${col.uncapitalisedJavaName} as notInScope.
*/
public void set${tmpJavaName}_NotInScope(Collection<${col.javaNative}> ${tmpUncapitalisedJavaName}List) {
regINS(CK_NINS, cTL(${tmpUncapitalisedJavaName}List), getCValue${tmpJavaName}(), "${col.name}");
}
#end
#if (${col.isAvailableStringLikeSearch()})
/**
* LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, SeveralRegistered.
* @param ${tmpUncapitalisedJavaName} The value of ${col.uncapitalisedJavaName} as likeSearch.
* @param likeSearchOption The option of like-search. (NotNull)
*/
public void set${tmpJavaName}_LikeSearch(${col.javaNative} ${tmpUncapitalisedJavaName}, LikeSearchOption likeSearchOption) {
regLSQ(CK_LS, fRES(${tmpUncapitalisedJavaName}), getCValue${tmpJavaName}(), "${col.name}", likeSearchOption);
}
#end
#if (${col.isAvailableStringNotLikeSearch()})
/**
* NotLikeSearch(not like 'xxx%' escape ...). And NullOrEmptyIgnored, SeveralRegistered.
* @param ${tmpUncapitalisedJavaName} The value of ${col.uncapitalisedJavaName} as notLikeSearch.
* @param likeSearchOption The option of not-like-search. (NotNull)
*/
public void set${tmpJavaName}_NotLikeSearch(${col.javaNative} ${tmpUncapitalisedJavaName}, LikeSearchOption likeSearchOption) {
regLSQ(CK_NLS, fRES(${tmpUncapitalisedJavaName}), getCValue${tmpJavaName}(), "${col.name}", likeSearchOption);
}
#end
#if (${col.isSingleKeyForeignKey()} && !${col.foreignKey.hasFixedCondition()})
#set ($relatedCBClassName = "${col.foreignKey.foreignTableExtendedConditionBeanClassName}")
#set ($relatedCQClassName = "${col.foreignKey.foreignTableExtendedConditionQueryClassName}")
#set ($subQueryPropertyNameInitCap = "${tmpJavaName}_InScopeSubQuery_${col.foreignKey.foreignPropertyNameInitCap}")
#set ($subQueryPropertyName = "${tmpUncapitalisedJavaName}_InScopeSubQuery_${col.foreignKey.foreignPropertyNameInitCap}")
public void inScope${col.foreignKey.foreignPropertyNameInitCap}(SubQuery<${relatedCBClassName}> subQuery) {
assertObjectNotNull("subQuery<${relatedCBClassName}>", subQuery);
${relatedCBClassName} cb = new ${relatedCBClassName}(); cb.xsetupForInScopeSubQuery(); subQuery.query(cb);
String subQueryPropertyName = keep${subQueryPropertyNameInitCap}(cb.query()); // for saving query-value.
registerInScopeSubQuery(cb.query(), "${col.name}", "${col.foreignKey.firstForeignColumnName}", subQueryPropertyName);
}
public abstract String keep${subQueryPropertyNameInitCap}(${relatedCQClassName} subQuery);
#end
#if (${col.hasSingleKeyReferrer()})
#foreach ($referrer in $col.singleKeyReferrers)
#set ($relatedCBClassName = "${referrer.referrerTableExtendedConditionBeanClassName}")
#set ($relatedCQClassName = "${referrer.referrerTableExtendedConditionQueryClassName}")
#if (${referrer.isOneToOne()})
#set ($relationPropertyNameInitCap = "${referrer.referrerPropertyNameInitCapAsOne}")
#set ($subQueryPropertyNameInitCap = "${tmpJavaName}_InScopeSubQuery_${referrer.referrerPropertyNameInitCapAsOne}")
#set ($subQueryPropertyName = "${tmpUncapitalisedJavaName}_InScopeSubQuery_${referrer.ReferrerPropertyNameInitCapAsOne}")
#else
#set ($relationPropertyNameInitCap = "${referrer.referrerPropertyNameInitCap}")
#set ($subQueryPropertyNameInitCap = "${tmpJavaName}_InScopeSubQuery_${referrer.referrerPropertyNameInitCap}")
#set ($subQueryPropertyName = "${tmpUncapitalisedJavaName}_InScopeSubQuery_${referrer.ReferrerPropertyNameInitCap}")
#end
public void inScope${relationPropertyNameInitCap}(SubQuery<${relatedCBClassName}> subQuery) {
assertObjectNotNull("subQuery<${relatedCBClassName}>", subQuery);
${relatedCBClassName} cb = new ${relatedCBClassName}(); cb.xsetupForInScopeSubQuery(); subQuery.query(cb);
String subQueryPropertyName = keep${subQueryPropertyNameInitCap}(cb.query()); // for saving query-value.
registerInScopeSubQuery(cb.query(), "${col.name}", "${referrer.firstLocalColumnName}", subQueryPropertyName);
}
public abstract String keep${subQueryPropertyNameInitCap}(${relatedCQClassName} subQuery);
#end
#end
#if (${col.hasSingleKeyReferrer()})
#foreach ($referrer in $col.singleKeyReferrers)
#set ($relatedCBClassName = "${referrer.referrerTableExtendedConditionBeanClassName}")
#set ($relatedCQClassName = "${referrer.referrerTableExtendedConditionQueryClassName}")
#if (${referrer.isOneToOne()})
#set ($relationPropertyNameInitCap = "${referrer.referrerPropertyNameInitCapAsOne}")
#set ($subQueryPropertyNameInitCap = "${tmpJavaName}_NotInScopeSubQuery_${referrer.referrerPropertyNameInitCapAsOne}")
#set ($subQueryPropertyName = "${tmpUncapitalisedJavaName}_NotInScopeSubQuery_${referrer.ReferrerPropertyNameInitCapAsOne}")
#else
#set ($relationPropertyNameInitCap = "${referrer.referrerPropertyNameInitCap}")
#set ($subQueryPropertyNameInitCap = "${tmpJavaName}_NotInScopeSubQuery_${referrer.referrerPropertyNameInitCap}")
#set ($subQueryPropertyName = "${tmpUncapitalisedJavaName}_NotInScopeSubQuery_${referrer.ReferrerPropertyNameInitCap}")
#end
public void notInScope${relationPropertyNameInitCap}(SubQuery<${relatedCBClassName}> subQuery) {
assertObjectNotNull("subQuery<${relatedCBClassName}>", subQuery);
${relatedCBClassName} cb = new ${relatedCBClassName}(); cb.xsetupForInScopeSubQuery(); subQuery.query(cb);
String subQueryPropertyName = keep${subQueryPropertyNameInitCap}(cb.query()); // for saving query-value.
registerNotInScopeSubQuery(cb.query(), "${col.name}", "${referrer.firstLocalColumnName}", subQueryPropertyName);
}
public abstract String keep${subQueryPropertyNameInitCap}(${relatedCQClassName} subQuery);
#end
#end
#if (${col.hasSingleKeyReferrer()})
#foreach ($referrer in $col.singleKeyReferrers)
#set ($relatedCBClassName = "${referrer.referrerTableExtendedConditionBeanClassName}")
#set ($relatedCQClassName = "${referrer.referrerTableExtendedConditionQueryClassName}")
#if (${referrer.isOneToOne()})
#set ($relationPropertyNameInitCap = "${referrer.referrerPropertyNameInitCapAsOne}")
#set ($subQueryPropertyNameInitCap = "${tmpJavaName}_ExistsSubQuery_${referrer.referrerPropertyNameInitCapAsOne}")
#set ($subQueryPropertyName = "${tmpUncapitalisedJavaName}_ExistsSubQuery_${referrer.referrerPropertyNameInitCapAsOne}")
#else
#set ($relationPropertyNameInitCap = "${referrer.referrerPropertyNameInitCap}")
#set ($subQueryPropertyNameInitCap = "${tmpJavaName}_ExistsSubQuery_${referrer.referrerPropertyNameInitCap}")
#set ($subQueryPropertyName = "${tmpUncapitalisedJavaName}_ExistsSubQuery_${referrer.referrerPropertyNameInitCap}")
#end
/**
* Set up 'exists' sub-query. {exists (select ${referrer.firstLocalColumnName} from ${referrer.table.name} where ...)}
* @param subQuery The sub-query of ${subQueryPropertyNameInitCap} for 'exists'. (NotNull)
*/
public void exists${relationPropertyNameInitCap}(SubQuery<${relatedCBClassName}> subQuery) {
assertObjectNotNull("subQuery<${relatedCBClassName}>", subQuery);
${relatedCBClassName} cb = new ${relatedCBClassName}(); cb.xsetupForExistsSubQuery(); subQuery.query(cb);
String subQueryPropertyName = keep${subQueryPropertyNameInitCap}(cb.query()); // for saving query-value.
registerExistsSubQuery(cb.query(), "${col.name}", "${referrer.firstLocalColumnName}", subQueryPropertyName);
}
public abstract String keep${subQueryPropertyNameInitCap}(${relatedCQClassName} subQuery);
#end
#end
#if (${col.hasSingleKeyReferrer()})
#foreach ($referrer in $col.singleKeyReferrers)
#set ($relatedCBClassName = "${referrer.referrerTableExtendedConditionBeanClassName}")
#set ($relatedCQClassName = "${referrer.referrerTableExtendedConditionQueryClassName}")
#if (${referrer.isOneToOne()})
#set ($relationPropertyNameInitCap = "${referrer.referrerPropertyNameInitCapAsOne}")
#set ($subQueryPropertyNameInitCap = "${tmpJavaName}_NotExistsSubQuery_${referrer.referrerPropertyNameInitCapAsOne}")
#set ($subQueryPropertyName = "${tmpUncapitalisedJavaName}_NotExistsSubQuery_${referrer.referrerPropertyNameInitCapAsOne}")
#else
#set ($relationPropertyNameInitCap = "${referrer.referrerPropertyNameInitCap}")
#set ($subQueryPropertyNameInitCap = "${tmpJavaName}_NotExistsSubQuery_${referrer.referrerPropertyNameInitCap}")
#set ($subQueryPropertyName = "${tmpUncapitalisedJavaName}_NotExistsSubQuery_${referrer.referrerPropertyNameInitCap}")
#end
/**
* Set up 'not exists' sub-query. {not exists (select ${referrer.firstLocalColumnName} from ${referrer.table.name} where ...)}
* @param subQuery The sub-query of ${subQueryPropertyNameInitCap} for 'not exists'. (NotNull)
*/
public void notExists${relationPropertyNameInitCap}(SubQuery<${relatedCBClassName}> subQuery) {
assertObjectNotNull("subQuery<${relatedCBClassName}>", subQuery);
${relatedCBClassName} cb = new ${relatedCBClassName}(); cb.xsetupForExistsSubQuery(); subQuery.query(cb);
String subQueryPropertyName = keep${subQueryPropertyNameInitCap}(cb.query()); // for saving query-value.
registerNotExistsSubQuery(cb.query(), "${col.name}", "${referrer.FirstLocalColumnName}", subQueryPropertyName);
}
public abstract String keep${subQueryPropertyNameInitCap}(${relatedCQClassName} subQuery);
#end
#end
#if (${col.hasSingleKeyReferrer()})
#foreach ($referrer in $col.singleKeyReferrers)
#if (!${referrer.isOneToOne()})
#set ($relatedCBClassName = "${referrer.referrerTableExtendedConditionBeanClassName}")
#set ($relatedCQClassName = "${referrer.referrerTableExtendedConditionQueryClassName}")
#set ($subQueryPropertyNameInitCap = "${tmpJavaName}_SpecifyDerivedReferrer_${referrer.referrerPropertyNameInitCap}")
#set ($subQueryPropertyName = "${tmpUncapitalisedJavaName}_SpecifyDerivedReferrer_${referrer.referrerPropertyNameInitCap}")
public void xsderive${referrer.referrerPropertyNameInitCap}(String function, SubQuery<${relatedCBClassName}> subQuery, String aliasName) {
assertObjectNotNull("subQuery<${relatedCBClassName}>", subQuery);
${relatedCBClassName} cb = new ${relatedCBClassName}(); cb.xsetupForDerivedReferrer(); subQuery.query(cb);
String subQueryPropertyName = keep${subQueryPropertyNameInitCap}(cb.query()); // for saving query-value.
registerSpecifyDerivedReferrer(function, cb.query(), "${col.name}", "${referrer.firstLocalColumnName}", subQueryPropertyName, aliasName);
}
public abstract String keep${subQueryPropertyNameInitCap}(${relatedCQClassName} subQuery);
#end
#end
#end
#if (${col.hasSingleKeyReferrer()})
#foreach ($referrer in $col.singleKeyReferrers)
#if (!${referrer.isOneToOne()})
#set ($relatedCBClassName = "${referrer.referrerTableExtendedConditionBeanClassName}")
#set ($relatedCQClassName = "${referrer.referrerTableExtendedConditionQueryClassName}")
#set ($subQueryPropertyNameInitCap = "${tmpJavaName}_QueryDerivedReferrer_${referrer.referrerPropertyNameInitCap}")
#set ($subQueryPropertyName = "${tmpUncapitalisedJavaName}_QueryDerivedReferrer_${referrer.referrerPropertyNameInitCap}")
public HpQDRFunction<${relatedCBClassName}> derived${referrer.referrerPropertyNameInitCap}() {
return xcreateQDRFunction${referrer.referrerPropertyNameInitCap}();
}
protected HpQDRFunction<${relatedCBClassName}> xcreateQDRFunction${referrer.referrerPropertyNameInitCap}() {
return new HpQDRFunction<${relatedCBClassName}>(new HpQDRSetupper<${relatedCBClassName}>() {
public void setup(String function, SubQuery<${relatedCBClassName}> subQuery, String operand, Object value) {
xqderive${referrer.referrerPropertyNameInitCap}(function, subQuery, operand, value);
}
});
}
public void xqderive${referrer.referrerPropertyNameInitCap}(String function, SubQuery<${relatedCBClassName}> subQuery, String operand, Object value) {
assertObjectNotNull("subQuery<${relatedCBClassName}>", subQuery);
${relatedCBClassName} cb = new ${relatedCBClassName}(); cb.xsetupForDerivedReferrer(); subQuery.query(cb);
String subQueryPropertyName = keep${subQueryPropertyNameInitCap}(cb.query()); // for saving query-value.
String parameterPropertyName = keep${subQueryPropertyNameInitCap}Parameter(value);
registerQueryDerivedReferrer(function, cb.query(), "${col.name}", "${referrer.firstLocalColumnName}", subQueryPropertyName, operand, value, parameterPropertyName);
}
public abstract String keep${subQueryPropertyNameInitCap}(${relatedCQClassName} subQuery);
public abstract String keep${subQueryPropertyNameInitCap}Parameter(Object parameterValue);
#end
#end
#end
#end
#if (${col.isJavaNativeNumberObject()})
/**
* Equal(=). And NullIgnored, OnlyOnceRegistered. {${col.columnDefinitionLineDisp}}
* @param ${tmpUncapitalisedJavaName} The value of ${col.uncapitalisedJavaName} as equal.
*/
public void set${tmpJavaName}_Equal(${col.javaNative} ${tmpUncapitalisedJavaName}) {
reg${tmpJavaName}(CK_EQ, ${tmpUncapitalisedJavaName});
}
#if (${col.hasClassification()})
#foreach ($classificationMap in $col.ClassificationMapList)
/**
* Equal(=). As ${classificationMap.get('name')}. And NullIgnored, OnlyOnceRegistered.
* $database.buildClassificationApplicationComment($classificationMap)
*/
public void set${tmpJavaName}_Equal_${classificationMap.get('name')}() {
reg${tmpJavaName}(CK_EQ, new ${col.javaNative}(${glCDef}.${col.classificationName}.${classificationMap.get('name')}.code()));
}
#end
#end
#if (${col.isAvailableNumberNotEqual()})
/**
* NotEqual(!=). And NullIgnored, OnlyOnceRegistered.
* @param ${tmpUncapitalisedJavaName} The value of ${col.uncapitalisedJavaName} as notEqual.
*/
public void set${tmpJavaName}_NotEqual(${col.javaNative} ${tmpUncapitalisedJavaName}) {
reg${tmpJavaName}(CK_NE, ${tmpUncapitalisedJavaName});
}
#if (${col.hasClassification()})
#foreach ($classificationMap in $col.ClassificationMapList)
/**
* NotEqual(!=). As ${classificationMap.get('name')}. And NullIgnored, OnlyOnceRegistered.
* $database.buildClassificationApplicationComment($classificationMap)
*/
public void set${tmpJavaName}_NotEqual_${classificationMap.get('name')}() {
reg${tmpJavaName}(CK_NE, new ${col.javaNative}(${glCDef}.${col.classificationName}.${classificationMap.get('name')}.code()));
}
#end
#end
#end
#if (${col.isAvailableNumberGreaterThan()})
/**
* GreaterThan(>). And NullIgnored, OnlyOnceRegistered.
* @param ${tmpUncapitalisedJavaName} The value of ${col.uncapitalisedJavaName} as greaterThan.
*/
public void set${tmpJavaName}_GreaterThan(${col.javaNative} ${tmpUncapitalisedJavaName}) {
reg${tmpJavaName}(CK_GT, ${tmpUncapitalisedJavaName});
}
#end
#if (${col.isAvailableNumberLessThan()})
/**
* LessThan(<). And NullIgnored, OnlyOnceRegistered.
* @param ${tmpUncapitalisedJavaName} The value of ${col.uncapitalisedJavaName} as lessThan.
*/
public void set${tmpJavaName}_LessThan(${col.javaNative} ${tmpUncapitalisedJavaName}) {
reg${tmpJavaName}(CK_LT, ${tmpUncapitalisedJavaName});
}
#end
#if (${col.isAvailableNumberGreaterEqual()})
/**
* GreaterEqual(>=). And NullIgnored, OnlyOnceRegistered.
* @param ${tmpUncapitalisedJavaName} The value of ${col.uncapitalisedJavaName} as greaterEqual.
*/
public void set${tmpJavaName}_GreaterEqual(${col.javaNative} ${tmpUncapitalisedJavaName}) {
reg${tmpJavaName}(CK_GE, ${tmpUncapitalisedJavaName});
}
#end
#if (${col.isAvailableNumberLessEqual()})
/**
* LessEqual(<=). And NullIgnored, OnlyOnceRegistered.
* @param ${tmpUncapitalisedJavaName} The value of ${col.uncapitalisedJavaName} as lessEqual.
*/
public void set${tmpJavaName}_LessEqual(${col.javaNative} ${tmpUncapitalisedJavaName}) {
reg${tmpJavaName}(CK_LE, ${tmpUncapitalisedJavaName});
}
#end
#if (${col.isAvailableNumberInScope()})
/**
* InScope(in (1, 2)). And NullIgnored, NullElementIgnored, SeveralRegistered.
* @param ${tmpUncapitalisedJavaName}List The collection of ${col.uncapitalisedJavaName} as inScope.
*/
public void set${tmpJavaName}_InScope(Collection<${col.javaNative}> ${tmpUncapitalisedJavaName}List) {
regINS(CK_INS, cTL(${tmpUncapitalisedJavaName}List), getCValue${tmpJavaName}(), "${col.name}");
}
#end
#if (${col.isAvailableNumberNotInScope()})
/**
* NotInScope(not in (1, 2)). And NullIgnored, NullElementIgnored, SeveralRegistered.
* @param ${tmpUncapitalisedJavaName}List The collection of ${col.uncapitalisedJavaName} as notInScope.
*/
public void set${tmpJavaName}_NotInScope(Collection<${col.javaNative}> ${tmpUncapitalisedJavaName}List) {
regINS(CK_NINS, cTL(${tmpUncapitalisedJavaName}List), getCValue${tmpJavaName}(), "${col.name}");
}
#end
#if (${col.isSingleKeyForeignKey()} && !${col.foreignKey.hasFixedCondition()})
#set ($relatedCBClassName = "${col.foreignKey.foreignTableExtendedConditionBeanClassName}")
#set ($relatedCQClassName = "${col.foreignKey.foreignTableExtendedConditionQueryClassName}")
#set ($subQueryPropertyNameInitCap = "${tmpJavaName}_InScopeSubQuery_${col.foreignKey.foreignPropertyNameInitCap}")
#set ($subQueryPropertyName = "${tmpUncapitalisedJavaName}_InScopeSubQuery_${col.foreignKey.foreignPropertyNameInitCap}")
public void inScope${col.foreignKey.foreignPropertyNameInitCap}(SubQuery<${relatedCBClassName}> subQuery) {
assertObjectNotNull("subQuery<${relatedCBClassName}>", subQuery);
${relatedCBClassName} cb = new ${relatedCBClassName}(); cb.xsetupForInScopeSubQuery(); subQuery.query(cb);
String subQueryPropertyName = keep${subQueryPropertyNameInitCap}(cb.query()); // for saving query-value.
registerInScopeSubQuery(cb.query(), "${col.name}", "${col.foreignKey.firstForeignColumnName}", subQueryPropertyName);
}
public abstract String keep${subQueryPropertyNameInitCap}(${relatedCQClassName} subQuery);
#end
#if (${col.hasSingleKeyReferrer()})
#foreach ($referrer in $col.singleKeyReferrers)
#set ($relatedCBClassName = "${referrer.referrerTableExtendedConditionBeanClassName}")
#set ($relatedCQClassName = "${referrer.referrerTableExtendedConditionQueryClassName}")
#if (${referrer.isOneToOne()})
#set ($relationPropertyNameInitCap = "${referrer.referrerPropertyNameInitCapAsOne}")
#set ($subQueryPropertyNameInitCap = "${tmpJavaName}_InScopeSubQuery_${referrer.referrerPropertyNameInitCapAsOne}")
#set ($subQueryPropertyName = "${tmpUncapitalisedJavaName}_InScopeSubQuery_${referrer.ReferrerPropertyNameInitCapAsOne}")
#else
#set ($relationPropertyNameInitCap = "${referrer.referrerPropertyNameInitCap}")
#set ($subQueryPropertyNameInitCap = "${tmpJavaName}_InScopeSubQuery_${referrer.referrerPropertyNameInitCap}")
#set ($subQueryPropertyName = "${tmpUncapitalisedJavaName}_InScopeSubQuery_${referrer.ReferrerPropertyNameInitCap}")
#end
public void inScope${relationPropertyNameInitCap}(SubQuery<${relatedCBClassName}> subQuery) {
assertObjectNotNull("subQuery<${relatedCBClassName}>", subQuery);
${relatedCBClassName} cb = new ${relatedCBClassName}(); cb.xsetupForInScopeSubQuery(); subQuery.query(cb);
String subQueryPropertyName = keep${subQueryPropertyNameInitCap}(cb.query()); // for saving query-value.
registerInScopeSubQuery(cb.query(), "${col.name}", "${referrer.firstLocalColumnName}", subQueryPropertyName);
}
public abstract String keep${subQueryPropertyNameInitCap}(${relatedCQClassName} subQuery);
#end
#end
#if (${col.hasSingleKeyReferrer()})
#foreach ($referrer in $col.singleKeyReferrers)
#set ($relatedCBClassName = "${referrer.referrerTableExtendedConditionBeanClassName}")
#set ($relatedCQClassName = "${referrer.referrerTableExtendedConditionQueryClassName}")
#if (${referrer.isOneToOne()})
#set ($relationPropertyNameInitCap = "${referrer.referrerPropertyNameInitCapAsOne}")
#set ($subQueryPropertyNameInitCap = "${tmpJavaName}_NotInScopeSubQuery_${referrer.referrerPropertyNameInitCapAsOne}")
#set ($subQueryPropertyName = "${tmpUncapitalisedJavaName}_NotInScopeSubQuery_${referrer.ReferrerPropertyNameInitCapAsOne}")
#else
#set ($relationPropertyNameInitCap = "${referrer.referrerPropertyNameInitCap}")
#set ($subQueryPropertyNameInitCap = "${tmpJavaName}_NotInScopeSubQuery_${referrer.referrerPropertyNameInitCap}")
#set ($subQueryPropertyName = "${tmpUncapitalisedJavaName}_NotInScopeSubQuery_${referrer.ReferrerPropertyNameInitCap}")
#end
public void notInScope${relationPropertyNameInitCap}(SubQuery<${relatedCBClassName}> subQuery) {
assertObjectNotNull("subQuery<${relatedCBClassName}>", subQuery);
${relatedCBClassName} cb = new ${relatedCBClassName}(); cb.xsetupForInScopeSubQuery(); subQuery.query(cb);
String subQueryPropertyName = keep${subQueryPropertyNameInitCap}(cb.query()); // for saving query-value.
registerNotInScopeSubQuery(cb.query(), "${col.name}", "${referrer.firstLocalColumnName}", subQueryPropertyName);
}
public abstract String keep${subQueryPropertyNameInitCap}(${relatedCQClassName} subQuery);
#end
#end
#if (${col.hasSingleKeyReferrer()})
#foreach ($referrer in $col.singleKeyReferrers)
#set ($relatedCBClassName = "${referrer.referrerTableExtendedConditionBeanClassName}")
#set ($relatedCQClassName = "${referrer.referrerTableExtendedConditionQueryClassName}")
#if (${referrer.isOneToOne()})
#set ($relationPropertyNameInitCap = "${referrer.referrerPropertyNameInitCapAsOne}")
#set ($subQueryPropertyNameInitCap = "${tmpJavaName}_ExistsSubQuery_${referrer.referrerPropertyNameInitCapAsOne}")
#set ($subQueryPropertyName = "${tmpUncapitalisedJavaName}_ExistsSubQuery_${referrer.referrerPropertyNameInitCapAsOne}")
#else
#set ($relationPropertyNameInitCap = "${referrer.referrerPropertyNameInitCap}")
#set ($subQueryPropertyNameInitCap = "${tmpJavaName}_ExistsSubQuery_${referrer.referrerPropertyNameInitCap}")
#set ($subQueryPropertyName = "${tmpUncapitalisedJavaName}_ExistsSubQuery_${referrer.referrerPropertyNameInitCap}")
#end
/**
* Set up 'exists' sub-query. {exists (select ${referrer.firstLocalColumnName} from ${referrer.table.name} where ...)}
* @param subQuery The sub-query of ${subQueryPropertyNameInitCap} for 'exists'. (NotNull)
*/
public void exists${relationPropertyNameInitCap}(SubQuery<${relatedCBClassName}> subQuery) {
assertObjectNotNull("subQuery<${relatedCBClassName}>", subQuery);
${relatedCBClassName} cb = new ${relatedCBClassName}(); cb.xsetupForExistsSubQuery(); subQuery.query(cb);
String subQueryPropertyName = keep${subQueryPropertyNameInitCap}(cb.query()); // for saving query-value.
registerExistsSubQuery(cb.query(), "${col.name}", "${referrer.firstLocalColumnName}", subQueryPropertyName);
}
public abstract String keep${subQueryPropertyNameInitCap}(${relatedCQClassName} subQuery);
#end
#end
#if (${col.hasSingleKeyReferrer()})
#foreach ($referrer in $col.singleKeyReferrers)
#set ($relatedCBClassName = "${referrer.referrerTableExtendedConditionBeanClassName}")
#set ($relatedCQClassName = "${referrer.referrerTableExtendedConditionQueryClassName}")
#if (${referrer.isOneToOne()})
#set ($relationPropertyNameInitCap = "${referrer.referrerPropertyNameInitCapAsOne}")
#set ($subQueryPropertyNameInitCap = "${tmpJavaName}_NotExistsSubQuery_${referrer.referrerPropertyNameInitCapAsOne}")
#set ($subQueryPropertyName = "${tmpUncapitalisedJavaName}_NotExistsSubQuery_${referrer.referrerPropertyNameInitCapAsOne}")
#else
#set ($relationPropertyNameInitCap = "${referrer.referrerPropertyNameInitCap}")
#set ($subQueryPropertyNameInitCap = "${tmpJavaName}_NotExistsSubQuery_${referrer.referrerPropertyNameInitCap}")
#set ($subQueryPropertyName = "${tmpUncapitalisedJavaName}_NotExistsSubQuery_${referrer.referrerPropertyNameInitCap}")
#end
/**
* Set up 'not exists' sub-query. {not exists (select ${referrer.firstLocalColumnName} from ${referrer.table.name} where ...)}
* @param subQuery The sub-query of ${subQueryPropertyNameInitCap} for 'not exists'. (NotNull)
*/
public void notExists${relationPropertyNameInitCap}(SubQuery<${relatedCBClassName}> subQuery) {
assertObjectNotNull("subQuery<${relatedCBClassName}>", subQuery);
${relatedCBClassName} cb = new ${relatedCBClassName}(); cb.xsetupForExistsSubQuery(); subQuery.query(cb);
String subQueryPropertyName = keep${subQueryPropertyNameInitCap}(cb.query()); // for saving query-value.
registerNotExistsSubQuery(cb.query(), "${col.name}", "${referrer.firstLocalColumnName}", subQueryPropertyName);
}
public abstract String keep${subQueryPropertyNameInitCap}(${relatedCQClassName} subQuery);
#end
#end
#if (${col.hasSingleKeyReferrer()})
#foreach ($referrer in $col.singleKeyReferrers)
#if (!${referrer.isOneToOne()})
#set ($relatedCBClassName = "${referrer.referrerTableExtendedConditionBeanClassName}")
#set ($relatedCQClassName = "${referrer.referrerTableExtendedConditionQueryClassName}")
#set ($subQueryPropertyNameInitCap = "${tmpJavaName}_SpecifyDerivedReferrer_${referrer.referrerPropertyNameInitCap}")
#set ($subQueryPropertyName = "${tmpUncapitalisedJavaName}_SpecifyDerivedReferrer_${referrer.referrerPropertyNameInitCap}")
public void xsderive${referrer.referrerPropertyNameInitCap}(String function, SubQuery<${relatedCBClassName}> subQuery, String aliasName) {
assertObjectNotNull("subQuery<${relatedCBClassName}>", subQuery);
${relatedCBClassName} cb = new ${relatedCBClassName}(); cb.xsetupForDerivedReferrer(); subQuery.query(cb);
String subQueryPropertyName = keep${subQueryPropertyNameInitCap}(cb.query()); // for saving query-value.
registerSpecifyDerivedReferrer(function, cb.query(), "${col.name}", "${referrer.firstLocalColumnName}", subQueryPropertyName, aliasName);
}
public abstract String keep${subQueryPropertyNameInitCap}(${relatedCQClassName} subQuery);
#end
#end
#end
#if (${col.hasSingleKeyReferrer()})
#foreach ($referrer in $col.singleKeyReferrers)
#if (!${referrer.isOneToOne()})
#set ($relatedCBClassName = "${referrer.referrerTableExtendedConditionBeanClassName}")
#set ($relatedCQClassName = "${referrer.referrerTableExtendedConditionQueryClassName}")
#set ($subQueryPropertyNameInitCap = "${tmpJavaName}_QueryDerivedReferrer_${referrer.referrerPropertyNameInitCap}")
#set ($subQueryPropertyName = "${tmpUncapitalisedJavaName}_QueryDerivedReferrer_${referrer.referrerPropertyNameInitCap}")
public HpQDRFunction<${relatedCBClassName}> derived${referrer.referrerPropertyNameInitCap}() {
return xcreateQDRFunction${referrer.referrerPropertyNameInitCap}();
}
protected HpQDRFunction<${relatedCBClassName}> xcreateQDRFunction${referrer.referrerPropertyNameInitCap}() {
return new HpQDRFunction<${relatedCBClassName}>(new HpQDRSetupper<${relatedCBClassName}>() {
public void setup(String function, SubQuery<${relatedCBClassName}> subQuery, String operand, Object value) {
xqderive${referrer.referrerPropertyNameInitCap}(function, subQuery, operand, value);
}
});
}
public void xqderive${referrer.referrerPropertyNameInitCap}(String function, SubQuery<${relatedCBClassName}> subQuery, String operand, Object value) {
assertObjectNotNull("subQuery<${relatedCBClassName}>", subQuery);
${relatedCBClassName} cb = new ${relatedCBClassName}(); cb.xsetupForDerivedReferrer(); subQuery.query(cb);
String subQueryPropertyName = keep${subQueryPropertyNameInitCap}(cb.query()); // for saving query-value.
String parameterPropertyName = keep${subQueryPropertyNameInitCap}Parameter(value);
registerQueryDerivedReferrer(function, cb.query(), "${col.name}", "${referrer.firstLocalColumnName}", subQueryPropertyName, operand, value, parameterPropertyName);
}
public abstract String keep${subQueryPropertyNameInitCap}(${relatedCQClassName} subQuery);
public abstract String keep${subQueryPropertyNameInitCap}Parameter(Object parameterValue);
#end
#end
#end
#end
#if (${col.isJavaNativeDateObject()})
/**
* Equal(=). And NullIgnored, OnlyOnceRegistered. {${col.columnDefinitionLineDisp}}
* @param ${tmpUncapitalisedJavaName} The value of ${col.uncapitalisedJavaName} as equal.
*/
public void set${tmpJavaName}_Equal($col.javaNative ${tmpUncapitalisedJavaName}) {
reg${tmpJavaName}(CK_EQ, #if ($col.isJavaNativeUtilDate()) fCTPD(${tmpUncapitalisedJavaName})#else ${tmpUncapitalisedJavaName}#end);
}
#if (${col.isAvailableDateNotEqual()})
/**
* NotEqual(!=). And NullIgnored, OnlyOnceRegistered.
* @param ${tmpUncapitalisedJavaName} The value of ${col.uncapitalisedJavaName} as notEqual.
*/
public void set${tmpJavaName}_NotEqual($col.javaNative ${tmpUncapitalisedJavaName}) {
reg${tmpJavaName}(CK_NE, #if ($col.isJavaNativeUtilDate()) fCTPD(${tmpUncapitalisedJavaName})#else ${tmpUncapitalisedJavaName}#end);
}
#end
#if (${col.isAvailableDateGreaterThan()})
/**
* GreaterThan(>). And NullIgnored, OnlyOnceRegistered.
* @param ${tmpUncapitalisedJavaName} The value of ${col.uncapitalisedJavaName} as greaterThan.
*/
public void set${tmpJavaName}_GreaterThan($col.javaNative ${tmpUncapitalisedJavaName}) {
reg${tmpJavaName}(CK_GT, #if ($col.isJavaNativeUtilDate()) fCTPD(${tmpUncapitalisedJavaName})#else ${tmpUncapitalisedJavaName}#end);
}
#end
#if (${col.isAvailableDateLessThan()})
/**
* LessThan(>). And NullIgnored, OnlyOnceRegistered.
* @param ${tmpUncapitalisedJavaName} The value of ${col.uncapitalisedJavaName} as lessThan.
*/
public void set${tmpJavaName}_LessThan($col.javaNative ${tmpUncapitalisedJavaName}) {
reg${tmpJavaName}(CK_LT, #if ($col.isJavaNativeUtilDate()) fCTPD(${tmpUncapitalisedJavaName})#else ${tmpUncapitalisedJavaName}#end);
}
#end
#if (${col.isAvailableDateGreaterEqual()})
/**
* GreaterEqual(>). And NullIgnored, OnlyOnceRegistered.
* @param ${tmpUncapitalisedJavaName} The value of ${col.uncapitalisedJavaName} as greaterEqual.
*/
public void set${tmpJavaName}_GreaterEqual($col.javaNative ${tmpUncapitalisedJavaName}) {
reg${tmpJavaName}(CK_GE, #if ($col.isJavaNativeUtilDate()) fCTPD(${tmpUncapitalisedJavaName})#else ${tmpUncapitalisedJavaName}#end);
}
#end
#if (${col.isAvailableDateLessEqual()})
/**
* LessEqual(>). And NullIgnored, OnlyOnceRegistered.
* @param ${tmpUncapitalisedJavaName} The value of ${col.uncapitalisedJavaName} as lessEqual.
*/
public void set${tmpJavaName}_LessEqual($col.javaNative ${tmpUncapitalisedJavaName}) {
reg${tmpJavaName}(CK_LE,#if ($col.isJavaNativeUtilDate()) fCTPD(${tmpUncapitalisedJavaName})#else ${tmpUncapitalisedJavaName}#end);
}
#end
#if (${col.isAvailableDateFromTo()} && !${col.isJdbcTypeTime()})
/**
* FromTo(fromDate <= COLUMN_NAME <= toDate). And NullIgnored, OnlyOnceRegistered. {${col.columnDefinitionLineDisp}}
* @param fromDate The from-date of ${col.uncapitalisedJavaName}. (Nullable)
* @param toDate The to-date of ${col.uncapitalisedJavaName}. (Nullable)
* @param fromToOption The option of from-to. (NotNull)
*/
public void set${tmpJavaName}_FromTo(java.util.Date fromDate, java.util.Date toDate, FromToOption fromToOption) {
#if ($col.isJavaNativeUtilDate())
regFTQ(fCTPD(fromDate), fCTPD(toDate), getCValue${tmpJavaName}(), "${col.name}", fromToOption);
#else
regFTQ((fromDate != null ? new ${col.javaNative}(fromDate.getTime()) : null), (toDate != null ? new ${col.javaNative}(toDate.getTime()) : null), getCValue${tmpJavaName}(), "${col.name}", fromToOption);
#end
}
/**
* FromTo(fromDate <= COLUMN_NAME < toDate + 1). And NullIgnored, OnlyOnceRegistered. {${col.columnDefinitionLineDisp}}
* @param fromDate The from-date of ${col.uncapitalisedJavaName}. (Nullable)
* @param toDate The to-date of ${col.uncapitalisedJavaName}. (Nullable)
*/
public void set${tmpJavaName}_DateFromTo(java.util.Date fromDate, java.util.Date toDate) {
set${tmpJavaName}_FromTo(fromDate, toDate, new DateFromToOption());
}
#end
#end
#if (${col.isJavaNativeBooleanObject()})
/**
* Equal(=). And NullIgnored, OnlyOnceRegistered. {${col.columnDefinitionLineDisp}}
* @param ${tmpUncapitalisedJavaName} The value of ${col.uncapitalisedJavaName} as equal.
*/
public void set${tmpJavaName}_Equal(${col.javaNative} ${tmpUncapitalisedJavaName}) {
reg${tmpJavaName}(CK_EQ, ${tmpUncapitalisedJavaName});
}
#if (${col.hasClassification()})
#foreach ($classificationMap in $col.classificationMapList)
/**
* Equal(=). As ${classificationMap.get('name')}. And OnlyOnceRegistered.
* $database.buildClassificationApplicationComment($classificationMap)
*/
public void set${tmpJavaName}_Equal_${classificationMap.get('name')}() {
reg${tmpJavaName}(CK_EQ, new ${col.javaNative}(${glCDef}.${col.classificationName}.${classificationMap.get('name')}.code()));
}
#end
#end
#end
#if (${col.isJavaNativeUUIDObject()})
/**
* Equal(=). And NullIgnored, OnlyOnceRegistered. {${col.columnDefinitionLineDisp}}
* @param ${tmpUncapitalisedJavaName} The value of ${col.uncapitalisedJavaName} as equal.
*/
public void set${tmpJavaName}_Equal(${col.javaNative} ${tmpUncapitalisedJavaName}) {
reg${tmpJavaName}(CK_EQ, ${tmpUncapitalisedJavaName});
}
#if (${col.isAvailableStringInScope()})
/**
* InScope(in ('a', 'b')). And NullOrEmptyIgnored, NullOrEmptyElementIgnored, SeveralRegistered.
* @param ${tmpUncapitalisedJavaName}List The collection of ${col.uncapitalisedJavaName} as inScope.
*/
public void set${tmpJavaName}_InScope(Collection<${col.javaNative}> ${tmpUncapitalisedJavaName}List) {
regINS(CK_INS, cTL(${tmpUncapitalisedJavaName}List), getCValue${tmpJavaName}(), "${col.name}");
}
#end
#end
#if (!${col.isNotNull()} || ${col.isPrimaryKey()})
/**
* IsNull(is null). And OnlyOnceRegistered.
*/
public void set${tmpJavaName}_IsNull() { reg${tmpJavaName}(CK_ISN, DOBJ); }
/**
* IsNotNull(is not null). And OnlyOnceRegistered.
*/
public void set${tmpJavaName}_IsNotNull() { reg${tmpJavaName}(CK_ISNN, DOBJ); }
#end
protected void reg${tmpJavaName}(ConditionKey k, Object v) { regQ(k, v, getCValue${tmpJavaName}(), "${col.name}"); }
abstract protected ConditionValue getCValue${tmpJavaName}();
#end
#if ($table.hasOnlyOnePrimaryKey())
// ===================================================================================
// Scalar SubQuery
// ===============
public HpSSQFunction<${myConditionBeanClassName}> scalar_Equal() {
return xcreateSSQFunction("=");
}
public HpSSQFunction<${myConditionBeanClassName}> scalar_GreaterEqual() {
return xcreateSSQFunction(">=");
}
public HpSSQFunction<${myConditionBeanClassName}> scalar_GreaterThan() {
return xcreateSSQFunction(">");
}
public HpSSQFunction<${myConditionBeanClassName}> scalar_LessEqual() {
return xcreateSSQFunction("<=");
}
public HpSSQFunction<${myConditionBeanClassName}> scalar_LessThan() {
return xcreateSSQFunction("<");
}
protected HpSSQFunction<${myConditionBeanClassName}> xcreateSSQFunction(final String operand) {
return new HpSSQFunction<${myConditionBeanClassName}>(new HpSSQSetupper<${myConditionBeanClassName}>() {
public void setup(String function, SubQuery<${myConditionBeanClassName}> subQuery) {
xscalarSubQuery(function, subQuery, operand);
}
});
}
protected void xscalarSubQuery(String function, SubQuery<${myConditionBeanClassName}> subQuery, String operand) {
assertObjectNotNull("subQuery<${myConditionBeanClassName}>", subQuery);
${myConditionBeanClassName} cb = new ${myConditionBeanClassName}(); cb.xsetupForScalarSubQuery(); subQuery.query(cb);
String subQueryPropertyName = keepScalarSubQuery(cb.query()); // for saving query-value.
registerScalarSubQuery(function, cb.query(), subQueryPropertyName, operand);
}
public abstract String keepScalarSubQuery(${myConditionQueryClassName} subQuery);
// ===================================================================================
// MySelf InScope SubQuery
// =======================
/**
* Myself InScope SubQuery. {mainly for CLOB and Union}
* @param subQuery The implementation of sub query. (NotNull)
*/
public void myselfInScope(SubQuery<${myConditionBeanClassName}> subQuery) {
assertObjectNotNull("subQuery<${myConditionBeanClassName}>", subQuery);
${myConditionBeanClassName} cb = new ${myConditionBeanClassName}(); cb.xsetupForInScopeSubQuery(); subQuery.query(cb);
String subQueryPropertyName = keepMyselfInScopeSubQuery(cb.query()); // for saving query-value.
registerInScopeSubQuery(cb.query(), "${table.primaryKeyAsOne.name}", "${table.primaryKeyAsOne.name}", subQueryPropertyName);
}
public abstract String keepMyselfInScopeSubQuery(${myConditionQueryClassName} subQuery);
#end
#if ($database.isAvailableDatabaseDependency())
#if ($database.isDatabaseMySQL())
/**
* Match for full-text search.
* Bind variable is unused because the condition value should be literal in MySQL.
* @param textColumn The text column. (NotNull, StringColumn, TargetTableColumn)
* @param conditionValue The condition value. (Nullable: If the value is null or empty, it does not make condition!)
* @param modifier The modifier of full-text search. (Nullable: If the value is null, No modifier specified)
*/
public void match(org.seasar.dbflute.dbmeta.info.ColumnInfo textColumn
, String conditionValue
, org.seasar.dbflute.dbway.WayOfMySQL.FullTextSearchModifier modifier) {
if (conditionValue == null || conditionValue.length() == 0) { return; }
assertObjectNotNull("textColumn", textColumn);
match(newArrayList(textColumn), conditionValue, modifier);
}
/**
* Match for full-text search.
* Bind variable is unused because the condition value should be literal in MySQL.
* @param textColumnList The list of text column. (NotNull, NotEmpty, StringColumn, TargetTableColumn)
* @param conditionValue The condition value. (Nullable: If the value is null or empty, it does not make condition!)
* @param modifier The modifier of full-text search. (Nullable: If the value is null, No modifier specified)
*/
public void match(java.util.List textColumnList
, String conditionValue
, org.seasar.dbflute.dbway.WayOfMySQL.FullTextSearchModifier modifier) {
if (conditionValue == null || conditionValue.length() == 0) { return; }
String conditionString = ((org.seasar.dbflute.cbean.sqlclause.SqlClauseMySql)getSqlClause())
.buildMatchCondition(textColumnList, conditionValue, modifier, getTableDbName(), getRealAliasName());
registerWhereClause(conditionString);
}
#end
#if ($database.isDatabasePostgreSQL())
/**
* Match for full-text search.
* @param textColumn The text column. (NotNull, StringColumn, TargetTableColumn)
* @param conditionValue The condition value. (Nullable: If the value is null or empty, it does not make condition!)
*/
public void match(org.seasar.dbflute.dbmeta.info.ColumnInfo textColumn, String conditionValue) {
if (conditionValue == null || conditionValue.length() == 0) { return; }
assertObjectNotNull("textColumn", textColumn);
match(newArrayList(textColumn), conditionValue);
}
/**
* Match for full-text search.
* @param textColumnList The list of text column. (NotNull, NotEmpty, StringColumn, TargetTableColumn)
* @param conditionValue The condition value. (Nullable: If the value is null or empty, it does not make condition!)
*/
public void match(java.util.List textColumnList, String conditionValue) {
if (conditionValue == null || conditionValue.length() == 0) { return; }
assertObjectNotNull("textColumnList", textColumnList);
if (textColumnList.isEmpty()) {
throw new IllegalArgumentException("The argument 'textColumnList' should not be empty list!");
}
int index = 0;
getSqlClause().makeOrScopeQueryEffective();
try {
for (org.seasar.dbflute.dbmeta.info.ColumnInfo columnInfo : textColumnList) {
if (columnInfo == null) {
continue;
}
String tableOfColumn = columnInfo.getDBMeta().getTableDbName();
if (!tableOfColumn.equalsIgnoreCase(getTableDbName())) {
String msg = "The table of the text column should be '" + getTableDbName() + "'";
msg = msg + " but the table is '" + tableOfColumn + "': column=" + columnInfo;
throw new IllegalArgumentException(msg);
}
Class> propertyType = columnInfo.getPropertyType();
if (!String.class.isAssignableFrom(propertyType)) {
String msg = "The text column should be String type:";
msg = msg + " type=" + propertyType + " column=" + columnInfo;
throw new IllegalArgumentException(msg);
}
invokeQueryLikeSearch(columnInfo.getColumnDbName(), conditionValue, new LikeSearchOption() {
@Override
public org.seasar.dbflute.dbway.ExtensionOperand getExtensionOperand() {
return ${glDBFluteConfig}.getInstance().getFullTextSearchOperand();
}
});
++index;
}
} finally {
getSqlClause().closeOrScopeQuery();
}
}
#end
#if ($database.isDatabaseOracle())
/**
* Match for full-text search.
* @param textColumn The text column. (NotNull, StringColumn, TargetTableColumn)
* @param conditionValue The condition value. (Nullable: If the value is null or empty, it does not make condition!)
*/
public void match(org.seasar.dbflute.dbmeta.info.ColumnInfo textColumn, String conditionValue) {
if (conditionValue == null || conditionValue.length() == 0) { return; }
assertObjectNotNull("textColumn", textColumn);
match(newArrayList(textColumn), conditionValue);
}
/**
* Match for full-text search.
* The specified condition value is escaped in this method automatically.
* @param textColumnList The list of text column. (NotNull, NotEmpty, StringColumn, TargetTableColumn)
* @param conditionValue The condition value. (Nullable: If the value is null or empty, it does not make condition!)
*/
public void match(java.util.List textColumnList, String conditionValue) {
if (conditionValue == null || conditionValue.length() == 0) { return; }
assertObjectNotNull("textColumnList", textColumnList);
if (textColumnList.isEmpty()) {
throw new IllegalArgumentException("The argument 'textColumnList' should not be empty list!");
}
conditionValue = escapeFullTextSearchValue(conditionValue);
int index = 0;
getSqlClause().makeOrScopeQueryEffective();
try {
for (org.seasar.dbflute.dbmeta.info.ColumnInfo columnInfo : textColumnList) {
if (columnInfo == null) {
continue;
}
String tableOfColumn = columnInfo.getDBMeta().getTableDbName();
if (!tableOfColumn.equalsIgnoreCase(getTableDbName())) {
String msg = "The table of the text column should be '" + getTableDbName() + "'";
msg = msg + " but the table is '" + tableOfColumn + "': column=" + columnInfo;
throw new IllegalArgumentException(msg);
}
Class> propertyType = columnInfo.getPropertyType();
if (!String.class.isAssignableFrom(propertyType)) {
String msg = "The text column should be String type:";
msg = msg + " type=" + propertyType + " column=" + columnInfo;
throw new IllegalArgumentException(msg);
}
invokeQueryLikeSearch(columnInfo.getColumnDbName(), conditionValue, new LikeSearchOption() {
@Override
public org.seasar.dbflute.cbean.sqlclause.WhereClauseArranger getWhereClauseArranger() {
return ((org.seasar.dbflute.cbean.sqlclause.SqlClauseOracle)getSqlClause())
.createFullTextSearchClauseArranger();
}
});
++index;
}
} finally {
getSqlClause().closeOrScopeQuery();
}
}
protected String escapeFullTextSearchValue(String conditionValue) {
return ((org.seasar.dbflute.cbean.sqlclause.SqlClauseOracle)getSqlClause())
.escapeFullTextSearchValue(conditionValue);
}
#end
#end
// ===================================================================================
// Very Internal
// =============
// Very Internal (for Suppressing Warn about 'Not Use Import')
String xCB() { return ${myConditionBeanClassName}.class.getName(); }
String xCQ() { return ${myConditionQueryClassName}.class.getName(); }
String xLSO() { return LikeSearchOption.class.getName(); }
String xSSQS() { return HpSSQSetupper.class.getName(); }
#if ($database.isDatabaseMSAccess())
@Override
protected boolean xsuppressEscape() { return true; } // bacause MS-Access does not support escape
#end
}