use of org.dbflute.properties.DfBasicProperties in project dbflute-core by dbflute.
the class TorqueDataModelTask method setupControlTemplate.
protected void setupControlTemplate() {
final DfLittleAdjustmentProperties littleProp = getLittleAdjustmentProperties();
final String title;
final String control;
final DfBasicProperties basicProp = getBasicProperties();
if (littleProp.isAlternateGenerateControlValid()) {
title = "alternate control";
control = littleProp.getAlternateGenerateControl();
} else {
final DfLanguageDependency lang = getBasicProperties().getLanguageDependency();
if (basicProp.isApplicationBehaviorProject()) {
title = lang.getLanguageTitle() + " BhvAp";
control = lang.getGenerateControlBhvAp();
} else {
title = lang.getLanguageTitle();
control = lang.getGenerateControl();
}
}
_log.info("");
_log.info("...Using " + title + " control: " + control);
setControlTemplate(control);
}
use of org.dbflute.properties.DfBasicProperties in project dbflute-core by dbflute.
the class AppData method createAsEmpty.
public static AppData createAsEmpty() {
// e.g. ReplaceSchema's generation
final DfBasicProperties basicProp = DfBuildProperties.getInstance().getBasicProperties();
final DfDatabaseTypeFacadeProp facadeProp = basicProp.getDatabaseTypeFacadeProp();
final String databaseType = facadeProp.getTargetDatabase();
final AppData appData = new AppData(databaseType);
final Database database = new Database();
database.setAppData(appData);
appData.addDatabase(database);
return appData;
}
use of org.dbflute.properties.DfBasicProperties in project dbflute-core by dbflute.
the class DfOutsideSqlCollector method handleSecondaryDirectory.
protected boolean handleSecondaryDirectory(DfOutsideSqlPack outsideSqlPack, DfOutsideSqlLocation sqlLocation, String sqlDirectory, boolean checkNotFound) {
final DfBasicProperties basicProp = getBasicProperties();
final DfLanguageDependency lang = basicProp.getLanguageDependency();
final String secondaryDirectory = lang.convertToSecondaryOutsideSqlDirectory(sqlDirectory);
final boolean foundSecondaryDirectory;
if (secondaryDirectory != null && !sqlDirectory.equals(secondaryDirectory)) {
try {
outsideSqlPack.addAll(collectSqlFile(secondaryDirectory, sqlLocation));
} catch (FileNotFoundException e) {
if (checkNotFound) {
String msg = "The sqlDirectory does not exist: " + secondaryDirectory;
throw new IllegalStateException(msg);
} else {
_log.info("Not found sql directory on resources: " + secondaryDirectory);
}
}
foundSecondaryDirectory = true;
} else {
foundSecondaryDirectory = false;
}
return foundSecondaryDirectory;
}
use of org.dbflute.properties.DfBasicProperties in project dbflute-core by dbflute.
the class DfBehaviorQueryPathSetupper method findBsBhvDirOrWarining.
// -----------------------------------------------------
// BsBhv Directory
// ---------------
protected File findBsBhvDirOrWarining() {
// null allowed
final DfBasicProperties basicProp = getBasicProperties();
final String outputDirectory = basicProp.getGenerateOutputDirectory();
final String mainPath = buildBsBhvPathBase(basicProp, outputDirectory);
final File mainBsbhvDir = new File(mainPath);
if (mainBsbhvDir.exists() && hasProgramFile(basicProp, mainBsbhvDir)) {
// normally here
return mainBsbhvDir;
}
// not exception just in case (sub function here)
if (basicProp.isGenerationGapileValid()) {
final String gapileDirectory = basicProp.getGapileDirectory();
final String gapilePath = buildBsBhvPathBase(basicProp, gapileDirectory);
final File gapileBsbhvDir = new File(gapilePath);
if (gapileBsbhvDir.exists() && hasProgramFile(basicProp, gapileBsbhvDir)) {
return gapileBsbhvDir;
} else {
_log.warn("*Not found the base behavior for behavior query path: " + gapilePath);
return null;
}
} else {
_log.warn("*Not found the base behavior for behavior query path: " + mainPath);
return null;
}
}
use of org.dbflute.properties.DfBasicProperties in project dbflute-core by dbflute.
the class DfBqpBehaviorFile method doAnalyze.
protected void doAnalyze() {
String tableKeyName = _bsbhvFile.getName();
final int extIndex = tableKeyName.lastIndexOf(".");
if (extIndex >= 0) {
tableKeyName = tableKeyName.substring(0, extIndex);
}
// ApplicationBehavior resolved here
final DfBasicProperties basicProperties = getBasicProperties();
final String bhvSuffix = getBhvApResolvedBehaviorSuffix();
final String projectPrefix = getBhvApResolvedProjectPrefix();
if (tableKeyName.endsWith(bhvSuffix)) {
tableKeyName = tableKeyName.substring(0, tableKeyName.length() - bhvSuffix.length());
}
if (Srl.is_NotNull_and_NotTrimmedEmpty(projectPrefix) && tableKeyName.startsWith(projectPrefix)) {
tableKeyName = tableKeyName.substring(projectPrefix.length());
}
final String basePrefix = basicProperties.getBasePrefix();
if (Srl.is_NotNull_and_NotTrimmedEmpty(basePrefix) && tableKeyName.startsWith(basePrefix)) {
tableKeyName = tableKeyName.substring(basePrefix.length(), tableKeyName.length());
}
_tableKeyName = tableKeyName;
}
Aggregations