use of org.dbflute.logic.generate.language.implstyle.DfLanguageImplStyle in project dbflute-core by dbflute.
the class DfColumnListToStringBuilder method getColumnArgsSetupString.
public static String getColumnArgsSetupString(String beanName, List<Column> columnList) {
validateColumnList(columnList);
final boolean hasPrefix = beanName != null;
final String beanPrefix = (hasPrefix ? beanName + "." : "");
final DfLanguageDependency lang = getBasicProperties().getLanguageDependency();
final DfLanguageImplStyle implStyle = lang.getLanguageImplStyle();
String result = "";
for (Iterator<Column> ite = columnList.iterator(); ite.hasNext(); ) {
final Column column = (Column) ite.next();
final String javaName = column.getJavaName();
final String variable = column.getUncapitalisedJavaName();
final String cls = column.getClassificationName();
final String basic;
if (column.isForceClassificationSetting()) {
basic = "set" + javaName + "As" + cls + "(" + variable + ")";
} else {
basic = "set" + javaName + "(" + variable + ")";
}
final String adjusted = implStyle.adjustEntitySetMethodCall(basic, !hasPrefix);
final String setter = beanPrefix + adjusted + ";";
if ("".equals(result)) {
result = setter;
} else {
result = result + setter;
}
}
return result;
}
use of org.dbflute.logic.generate.language.implstyle.DfLanguageImplStyle in project dbflute-core by dbflute.
the class DfColumnListToStringBuilder method doGetColumnArgsConditionSetupString.
private static String doGetColumnArgsConditionSetupString(List<Column> columnList) {
validateColumnList(columnList);
final DfLanguageDependency lang = getBasicProperties().getLanguageDependency();
final DfLanguageImplStyle implStyle = lang.getLanguageImplStyle();
final String query = implStyle.adjustConditionBeanLocalCQCall("cb");
final StringBuilder sb = new StringBuilder();
for (Column column : columnList) {
final String javaName = column.getJavaName();
final String variable = column.getUncapitalisedJavaName();
final String setter;
if (column.isForceClassificationSetting()) {
final String cls = column.getClassificationName();
final String basic = "set" + javaName + "_Equal_As" + cls + "(" + variable + ")";
final String adjusted = implStyle.adjustConditionQuerySetMethodCall(basic);
setter = query + "." + adjusted + ";";
} else {
final String basic = "set" + javaName + "_Equal(" + variable + ")";
final String adjusted = implStyle.adjustConditionQuerySetMethodCall(basic);
setter = query + "." + adjusted + ";";
}
sb.append(setter);
}
return sb.toString();
}
use of org.dbflute.logic.generate.language.implstyle.DfLanguageImplStyle in project dbflute-core by dbflute.
the class DfOutsideSqlTestTask method createOutsideSqlChecker.
protected DfOutsideSqlChecker createOutsideSqlChecker(DfOutsideSqlProperties outsideSqlProp) {
final DfOutsideSqlChecker checker = new DfOutsideSqlChecker();
if (outsideSqlProp.isRequiredSqlTitle()) {
checker.enableRequiredTitleCheck();
}
if (outsideSqlProp.isSuppressSqlTitleUniqueCheck()) {
checker.suppressTitleUniqueCheck();
}
if (outsideSqlProp.isRequiredSqlDescription()) {
checker.enableRequiredDescriptionCheck();
}
if (outsideSqlProp.isSuppressSqlDescriptionUniqueCheck()) {
checker.suppressDescriptionUniqueCheck();
}
final DfLanguageImplStyle languageImplStyle = getBasicProperties().getLanguageDependency().getLanguageImplStyle();
if (languageImplStyle.isIfCommentExpressionCheckEnabled()) {
// might be different specification between language
checker.enableIfCommentExpressionCheck();
}
return checker;
}
Aggregations