diff --git a/api/src/main/java/jakarta/persistence/PersistenceConfiguration.java b/api/src/main/java/jakarta/persistence/PersistenceConfiguration.java index d24d01f7..6f460b8b 100644 --- a/api/src/main/java/jakarta/persistence/PersistenceConfiguration.java +++ b/api/src/main/java/jakarta/persistence/PersistenceConfiguration.java @@ -11,6 +11,7 @@ */ // Contributors: +// Gavin King - 4.0 // Gavin King - 3.2 package jakarta.persistence; @@ -162,7 +163,28 @@ public class PersistenceConfiguration { public static final String SCHEMAGEN_DROP_TARGET = "jakarta.persistence.schema-generation.drop-target"; /** - * An instance of {@code jakarta.validation.ValidatorFactory}, + * The value returned by {@link java.sql.DatabaseMetaData#getDatabaseProductName()}, + * for use when JDBC metadata is not available. + * @since 4.0 + */ + public static final String DATABASE_PRODUCT_NAME = "jakarta.persistence.database-product-name"; + + /** + * The value returned by {@link java.sql.DatabaseMetaData#getDatabaseMajorVersion()}, + * for use when JDBC metadata is not available. + * @since 4.0 + */ + public static final String DATABASE_MAJOR_VERSION = "jakarta.persistence.database-major-version"; + + /** + * The value returned by {@link java.sql.DatabaseMetaData#getDatabaseMinorVersion()}, + * for use when JDBC metadata is not available. + * @since 4.0 + */ + public static final String DATABASE_MINOR_VERSION = "jakarta.persistence.database-minor-version"; + + /** + * An instance of {@code jakarta.validation.ValidatorFactory}. */ public static final String VALIDATION_FACTORY = "jakarta.persistence.validation.factory"; /** diff --git a/spec/src/main/asciidoc/ch09-container-provider-contracts.adoc b/spec/src/main/asciidoc/ch09-container-provider-contracts.adoc index ff6e95d4..c371bef2 100644 --- a/spec/src/main/asciidoc/ch09-container-provider-contracts.adoc +++ b/spec/src/main/asciidoc/ch09-container-provider-contracts.adoc @@ -709,6 +709,18 @@ for the configuration of the entity manager factory: persistence unit. | `jakarta.persistence.validation.factory` | Instance of `jakarta.validation.ValidatorFactory`. +| `jakarta.persistence.database-product-name` +| The value returned for the target database by the JDBC method +`getDatabaseProductName` of `DatabaseMetaData`, for use in +situations where JDBC metadata is not available. +| `jakarta.persistence.database-major-version` +| The value returned for the target database by the JDBC method +`getDatabaseMajorVersion` of `DatabaseMetaData`, for use in +situations where JDBC metadata is not available. +| `jakarta.persistence.database-minor-version` +| The value returned for the target database by the JDBC method +`getDatabaseMinorVersion` of `DatabaseMetaData`, for use in +situations where JDBC metadata is not available. |=== Any number of vendor-specific properties may