Search in sources :

Example 1 with DfBuildProperties

use of org.dbflute.DfBuildProperties in project dbflute-core by dbflute.

the class TypeMap method setupPropertyNativeMap.

protected static void setupPropertyNativeMap() {
    final DfBuildProperties prop = getProperties();
    _propertyJdbcTypeToJavaNativeMap = prop.getTypeMappingProperties().getJdbcToJavaNativeMap();
    _propertyJavaNativeToFlexNativeMap = prop.getFlexDtoProperties().getJavaToFlexNativeMap();
}
Also used : DfBuildProperties(org.dbflute.DfBuildProperties)

Example 2 with DfBuildProperties

use of org.dbflute.DfBuildProperties in project dbflute-core by dbflute.

the class DfSchemaXmlSerializer method createAsCore.

/**
 * Create instance as core process (that is JDBC task).
 * @param dataSource The data source of the database. (NotNull)
 * @return The new instance. (NotNull)
 */
public static DfSchemaXmlSerializer createAsCore(DfSchemaSource dataSource) {
    final DfBuildProperties buildProp = DfBuildProperties.getInstance();
    final DfBasicProperties basicProp = buildProp.getBasicProperties();
    final DfSchemaXmlFacadeProp facadeProp = basicProp.getSchemaXmlFacadeProp();
    final String schemaXml = facadeProp.getProejctSchemaXMLFile();
    final String historyFile = facadeProp.getProjectSchemaHistoryFile();
    final DfSchemaXmlSerializer serializer = newSerializer(dataSource, schemaXml, historyFile);
    final DfDocumentProperties docProp = buildProp.getDocumentProperties();
    final String craftMetaDir = docProp.getCoreCraftMetaDir();
    serializer.enableCraftDiff(dataSource, craftMetaDir, DfCraftDiffAssertDirection.ROLLING_NEXT);
    // to avoid getting nonsense differences in JDBC task
    serializer.keepDefinitionOrderAsPrevious();
    return serializer;
}
Also used : DfDocumentProperties(org.dbflute.properties.DfDocumentProperties) DfBasicProperties(org.dbflute.properties.DfBasicProperties) DfSchemaXmlFacadeProp(org.dbflute.properties.facade.DfSchemaXmlFacadeProp) DfBuildProperties(org.dbflute.DfBuildProperties)

Example 3 with DfBuildProperties

use of org.dbflute.DfBuildProperties in project dbflute-core by dbflute.

the class Database method checkProperties.

// ===================================================================================
// Check Properties
// ================
/**
 * Check properties as mutually related validation. <br>
 * This is basically for Generate task. (Not Sql2Entity)
 */
public void checkProperties() {
    final DfBuildProperties prop = getProperties();
    final DfTableListProvider tableListProvider = new DfTableListProvider() {

        public List<Table> provideTableList() {
            return getTableList();
        }
    };
    prop.getCommonColumnProperties().checkDefinition(tableListProvider);
    prop.getOptimisticLockProperties().checkDefinition(tableListProvider);
    final DfTableDeterminer tableDeterminer = new DfTableDeterminer() {

        public boolean hasTable(String tableName) {
            return getTable(tableName) != null;
        }

        public boolean hasTableColumn(String tableName, String columnName) {
            if (!hasTable(tableName)) {
                return false;
            }
            return getTable(tableName).getColumn(columnName) != null;
        }
    };
    // give up because all mark provides complex structure and also for Sql2Entity case
    // so cost-benefit performance is low (to suppress degrading is prior)
    // prop.getClassificationProperties().checkProperties(tableDeterminer);
    prop.getLittleAdjustmentProperties().checkDefinition(tableDeterminer);
    prop.getSequenceIdentityProperties().checkDefinition(tableDeterminer);
    getBasicProperties().checkDirectoryPackage();
}
Also used : DfTableListProvider(org.dbflute.properties.assistant.DfTableListProvider) DfTableDeterminer(org.dbflute.properties.assistant.DfTableDeterminer) DfBuildProperties(org.dbflute.DfBuildProperties)

Aggregations

DfBuildProperties (org.dbflute.DfBuildProperties)3 DfBasicProperties (org.dbflute.properties.DfBasicProperties)1 DfDocumentProperties (org.dbflute.properties.DfDocumentProperties)1 DfTableDeterminer (org.dbflute.properties.assistant.DfTableDeterminer)1 DfTableListProvider (org.dbflute.properties.assistant.DfTableListProvider)1 DfSchemaXmlFacadeProp (org.dbflute.properties.facade.DfSchemaXmlFacadeProp)1