Search in sources :

Example 6 with CatalogDefinition

use of org.jooq.meta.CatalogDefinition in project jOOQ by jOOQ.

the class MySQLDatabase method getCatalogs0.

@Override
protected List<CatalogDefinition> getCatalogs0() throws SQLException {
    List<CatalogDefinition> result = new ArrayList<>();
    result.add(new CatalogDefinition(this, "", ""));
    return result;
}
Also used : CatalogDefinition(org.jooq.meta.CatalogDefinition) ArrayList(java.util.ArrayList)

Example 7 with CatalogDefinition

use of org.jooq.meta.CatalogDefinition in project jOOQ by jOOQ.

the class XMLDatabase method getCatalogs0.

@Override
protected List<CatalogDefinition> getCatalogs0() throws SQLException {
    List<CatalogDefinition> result = new ArrayList<>();
    result.add(new CatalogDefinition(this, "", ""));
    return result;
}
Also used : CatalogDefinition(org.jooq.meta.CatalogDefinition) ArrayList(java.util.ArrayList)

Example 8 with CatalogDefinition

use of org.jooq.meta.CatalogDefinition in project jOOQ by jOOQ.

the class JavaGenerator method generate0.

@Override
public final void generate0(Database db) {
    this.isoDate = DatatypeConverter.printDateTime(Calendar.getInstance(TimeZone.getTimeZone("UTC")));
    this.schemaVersions = new LinkedHashMap<>();
    this.catalogVersions = new LinkedHashMap<>();
    this.database.addFilter(new AvoidAmbiguousClassesFilter());
    logDatabaseParameters(db);
    log.info("");
    log.info("JavaGenerator parameters");
    log.info("----------------------------------------------------------");
    log.info("  annotations (generated)", generateGeneratedAnnotation() + ((!generateGeneratedAnnotation && (useSchemaVersionProvider || useCatalogVersionProvider)) ? " (forced to true because of <schemaVersionProvider/> or <catalogVersionProvider/>)" : ""));
    log.info("  annotations (JPA: any)", generateJPAAnnotations());
    log.info("  annotations (JPA: version)", generateJPAVersion());
    log.info("  annotations (validation)", generateValidationAnnotations());
    log.info("  comments", generateComments());
    log.info("  comments on attributes", generateCommentsOnAttributes());
    log.info("  comments on catalogs", generateCommentsOnCatalogs());
    log.info("  comments on columns", generateCommentsOnColumns());
    log.info("  comments on keys", generateCommentsOnKeys());
    log.info("  comments on links", generateCommentsOnLinks());
    log.info("  comments on packages", generateCommentsOnPackages());
    log.info("  comments on parameters", generateCommentsOnParameters());
    log.info("  comments on queues", generateCommentsOnQueues());
    log.info("  comments on routines", generateCommentsOnRoutines());
    log.info("  comments on schemas", generateCommentsOnSchemas());
    log.info("  comments on sequences", generateCommentsOnSequences());
    log.info("  comments on tables", generateCommentsOnTables());
    log.info("  comments on udts", generateCommentsOnUDTs());
    log.info("  sources", generateSources());
    log.info("  sources on views", generateSourcesOnViews());
    log.info("  daos", generateDaos());
    log.info("  deprecated code", generateDeprecated());
    log.info("  global references (any)", generateGlobalObjectReferences());
    log.info("  global references (catalogs)", generateGlobalCatalogReferences());
    log.info("  global references (keys)", generateGlobalKeyReferences());
    log.info("  global references (links)", generateGlobalLinkReferences());
    log.info("  global references (queues)", generateGlobalQueueReferences());
    log.info("  global references (routines)", generateGlobalRoutineReferences());
    log.info("  global references (schemas)", generateGlobalSchemaReferences());
    log.info("  global references (sequences)", generateGlobalSequenceReferences());
    log.info("  global references (tables)", generateGlobalTableReferences());
    log.info("  global references (udts)", generateGlobalUDTReferences());
    log.info("  indexes", generateIndexes());
    log.info("  instance fields", generateInstanceFields());
    log.info("  interfaces", generateInterfaces() + ((!generateInterfaces && generateImmutableInterfaces) ? " (forced to true because of <immutableInterfaces/>)" : ""));
    log.info("  interfaces (immutable)", generateInterfaces());
    log.info("  javadoc", generateJavadoc());
    log.info("  keys", generateKeys());
    log.info("  links", generateLinks());
    log.info("  pojos", generatePojos() + ((!generatePojos && generateDaos) ? " (forced to true because of <daos/>)" : ((!generatePojos && generateImmutablePojos) ? " (forced to true because of <immutablePojos/>)" : "")));
    log.info("  pojos (immutable)", generateImmutablePojos());
    log.info("  queues", generateQueues());
    log.info("  records", generateRecords() + ((!generateRecords && generateDaos) ? " (forced to true because of <daos/>)" : ""));
    log.info("  routines", generateRoutines());
    log.info("  sequences", generateSequences());
    log.info("  sequenceFlags", generateSequenceFlags());
    log.info("  table-valued functions", generateTableValuedFunctions());
    log.info("  tables", generateTables() + ((!generateTables && generateRecords) ? " (forced to true because of <records/>)" : ((!generateTables && generateDaos) ? " (forced to true because of <daos/>)" : ((!generateTables && generateIndexes) ? " (forced to true because of <indexes/>)" : ""))));
    log.info("  udts", generateUDTs());
    log.info("  relations", generateRelations() + ((!generateRelations && generateTables) ? " (forced to true because of <tables/>)" : ((!generateRelations && generateDaos) ? " (forced to true because of <daos/>)" : "")));
    log.info("----------------------------------------------------------");
    if (!generateInstanceFields()) {
        log.warn("");
        log.warn("Deprecation warnings");
        log.warn("----------------------------------------------------------");
        log.warn("  <generateInstanceFields/> = false is deprecated! This feature is no longer maintained and will be removed in jOOQ 4.0. Please adapt your configuration.");
    }
    log.info("");
    logGenerationRemarks(db);
    log.info("");
    log.info("----------------------------------------------------------");
    // ----------------------------------------------------------------------
    // XXX Generating catalogs
    // ----------------------------------------------------------------------
    log.info("Generating catalogs", "Total: " + database.getCatalogs().size());
    StopWatch w = new StopWatch();
    for (CatalogDefinition catalog : database.getCatalogs()) {
        try {
            if (generateCatalogIfEmpty(catalog))
                generate(catalog);
            else
                log.info("Excluding empty catalog", catalog);
        } catch (Exception e) {
            throw new GeneratorException("Error generating code for catalog " + catalog, e);
        }
    }
    long time = w.split();
    // [#10648] Log modified files
    log.info("Affected files: " + affectedFiles.size());
    log.info("Modified files: " + modifiedFiles.size());
    // [#10648] Don't log this info if we're already using schema version providers
    if (modifiedFiles.isEmpty() && catalogVersions.isEmpty() && schemaVersions.isEmpty()) {
        log.info("No modified files", "This code generation run has not produced any file modifications.\n" + "This means, the schema has not changed, and no other parameters (jOOQ version, driver version, database version,\n" + "and any configuration elements) have not changed either.\n\n" + "In automated builds, it is recommended to prevent unnecessary code generation runs. This run took: " + StopWatch.format(time) + "\n" + "Possible means to prevent this:\n" + "- Use manual code generation and check in generated sources: https://www.jooq.org/doc/latest/manual/code-generation/codegen-version-control/\n" + "- Use schema version providers: https://www.jooq.org/doc/latest/manual/code-generation/codegen-advanced/codegen-config-database/codegen-database-version-providers/\n" + "- Use gradle tasks and inputs: https://github.com/etiennestuder/gradle-jooq-plugin/blob/master/README.md");
    }
    // [#5556] Clean up common parent directory
    log.info("Removing excess files");
    empty(getStrategy().getFileRoot(), (scala ? ".scala" : kotlin ? ".kt" : ".java"), affectedFiles, directoriesNotForRemoval);
    directoriesNotForRemoval.clear();
    affectedFiles.clear();
}
Also used : CatalogDefinition(org.jooq.meta.CatalogDefinition) IOException(java.io.IOException) SQLDialectNotSupportedException(org.jooq.exception.SQLDialectNotSupportedException) ReflectException(org.jooq.tools.reflect.ReflectException) StopWatch(org.jooq.tools.StopWatch)

