Package org.hibernate.jpa

Examples of org.hibernate.jpa.SchemaGenAction


     * @param hibernateConfiguration
     */
    public void execute(Configuration hibernateConfiguration) {
      // First, determine the actions (if any) to be performed ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

      final SchemaGenAction databaseAction = SchemaGenAction.interpret(
          hibernateConfiguration.getProperty( AvailableSettings.SCHEMA_GEN_DATABASE_ACTION )
      );
      final SchemaGenAction scriptsAction = SchemaGenAction.interpret(
          hibernateConfiguration.getProperty( AvailableSettings.SCHEMA_GEN_SCRIPTS_ACTION )
      );

      if ( databaseAction == SchemaGenAction.NONE && scriptsAction == SchemaGenAction.NONE ) {
        // no actions needed
        return;
      }


      // Figure out the JDBC Connection context, if any ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

      final JdbcConnectionContext jdbcConnectionContext = determineAppropriateJdbcConnectionContext(
          hibernateConfiguration,
          serviceRegistry
      );

      try {
        final Dialect dialect = determineDialect( jdbcConnectionContext, hibernateConfiguration, serviceRegistry );


        // determine sources ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

        final List<GenerationSource> createSourceList = databaseAction.includesCreate() || scriptsAction.includesCreate()
            ? buildCreateSourceList( hibernateConfiguration, dialect )
            : Collections.<GenerationSource>emptyList();

        final List<GenerationSource> dropSourceList = databaseAction.includesDrop() || scriptsAction.includesDrop()
            ? buildDropSourceList( hibernateConfiguration, dialect )
            : Collections.<GenerationSource>emptyList();


        // determine targets ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

        final GenerationTarget databaseTarget = new GenerationTargetToDatabase( jdbcConnectionContext, databaseAction );

        final Object createScriptTargetSetting = hibernateConfiguration.getProperties().get(
            AvailableSettings.SCHEMA_GEN_SCRIPTS_CREATE_TARGET
        );
        final Object dropScriptTargetSetting = hibernateConfiguration.getProperties().get(
            AvailableSettings.SCHEMA_GEN_SCRIPTS_DROP_TARGET
        );
        final GenerationTarget scriptsTarget = new GenerationTargetToScript(
            interpretScriptTargetSetting(
                createScriptTargetSetting,
                scriptsAction.includesCreate(),
                AvailableSettings.SCHEMA_GEN_SCRIPTS_CREATE_TARGET
            ),
            interpretScriptTargetSetting(
                dropScriptTargetSetting,
                scriptsAction.includesDrop(),
                AvailableSettings.SCHEMA_GEN_SCRIPTS_DROP_TARGET
            ),
            scriptsAction
        );

View Full Code Here


     * @param hibernateConfiguration The hibernate configuration
     */
    public void execute(Configuration hibernateConfiguration) {
      // First, determine the actions (if any) to be performed ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

      final SchemaGenAction databaseAction = SchemaGenAction.interpret(
          hibernateConfiguration.getProperty( AvailableSettings.SCHEMA_GEN_DATABASE_ACTION )
      );
      final SchemaGenAction scriptsAction = SchemaGenAction.interpret(
          hibernateConfiguration.getProperty( AvailableSettings.SCHEMA_GEN_SCRIPTS_ACTION )
      );

      if ( databaseAction == SchemaGenAction.NONE && scriptsAction == SchemaGenAction.NONE ) {
        // no actions needed
        log.debug( "No actions specified; doing nothing" );
        return;
      }


      // Figure out the JDBC Connection context, if any ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

      final JdbcConnectionContext jdbcConnectionContext = determineAppropriateJdbcConnectionContext(
          hibernateConfiguration,
          serviceRegistry
      );

      try {
        final Dialect dialect = determineDialect( jdbcConnectionContext, hibernateConfiguration, serviceRegistry );


        // determine sources ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

        final List<GenerationSource> createSourceList = databaseAction.includesCreate() || scriptsAction.includesCreate()
            ? buildCreateSourceList( hibernateConfiguration, dialect )
            : Collections.<GenerationSource>emptyList();

        final List<GenerationSource> dropSourceList = databaseAction.includesDrop() || scriptsAction.includesDrop()
            ? buildDropSourceList( hibernateConfiguration, dialect )
            : Collections.<GenerationSource>emptyList();


        // determine targets ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

        final GenerationTarget databaseTarget = new GenerationTargetToDatabase( jdbcConnectionContext, databaseAction );

        final Object createScriptTargetSetting = hibernateConfiguration.getProperties().get(
            AvailableSettings.SCHEMA_GEN_SCRIPTS_CREATE_TARGET
        );
        final Object dropScriptTargetSetting = hibernateConfiguration.getProperties().get(
            AvailableSettings.SCHEMA_GEN_SCRIPTS_DROP_TARGET
        );
        final GenerationTarget scriptsTarget = new GenerationTargetToScript(
            interpretScriptTargetSetting(
                createScriptTargetSetting,
                scriptsAction.includesCreate(),
                AvailableSettings.SCHEMA_GEN_SCRIPTS_CREATE_TARGET
            ),
            interpretScriptTargetSetting(
                dropScriptTargetSetting,
                scriptsAction.includesDrop(),
                AvailableSettings.SCHEMA_GEN_SCRIPTS_DROP_TARGET
            ),
            scriptsAction
        );

View Full Code Here

  public static void performGeneration(Configuration hibernateConfiguration, ServiceRegistry serviceRegistry) {

    // First, determine the actions (if any) to be performed ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

    final SchemaGenAction databaseAction = SchemaGenAction.interpret(
        hibernateConfiguration.getProperty( AvailableSettings.SCHEMA_GEN_DATABASE_ACTION )
    );
    final SchemaGenAction scriptsAction = SchemaGenAction.interpret(
        hibernateConfiguration.getProperty( AvailableSettings.SCHEMA_GEN_SCRIPTS_ACTION )
    );

    if ( databaseAction == SchemaGenAction.NONE && scriptsAction == SchemaGenAction.NONE ) {
      // no actions needed
      return;
    }


    // Figure out the JDBC Connection context, if any ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

    final JdbcConnectionContext jdbcConnectionContext = determineAppropriateJdbcConnectionContext(
        hibernateConfiguration,
        serviceRegistry
    );

    try {
      final Dialect dialect = determineDialect( jdbcConnectionContext, hibernateConfiguration, serviceRegistry );


      // determine sources ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

      final List<GenerationSource> createSourceList = databaseAction.includesCreate() || scriptsAction.includesCreate()
          ? buildCreateSourceList( hibernateConfiguration, serviceRegistry, dialect )
          : Collections.<GenerationSource>emptyList();

      final List<GenerationSource> dropSourceList = databaseAction.includesDrop() || scriptsAction.includesDrop()
          ? buildDropSourceList( hibernateConfiguration, serviceRegistry, dialect )
          : Collections.<GenerationSource>emptyList();


      // determine targets ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
View Full Code Here

  public static void performGeneration(Configuration hibernateConfiguration, ServiceRegistry serviceRegistry) {

    // First, determine the actions (if any) to be performed ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

    final SchemaGenAction databaseAction = SchemaGenAction.interpret(
        hibernateConfiguration.getProperty( AvailableSettings.SCHEMA_GEN_DATABASE_ACTION )
    );
    final SchemaGenAction scriptsAction = SchemaGenAction.interpret(
        hibernateConfiguration.getProperty( AvailableSettings.SCHEMA_GEN_SCRIPTS_ACTION )
    );

    if ( databaseAction == SchemaGenAction.NONE && scriptsAction == SchemaGenAction.NONE ) {
      // no actions needed
      return;
    }


    // Figure out the JDBC Connection context, if any ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

    final JdbcConnectionContext jdbcConnectionContext = determineAppropriateJdbcConnectionContext(
        hibernateConfiguration,
        serviceRegistry
    );

    try {
      final Dialect dialect = determineDialect( jdbcConnectionContext, hibernateConfiguration, serviceRegistry );


      // determine sources ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

      final List<GenerationSource> createSourceList = databaseAction.includesCreate() || scriptsAction.includesCreate()
          ? buildCreateSourceList( hibernateConfiguration, serviceRegistry, dialect )
          : Collections.<GenerationSource>emptyList();

      final List<GenerationSource> dropSourceList = databaseAction.includesDrop() || scriptsAction.includesDrop()
          ? buildDropSourceList( hibernateConfiguration, serviceRegistry, dialect )
          : Collections.<GenerationSource>emptyList();


      // determine targets ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
View Full Code Here

     * @param hibernateConfiguration
     */
    public void execute(Configuration hibernateConfiguration) {
      // First, determine the actions (if any) to be performed ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

      final SchemaGenAction databaseAction = SchemaGenAction.interpret(
          hibernateConfiguration.getProperty( AvailableSettings.SCHEMA_GEN_DATABASE_ACTION )
      );
      final SchemaGenAction scriptsAction = SchemaGenAction.interpret(
          hibernateConfiguration.getProperty( AvailableSettings.SCHEMA_GEN_SCRIPTS_ACTION )
      );

      if ( databaseAction == SchemaGenAction.NONE && scriptsAction == SchemaGenAction.NONE ) {
        // no actions needed
        log.debug( "No actions specified; doing nothing" );
        return;
      }


      // Figure out the JDBC Connection context, if any ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

      final JdbcConnectionContext jdbcConnectionContext = determineAppropriateJdbcConnectionContext(
          hibernateConfiguration,
          serviceRegistry
      );

      try {
        final Dialect dialect = determineDialect( jdbcConnectionContext, hibernateConfiguration, serviceRegistry );


        // determine sources ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

        final List<GenerationSource> createSourceList = databaseAction.includesCreate() || scriptsAction.includesCreate()
            ? buildCreateSourceList( hibernateConfiguration, dialect )
            : Collections.<GenerationSource>emptyList();

        final List<GenerationSource> dropSourceList = databaseAction.includesDrop() || scriptsAction.includesDrop()
            ? buildDropSourceList( hibernateConfiguration, dialect )
            : Collections.<GenerationSource>emptyList();


        // determine targets ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

        final GenerationTarget databaseTarget = new GenerationTargetToDatabase( jdbcConnectionContext, databaseAction );

        final Object createScriptTargetSetting = hibernateConfiguration.getProperties().get(
            AvailableSettings.SCHEMA_GEN_SCRIPTS_CREATE_TARGET
        );
        final Object dropScriptTargetSetting = hibernateConfiguration.getProperties().get(
            AvailableSettings.SCHEMA_GEN_SCRIPTS_DROP_TARGET
        );
        final GenerationTarget scriptsTarget = new GenerationTargetToScript(
            interpretScriptTargetSetting(
                createScriptTargetSetting,
                scriptsAction.includesCreate(),
                AvailableSettings.SCHEMA_GEN_SCRIPTS_CREATE_TARGET
            ),
            interpretScriptTargetSetting(
                dropScriptTargetSetting,
                scriptsAction.includesDrop(),
                AvailableSettings.SCHEMA_GEN_SCRIPTS_DROP_TARGET
            ),
            scriptsAction
        );

View Full Code Here

     * @param hibernateConfiguration The hibernate configuration
     */
    public void execute(Configuration hibernateConfiguration) {
      // First, determine the actions (if any) to be performed ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

      final SchemaGenAction databaseAction = SchemaGenAction.interpret(
          hibernateConfiguration.getProperty( AvailableSettings.SCHEMA_GEN_DATABASE_ACTION )
      );
      final SchemaGenAction scriptsAction = SchemaGenAction.interpret(
          hibernateConfiguration.getProperty( AvailableSettings.SCHEMA_GEN_SCRIPTS_ACTION )
      );

      if ( databaseAction == SchemaGenAction.NONE && scriptsAction == SchemaGenAction.NONE ) {
        // no actions needed
        log.debug( "No actions specified; doing nothing" );
        return;
      }


      // Figure out the JDBC Connection context, if any ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

      final JdbcConnectionContext jdbcConnectionContext = determineAppropriateJdbcConnectionContext(
          hibernateConfiguration,
          serviceRegistry
      );

      try {
        final Dialect dialect = determineDialect( jdbcConnectionContext, hibernateConfiguration, serviceRegistry );


        // determine sources ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

        final List<GenerationSource> createSourceList = databaseAction.includesCreate() || scriptsAction.includesCreate()
            ? buildCreateSourceList( hibernateConfiguration, dialect )
            : Collections.<GenerationSource>emptyList();

        final List<GenerationSource> dropSourceList = databaseAction.includesDrop() || scriptsAction.includesDrop()
            ? buildDropSourceList( hibernateConfiguration, dialect )
            : Collections.<GenerationSource>emptyList();


        // determine targets ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

        final GenerationTarget databaseTarget = new GenerationTargetToDatabase( jdbcConnectionContext, databaseAction );

        final Object createScriptTargetSetting = hibernateConfiguration.getProperties().get(
            AvailableSettings.SCHEMA_GEN_SCRIPTS_CREATE_TARGET
        );
        final Object dropScriptTargetSetting = hibernateConfiguration.getProperties().get(
            AvailableSettings.SCHEMA_GEN_SCRIPTS_DROP_TARGET
        );
        final GenerationTarget scriptsTarget = new GenerationTargetToScript(
            interpretScriptTargetSetting(
                createScriptTargetSetting,
                scriptsAction.includesCreate(),
                AvailableSettings.SCHEMA_GEN_SCRIPTS_CREATE_TARGET
            ),
            interpretScriptTargetSetting(
                dropScriptTargetSetting,
                scriptsAction.includesDrop(),
                AvailableSettings.SCHEMA_GEN_SCRIPTS_DROP_TARGET
            ),
            scriptsAction
        );

View Full Code Here

TOP

Related Classes of org.hibernate.jpa.SchemaGenAction

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.