Interface DdlGenerator


  • public interface DdlGenerator
    Interface for the DdlGenerator which generates the SQL DDL files. The GenerateDdlMojo will use the ServiceLoader from the Java Standard API to find the implementation to use. Therefore an implementation of this interface must be accompanied by a file called de.jpdigital.maven.plugins.hibernate5ddl.DdlGenerator in the META-INF/services directory.
    Author:
    Jens Pelzetter
    • Method Detail

      • generateDdl

        void generateDdl​(Dialect dialect,
                         Set<Package> packages,
                         Set<Class<?>> entityClasses,
                         GenerateDdlMojo mojo)
                  throws org.apache.maven.plugin.MojoFailureException
        Generates a SQL DDL file for a specific SQL dialect.
        Parameters:
        dialect - The SQL dialect to use.
        packages - Package with package level Hibernate annotations.
        entityClasses - The entity classes for which SQL DDL statements will be created.
        mojo - The GenerateDdlMojo which calls the method.
        Throws:
        org.apache.maven.plugin.MojoFailureException - If an error occurs while creating the DDL file.
        See Also:
        Dialect
      • generateDdl

        void generateDdl​(String dialect,
                         Set<Package> packages,
                         Set<Class<?>> entityClasses,
                         GenerateDdlMojo mojo)
                  throws org.apache.maven.plugin.MojoFailureException
        Generates a SQL DDL file for a specific SQL dialect.This method accepts a string a is called by GenerateDdlMojo for processing custom dialects.
        Parameters:
        dialect - The SQL dialect to use.
        packages - Package with package level Hibernate annotations.
        entityClasses - The entity classes for which SQL DDL statements will be created.
        mojo - The GenerateDdlMojo which calls the method.
        Throws:
        org.apache.maven.plugin.MojoFailureException - If an error occurs while creating the DDL file.