Example 9 with CatalogDefinition

use of org.jooq.meta.CatalogDefinition in project jOOQ by jOOQ.

the class DerbyDatabase method getCatalogs0.

@Override
protected List<CatalogDefinition> getCatalogs0() throws SQLException {
    List<CatalogDefinition> result = new ArrayList<>();
    result.add(new CatalogDefinition(this, "", ""));
    return result;
}
Also used : CatalogDefinition(org.jooq.meta.CatalogDefinition) ArrayList(java.util.ArrayList)

Example 10 with CatalogDefinition

use of org.jooq.meta.CatalogDefinition in project jOOQ by jOOQ.

the class CUBRIDDatabase method getCatalogs0.

@Override
protected List<CatalogDefinition> getCatalogs0() throws SQLException {
    List<CatalogDefinition> result = new ArrayList<>();
    result.add(new CatalogDefinition(this, "", ""));
    return result;
}
Also used : CatalogDefinition(org.jooq.meta.CatalogDefinition) ArrayList(java.util.ArrayList)

Aggregations

CatalogDefinition (org.jooq.meta.CatalogDefinition)13 ArrayList (java.util.ArrayList)9 SchemaDefinition (org.jooq.meta.SchemaDefinition)3 ColumnDefinition (org.jooq.meta.ColumnDefinition)2 TableDefinition (org.jooq.meta.TableDefinition)2 ReflectException (org.jooq.tools.reflect.ReflectException)2 IOException (java.io.IOException)1 StringWriter (java.io.StringWriter)1 BigInteger (java.math.BigInteger)1 SQLDialectNotSupportedException (org.jooq.exception.SQLDialectNotSupportedException)1 AttributeDefinition (org.jooq.meta.AttributeDefinition)1 CheckConstraintDefinition (org.jooq.meta.CheckConstraintDefinition)1 DataTypeDefinition (org.jooq.meta.DataTypeDefinition)1 ForeignKeyDefinition (org.jooq.meta.ForeignKeyDefinition)1 IndexColumnDefinition (org.jooq.meta.IndexColumnDefinition)1 IndexDefinition (org.jooq.meta.IndexDefinition)1 PackageDefinition (org.jooq.meta.PackageDefinition)1 RoutineDefinition (org.jooq.meta.RoutineDefinition)1 SequenceDefinition (org.jooq.meta.SequenceDefinition)1 TypedElementDefinition (org.jooq.meta.TypedElementDefinition)1