use of org.dbflute.logic.jdbc.schemaxml.DfSchemaXmlReader in project dbflute-core by dbflute.
the class DfFreeGenInitializer method setupReservedOption.
// ===================================================================================
// Reserved Option
// ===============
protected void setupReservedOption(String requestName, Map<String, Object> optionMap) {
@SuppressWarnings("unchecked") final Map<String, Object> databaseMap = (Map<String, Object>) optionMap.get("databaseMap");
if (databaseMap == null) {
return;
}
for (Entry<String, Object> entry : databaseMap.entrySet()) {
final String databaseName = entry.getKey();
@SuppressWarnings("unchecked") final Map<String, Object> settingsMap = (Map<String, Object>) entry.getValue();
final String schemaDir = (String) settingsMap.get("schemaDir");
final String schemaXml;
if (Srl.is_NotNull_and_NotTrimmedEmpty(schemaDir)) {
schemaXml = schemaDir + "/project-schema-" + databaseName + ".xml";
} else {
final String schemaFile = (String) settingsMap.get("schemaFile");
if (Srl.is_Null_or_TrimmedEmpty(schemaFile)) {
String msg = "Not found the schemaDir or schemaFile property in the " + databaseName + " for " + requestName;
throw new DfIllegalPropertySettingException(msg);
}
schemaXml = schemaFile;
}
final DfSchemaXmlReader reader = DfSchemaXmlReader.createAsFlexibleToManage(schemaXml);
final Database database = prepareDatabase(reader);
settingsMap.put("instance", database);
}
}
use of org.dbflute.logic.jdbc.schemaxml.DfSchemaXmlReader in project dbflute-core by dbflute.
the class DfSql2EntityTask method setupSchemaInformation.
protected void setupSchemaInformation() {
final DfSchemaXmlReader schemaFileReader = createSchemaFileReader();
_schemaData = schemaFileReader.read();
}
use of org.dbflute.logic.jdbc.schemaxml.DfSchemaXmlReader in project dbflute-core by dbflute.
the class DfAbstractDbMetaTexenTask method initializeSchemaData.
protected void initializeSchemaData() {
final DfSchemaXmlReader schemaXmlReader = createSchemaXmlReader();
_schemaData = schemaXmlReader.read();
}
use of org.dbflute.logic.jdbc.schemaxml.DfSchemaXmlReader in project dbflute-core by dbflute.
the class DfLReverseProcess method prepareDatabase.
// ===================================================================================
// Prepare
// =======
protected Database prepareDatabase() {
final String schemaXml = getLoadDataReverseSchemaXml();
final DfSchemaXmlSerializer serializer = createSchemaXmlSerializer(schemaXml);
serializer.serialize();
final DfSchemaXmlReader reader = createSchemaXmlReader(schemaXml);
final AppData appData = reader.read();
return appData.getDatabase();
}
use of org.dbflute.logic.jdbc.schemaxml.DfSchemaXmlReader in project dbflute-core by dbflute.
the class DfLReverseSchemaMetaProvider method prepareDatabase.
// ===================================================================================
// Prepare
// =======
public Database prepareDatabase() {
final String schemaXml = getReverseSchemaXml();
final DfSchemaXmlSerializer serializer = createSchemaXmlSerializer(schemaXml);
serializer.serialize();
final DfSchemaXmlReader reader = createSchemaXmlReader(schemaXml);
final AppData appData = reader.read();
return appData.getDatabase();
}
Aggregations