devonfw / devon4j

devonfw Java stack - create enterprise-grade business apps in Java safe and fast
Apache License 2.0
83 stars 87 forks source link

devon4j migration issues #437

Closed sujithmn closed 2 years ago

sujithmn commented 3 years ago

devon java migrate does the migration job well. But found below 2 issues.

  1. Compilation error from DbTestHelper.

    the issues are due to the below lines of code:

      private MigrationVersion migrationVersion;
      ....

      if (this.migrationVersion != null) {
        this.flyway.setTarget(this.migrationVersion);
      }

      …..

      public void setMigrationVersion(String migrationVersion) {
        this.migrationVersion = MigrationVersion.fromVersion(migrationVersion);
      }
  1. Nullpointer exception from repository.findByCriteria

    addOrderBy(query, alias, criteria.getPageable().getSort());

Change the code as below fixes the issue

    if (criteria.getPageable() == null) {
      criteria.setPageable(PageRequest.of(0, Integer.MAX_VALUE));
    } else {
      addOrderBy(query, alias, criteria.getPageable().getSort());
    }
ssarmokadam commented 2 years ago

It is done by @sujith-mn and PR is merged.