Search in sources :

Example 21 with DfLanguageDependency

use of org.dbflute.logic.generate.language.DfLanguageDependency in project dbflute-core by dbflute.

the class DfOutsideSqlProperties method getDBMetaPackage.

public String getDBMetaPackage() {
    final DfLanguageDependency lang = getBasicProperties().getLanguageDependency();
    final String dbmetaPackage = lang.getLanguageClassPackage().getDBMetaSimplePackage();
    return getBaseEntityPackage() + "." + dbmetaPackage;
}
Also used : DfLanguageDependency(org.dbflute.logic.generate.language.DfLanguageDependency)

Example 22 with DfLanguageDependency

use of org.dbflute.logic.generate.language.DfLanguageDependency 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;
}
Also used : Column(org.apache.torque.engine.database.model.Column) DfLanguageDependency(org.dbflute.logic.generate.language.DfLanguageDependency) DfLanguageImplStyle(org.dbflute.logic.generate.language.implstyle.DfLanguageImplStyle)

Example 23 with DfLanguageDependency

use of org.dbflute.logic.generate.language.DfLanguageDependency 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();
}
Also used : Column(org.apache.torque.engine.database.model.Column) DfLanguageDependency(org.dbflute.logic.generate.language.DfLanguageDependency) DfLanguageImplStyle(org.dbflute.logic.generate.language.implstyle.DfLanguageImplStyle)

Example 24 with DfLanguageDependency

use of org.dbflute.logic.generate.language.DfLanguageDependency in project dbflute-core by dbflute.

the class DfGapileProcess method createReflector.

protected DfGapileClassReflector createReflector(String gapileDirectory) {
    final DfBasicProperties prop = getBasicProperties();
    final String outputDirectory = prop.getGenerateOutputDirectory();
    final String packageBase = prop.getPackageBase();
    final DfLanguageDependency lang = prop.getLanguageDependency();
    final DfLanguageClassPackage classPackage = lang.getLanguageClassPackage();
    final DfLanguageGrammar grammar = lang.getLanguageGrammar();
    return new DfGapileClassReflector(outputDirectory, packageBase, classPackage, grammar, gapileDirectory);
}
Also used : DfLanguageGrammar(org.dbflute.logic.generate.language.grammar.DfLanguageGrammar) DfLanguageDependency(org.dbflute.logic.generate.language.DfLanguageDependency) DfLanguageClassPackage(org.dbflute.logic.generate.language.pkgstyle.DfLanguageClassPackage) DfBasicProperties(org.dbflute.properties.DfBasicProperties)

Example 25 with DfLanguageDependency

use of org.dbflute.logic.generate.language.DfLanguageDependency in project dbflute-core by dbflute.

the class Table method getBehaviorInstanceMethodName.

public String getBehaviorInstanceMethodName() {
    // basically for Scala
    final String methodName = Srl.initUncap(getExtendedBehaviorClassName());
    final DfLanguageDependency lang = getLanguageDependency();
    return lang.getLanguageGrammar().adjustMethodInitialChar(methodName);
}
Also used : DfLanguageDependency(org.dbflute.logic.generate.language.DfLanguageDependency)

Aggregations

DfLanguageDependency (org.dbflute.logic.generate.language.DfLanguageDependency)26 DfLanguagePropertyPackageResolver (org.dbflute.logic.generate.language.pkgstyle.DfLanguagePropertyPackageResolver)7 Column (org.apache.torque.engine.database.model.Column)4 Map (java.util.Map)3 DfLanguageGrammar (org.dbflute.logic.generate.language.grammar.DfLanguageGrammar)3 DfLanguageImplStyle (org.dbflute.logic.generate.language.implstyle.DfLanguageImplStyle)3 DfLanguageClassPackage (org.dbflute.logic.generate.language.pkgstyle.DfLanguageClassPackage)3 DfBasicProperties (org.dbflute.properties.DfBasicProperties)3 FileNotFoundException (java.io.FileNotFoundException)2 DfLittleAdjustmentProperties (org.dbflute.properties.DfLittleAdjustmentProperties)2 BufferedReader (java.io.BufferedReader)1 BufferedWriter (java.io.BufferedWriter)1 FileInputStream (java.io.FileInputStream)1 FileOutputStream (java.io.FileOutputStream)1 IOException (java.io.IOException)1 InputStreamReader (java.io.InputStreamReader)1 OutputStreamWriter (java.io.OutputStreamWriter)1 UnsupportedEncodingException (java.io.UnsupportedEncodingException)1 Matcher (java.util.regex.Matcher)1 Pattern (java.util.regex.Pattern)1