Search in sources :

Example 1 with DfLittleAdjustmentProperties

use of org.dbflute.properties.DfLittleAdjustmentProperties in project dbflute-core by dbflute.

the class DfLReverseOutputHandler method deriveSheetName.

protected String deriveSheetName(Table table) {
    // if schema-driven, output with table name with schema as sheet name
    // it depends on ReplaceSchema specification whether the data file can be loaded or not
    final String tableDbName = table.getTableDbName();
    // sheet name's case is depends on table display name's case
    // because sheet name (as table name) is also display name
    final DfLittleAdjustmentProperties prop = getLittleAdjustmentProperties();
    return prop.isTableDispNameUpperCase() ? tableDbName.toUpperCase() : tableDbName;
}
Also used : DfLittleAdjustmentProperties(org.dbflute.properties.DfLittleAdjustmentProperties)

Example 2 with DfLittleAdjustmentProperties

use of org.dbflute.properties.DfLittleAdjustmentProperties in project dbflute-core by dbflute.

the class DfTableMeta method getTableSqlName.

public String getTableSqlName() {
    final DfLittleAdjustmentProperties prop = getLittleAdjustmentProperties();
    final String quotedName = prop.quoteTableNameIfNeedsDirectUse(_tableName);
    // driven is resolved here so it uses pure name here
    return _unifiedSchema.buildSqlName(quotedName);
}
Also used : DfLittleAdjustmentProperties(org.dbflute.properties.DfLittleAdjustmentProperties)

Example 3 with DfLittleAdjustmentProperties

use of org.dbflute.properties.DfLittleAdjustmentProperties in project dbflute-core by dbflute.

the class DfLanguagePropertyPackageResolverJava method processLanguageType.

protected String processLanguageType(String typeName, boolean exceptUtil) {
    if (!exceptUtil) {
        final String listType = processListType(typeName, exceptUtil, getListPackage(), "List");
        if (listType != null) {
            return listType;
        }
        final String mapType = processMapType(typeName, exceptUtil, getMapPackage(), "Map");
        if (mapType != null) {
            return mapType;
        }
    }
    if (typeName.equals("BigDecimal")) {
        return getBigDecimalPackage() + "." + typeName;
    }
    final DfLittleAdjustmentProperties prop = getLittleAdjustmentProperties();
    if (typeName.equals("LocalDate")) {
        return getJava8LocalDate();
    }
    if (typeName.equals("LocalDateTime")) {
        return getJava8LocalDateTime();
    }
    if (typeName.equals("Date")) {
        if (prop.isAvailableJava8TimeLocalDateEntity()) {
            if (prop.needsDateTreatedAsLocalDateTime()) {
                return getJava8LocalDateTime();
            } else {
                return getJava8LocalDate();
            }
        }
        if (!exceptUtil) {
            return "java.util." + typeName;
        }
    }
    if (typeName.equals("Timestamp")) {
        if (prop.isAvailableJava8TimeLocalDateEntity()) {
            return getJava8LocalDateTime();
        }
        return "java.sql." + typeName;
    }
    if (typeName.equals("Time")) {
        return "java.sql." + typeName;
    }
    return null;
}
Also used : DfLittleAdjustmentProperties(org.dbflute.properties.DfLittleAdjustmentProperties)

Example 4 with DfLittleAdjustmentProperties

use of org.dbflute.properties.DfLittleAdjustmentProperties in project dbflute-core by dbflute.

the class ForeignKey method isSuppressReferrerRelation.

protected boolean isSuppressReferrerRelation() {
    final DfLittleAdjustmentProperties prop = getLittleAdjustmentProperties();
    final Map<String, Set<String>> referrerRelationMap = prop.getSuppressReferrerRelationMap();
    final Set<String> relationNameSet = referrerRelationMap.get(getForeignTable().getTableDbName());
    if (relationNameSet == null) {
        return false;
    }
    // the table exists in the map here
    final String relationName;
    if (isOneToOne()) {
        relationName = getReferrerPropertyNameAsOne();
    } else {
        relationName = getReferrerPropertyName();
    }
    if (relationNameSet.contains("$$ALL$$")) {
        if (relationNameSet.contains("!" + relationName)) {
            // pinpoint include
            return false;
        }
        return true;
    }
    return relationNameSet.contains(relationName);
}
Also used : Set(java.util.Set) DfLittleAdjustmentProperties(org.dbflute.properties.DfLittleAdjustmentProperties)

Example 5 with DfLittleAdjustmentProperties

use of org.dbflute.properties.DfLittleAdjustmentProperties in project dbflute-core by dbflute.

the class Table method hasColumnNullObjectProviderImport.

public boolean hasColumnNullObjectProviderImport() {
    final DfLittleAdjustmentProperties prop = getLittleAdjustmentProperties();
    final String providerPackage = prop.getColumnNullObjectProviderPackage();
    return providerPackage != null && hasColumnNullObjectColumn();
}
Also used : DfLittleAdjustmentProperties(org.dbflute.properties.DfLittleAdjustmentProperties)

Aggregations

DfLittleAdjustmentProperties (org.dbflute.properties.DfLittleAdjustmentProperties)24 DfLanguageDependency (org.dbflute.logic.generate.language.DfLanguageDependency)2 Set (java.util.Set)1 StringTokenizer (java.util.StringTokenizer)1 Column (org.apache.torque.engine.database.model.Column)1 ForeignKey (org.apache.torque.engine.database.model.ForeignKey)1 Table (org.apache.torque.engine.database.model.Table)1 ClassificationUndefinedHandlingType (org.dbflute.jdbc.ClassificationUndefinedHandlingType)1 DfBasicProperties (org.dbflute.properties.DfBasicProperties)1 DfClassificationTop (org.dbflute.properties.assistant.classification.DfClassificationTop)1