Interface SchemaValidatorFactory

All Superinterfaces:
PersistenceLinterFactory, PersistenceServiceProvider
All Known Implementing Classes:
JakartaSchemaValidatorFactory, LegacySchemaValidatorFactory

public interface SchemaValidatorFactory extends PersistenceLinterFactory
Factory for creating SchemaValidator instances.

Implementations are discovered at runtime through the ServiceLoader mechanism. Each implementation declares the persistence namespace it supports (e.g. "javax" or "jakarta") so that the correct validation strategy can be resolved for the target JPA specification version.

Since:
2.1.0
See Also:
  • Method Details

    • newSchemaValidator

      SchemaValidator newSchemaValidator(List<String> discoveredClassNames)
      Creates a new SchemaValidator configured with the given entity class names.
      Parameters:
      discoveredClassNames - fully qualified class names of the JPA entities to register in the metamodel
      Returns:
      a ready-to-use schema validator
    • newSchemaValidatorFactory

      static SchemaValidatorFactory newSchemaValidatorFactory(String jpaVersion)
      Discovers and returns the SchemaValidatorFactory implementation that matches the given JPA specification version.

      The version string is mapped to a persistence namespace ("javax" for versions 2.0–2.2, "jakarta" for versions 3.0–3.2) and the matching factory is located via the ServiceLoader API.

      Parameters:
      jpaVersion - the JPA specification version (e.g. "2.2" or "3.1")
      Returns:
      the factory implementation for the requested version
      Throws:
      IllegalArgumentException - if the version is not recognized
      IllegalStateException - if no provider is registered for the resolved namespace