Class LegacySchemaValidator

java.lang.Object
persist.lint.legacy.LegacySchemaValidator
All Implemented Interfaces:
PersistenceLinter, SchemaValidator

public class LegacySchemaValidator extends Object implements SchemaValidator
SchemaValidator implementation for the legacy javax.persistence namespace ("javax").

Uses Hibernate 5 to build the entity metamodel from the discovered annotated classes and validates it against the live database schema reachable through the supplied JDBC connection properties.

Since:
2.1.0
See Also:
  • Method Details

    • of

      public static LegacySchemaValidator of(List<String> discoveredClasses)
      Creates a new LegacySchemaValidator for the given entity class names.
      Parameters:
      discoveredClasses - fully qualified class names of the JPA entities to register in the metamodel
      Returns:
      a new schema validator instance
    • validateSchema

      public void validateSchema(Map<String,String> connectionProperties)
      Validates the persistence schema against the database described by the given connection properties.

      The map is expected to contain at least the keys "driver", "url", "username", and "password".

      Specified by:
      validateSchema in interface SchemaValidator
      Parameters:
      connectionProperties - JDBC connection properties used to reach the target database