use of org.dbflute.helper.jdbc.context.DfSchemaSource in project dbflute-core by dbflute.
the class Table method getSequenceMaximumValue.
public BigDecimal getSequenceMaximumValue() {
if (!isUseSequence()) {
return null;
}
final DfSequenceIdentityProperties prop = getSequenceIdentityProperties();
final DfSchemaSource ds = getDatabase().getDataSource();
BigDecimal value = prop.getSequenceMaximumValueByTableName(ds, getUnifiedSchema(), getTableDbName());
if (value == null) {
final String sequenceName = extractPostgreSQLSerialSequenceName();
if (sequenceName != null && sequenceName.trim().length() > 0) {
value = prop.getSequenceMaximumValueBySequenceName(ds, getUnifiedSchema(), sequenceName);
}
}
return value;
}
use of org.dbflute.helper.jdbc.context.DfSchemaSource in project dbflute-core by dbflute.
the class Table method getSequenceIncrementSize.
public Integer getSequenceIncrementSize() {
if (!isUseSequence()) {
return null;
}
final DfSequenceIdentityProperties prop = getSequenceIdentityProperties();
final DfSchemaSource ds = getDatabase().getDataSource();
Integer size = prop.getSequenceIncrementSizeByTableName(ds, getUnifiedSchema(), getTableDbName());
if (size == null) {
final String sequenceName = extractPostgreSQLSerialSequenceName();
if (sequenceName != null && sequenceName.trim().length() > 0) {
size = prop.getSequenceIncrementSizeBySequenceName(ds, getUnifiedSchema(), sequenceName);
}
}
return size;
}
use of org.dbflute.helper.jdbc.context.DfSchemaSource in project dbflute-core by dbflute.
the class DfSchemaSyncChecker method createTargetSerializer.
// ===================================================================================
// Serializer
// ==========
protected DfSchemaXmlSerializer createTargetSerializer(DataSource targetDs) {
// as previous
final UnifiedSchema targetSchema = getDocumentProperties().getSchemaSyncCheckDatabaseSchema();
_log.info("schema: " + targetSchema);
// to make only schemaXml as target (previous)
final String historyFile = /*historyFile*/
null;
return doCreateSerializer(new DfSchemaSource(targetDs, targetSchema), historyFile);
}
use of org.dbflute.helper.jdbc.context.DfSchemaSource in project dbflute-core by dbflute.
the class DfTaskControlLogic method getSchemaSource.
/**
* Get schema source for main connection. <br>
* It returns valid data source after setupDataSource() success. <br>
* Basically not null but when data source does not exist on thread, it returns null.
* @return The schema source. (NullAllowed: when data source does not exist on thread, e.g. lazy connection)
*/
protected DfSchemaSource getSchemaSource() {
final DataSource dataSource = DfDataSourceContext.getDataSource();
if (dataSource == null) {
// basically when lazy connection
return null;
}
final UnifiedSchema mainSchema = _databaseResource.getMainSchema();
return new DfSchemaSource(dataSource, mainSchema);
}
use of org.dbflute.helper.jdbc.context.DfSchemaSource in project dbflute-core by dbflute.
the class DfSchemaHtmlProcedure method getAvailableProcedureList.
// ===================================================================================
// Available Procedure
// ===================
public List<DfProcedureMeta> getAvailableProcedureList(Supplier<DfSchemaSource> dataSourceProvider) throws SQLException {
if (_procedureMetaInfoList != null) {
return _procedureMetaInfoList;
}
_log.info(" ");
_log.info("...Setting up procedures for documents");
final DfProcedureExtractor handler = new DfProcedureExtractor();
final DfSchemaSource dataSource = dataSourceProvider.get();
handler.includeProcedureSynonym(dataSource);
handler.includeProcedureToDBLink(dataSource);
if (getDocumentProperties().isShowSchemaHtmlProcedureRegardlessOfGeneration()) {
handler.suppressGenerationRestriction();
}
// ordered by schema
_procedureMetaInfoList = handler.getAvailableProcedureList(dataSource);
return _procedureMetaInfoList;
}
Aggregations