use of org.apache.torque.engine.database.model.UnifiedSchema in project dbflute-core by dbflute.
the class DfTakeFinallyProcess method createAsPrevious.
public static DfTakeFinallyProcess createAsPrevious(final String sqlRootDir, DataSource dataSource) {
final UnifiedSchema mainSchema = getDatabaseProperties().getDatabaseSchema();
final DfTakeFinallyProcess process = new DfTakeFinallyProcess(sqlRootDir, dataSource, mainSchema, null, null);
// and other settings are same as core
return process.suppressConventionalTakeAssert().suppressSequenceIncrement();
}
use of org.apache.torque.engine.database.model.UnifiedSchema in project dbflute-core by dbflute.
the class DfReplaceSchemaProperties method getAdditionalDropSchema.
public UnifiedSchema getAdditionalDropSchema(Map<String, Object> additionalDropMap) {
final String url = getAdditionalDropUrl(additionalDropMap);
final String catalog;
if (Srl.is_NotNull_and_NotTrimmedEmpty(url)) {
final DfUrlAnalyzerFactory factory = new DfUrlAnalyzerFactory(getBasicProperties(), url);
final DfUrlAnalyzer analyzer = factory.createAnalyzer();
catalog = analyzer.extractCatalog();
} else {
catalog = getDatabaseProperties().getDatabaseCatalog();
}
final Object obj = additionalDropMap.get("schema");
if (obj == null) {
if (!isDatabaseAsSchemaSpecificationOmittable()) {
String msg = "The schema is required:";
msg = msg + " additionalDropMap=" + additionalDropMap;
throw new DfRequiredPropertyNotFoundException(msg);
}
return null;
}
final String schema = castToString(obj, "additionalDropMapList.schema");
final UnifiedSchema unifiedSchema = UnifiedSchema.createAsDynamicSchema(catalog, schema);
return unifiedSchema;
}
use of org.apache.torque.engine.database.model.UnifiedSchema in project dbflute-core by dbflute.
the class DfSchemaXmlSerializer method doProcessSequence.
protected void doProcessSequence(Element sequenceGroupElement, final DfSequenceMeta sequenceMeta) {
final Element sequenceElement = _doc.createElement("sequence");
sequenceElement.setAttribute("name", sequenceMeta.getSequenceName());
final String sequenceCatalog = sequenceMeta.getSequenceCatalog();
final String sequenceSchema = sequenceMeta.getSequenceSchema();
final UnifiedSchema unifiedSchema = UnifiedSchema.createAsDynamicSchema(sequenceCatalog, sequenceSchema);
if (unifiedSchema.hasSchema()) {
sequenceElement.setAttribute("schema", unifiedSchema.getIdentifiedSchema());
}
setupSequenceAttributeNumber(sequenceMeta, sequenceElement, "minimumValue", sequenceMeta.getMinimumValue());
setupSequenceAttributeNumber(sequenceMeta, sequenceElement, "maximumValue", sequenceMeta.getMaximumValue());
setupSequenceAttributeNumber(sequenceMeta, sequenceElement, "incrementSize", sequenceMeta.getIncrementSize());
// no sequence meta now (2012/08/21)
// sequenceElement.setAttribute("comment", null);
sequenceGroupElement.appendChild(sequenceElement);
}
use of org.apache.torque.engine.database.model.UnifiedSchema in project dbflute-core by dbflute.
the class DfSchemaXmlSerializer method resolveAdditionalSchema.
protected void resolveAdditionalSchema(DatabaseMetaData dbMeta, List<DfTableMeta> tableList) throws SQLException {
if (_suppressAdditionalSchema) {
return;
}
final List<UnifiedSchema> schemaList = getDatabaseProperties().getAdditionalSchemaList();
for (UnifiedSchema additionalSchema : schemaList) {
final List<DfTableMeta> additionalTableList = _tableExtractor.getTableList(dbMeta, additionalSchema);
helpTableBasicSupplement(additionalTableList, additionalSchema);
tableList.addAll(additionalTableList);
}
}
use of org.apache.torque.engine.database.model.UnifiedSchema in project dbflute-core by dbflute.
the class DfSchemaXmlSerializer method doProcessProcedure.
protected void doProcessProcedure(Element procedureGroupElement, final DfProcedureMeta procedureMeta) {
final Element procedureElement = _doc.createElement("procedure");
procedureElement.setAttribute("name", procedureMeta.getProcedureName());
final UnifiedSchema unifiedSchema = procedureMeta.getProcedureSchema();
if (unifiedSchema.hasSchema()) {
procedureElement.setAttribute("schema", unifiedSchema.getIdentifiedSchema());
}
final String noMetaMark = DfSchemaDiff.PROCEDURE_SOURCE_NO_META_MARK;
final DfProcedureSourceInfo sourceInfo = procedureMeta.getProcedureSourceInfo();
{
final Integer sourceLine = sourceInfo != null ? sourceInfo.getSourceLine() : null;
procedureElement.setAttribute("sourceLine", sourceLine != null ? sourceLine.toString() : noMetaMark);
}
{
final Integer sourceSize = sourceInfo != null ? sourceInfo.getSourceSize() : null;
procedureElement.setAttribute("sourceSize", sourceSize != null ? sourceSize.toString() : noMetaMark);
}
{
final String sourceHash = sourceInfo != null ? sourceInfo.toSourceHash() : null;
procedureElement.setAttribute("sourceHash", sourceHash != null ? sourceHash : noMetaMark);
}
final String procedureComment = procedureMeta.getProcedureComment();
if (Srl.is_NotNull_and_NotTrimmedEmpty(procedureComment)) {
procedureElement.setAttribute("comment", procedureComment);
}
procedureGroupElement.appendChild(procedureElement);
}
Aggregations