Package org.hibernate.dialect
Interface DatabaseVersion
- All Known Subinterfaces:
DialectResolutionInfo
- All Known Implementing Classes:
DatabaseMetaDataDialectResolutionInfoAdapter,SimpleDatabaseVersion
public interface DatabaseVersion
Details about the underlying database, as understood by a Dialect.
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intConstant used to indicate that no version is defined -
Method Summary
Modifier and TypeMethodDescriptionintObtain access to the database major version, as returned fromDatabaseMetaData.getDatabaseMajorVersion()for the target database.default intObtain access to the database minor version, as returned fromDatabaseMetaData.getDatabaseMinorVersion()for the target database.intObtain access to the database minor version, as returned fromDatabaseMetaData.getDatabaseMinorVersion()for the target database.default intgetMajor()Simpler namingdefault intgetMicro()Simpler namingdefault intgetMinor()Simpler namingdefault booleanisAfter(int major) Determine whether this version after the passed onedefault booleanisAfter(int major, int minor) Determine whether this version after the passed onedefault booleanisAfter(int otherMajor, int otherMinor, int otherMicro) Determine whether this version after the passed onedefault booleanDetermine whether this version after the passed onedefault booleanisAfter(DatabaseVersion other) Determine whether this version comes after the passed onedefault booleanisBefore(int major) Determine whether this version before the passed onedefault booleanisBefore(int major, int minor) Determine whether this version before the passed onedefault booleanisBefore(int otherMajor, int otherMinor, int otherMicro) Determine whether this version before the passed onedefault booleanDetermine whether this version before the passed onedefault booleanisBefore(DatabaseVersion other) Determine whether this version comes before the passed onedefault booleanisSame(int otherMajor) Determine if this version matches the passed one.default booleanisSame(int otherMajor, int otherMinor) Determine if this version matches the passed one.default booleanisSame(int otherMajor, int otherMinor, int otherMicro) Determine if this version matches the passed one.default booleanisSame(DatabaseVersion other) Determine if the versions are the same/equal.default booleanisSameOrAfter(int otherMajor) default booleanisSameOrAfter(int otherMajor, int otherMinor) default booleanisSameOrAfter(int otherMajor, int otherMinor, int otherMicro) default booleanisSameOrAfter(Integer otherMajor, Integer otherMinor) default booleanisSameOrAfter(DatabaseVersion other) static DatabaseVersionFactory for DatabaseVersion based on major version (minor and micro set to zero)static DatabaseVersionFactory for DatabaseVersion based on major and minor version (micro set to zero)static DatabaseVersionFactory for DatabaseVersion based on major, minor and microdefault DatabaseVersionmakeCopy()Deprecated.default DatabaseVersionmakeCopy(boolean noVersionAsZero) Deprecated.In dialect implementations, prefermakeCopyOrDefault(DatabaseVersion)to gracefully default to the minimum supported version.default DatabaseVersionmakeCopyOrDefault(DatabaseVersion defaultVersion) Make a simple copy of this version object, unless this version object hasno version information, in which case just return the givendefaultVersion.
-
Field Details
-
NO_VERSION
static final int NO_VERSIONConstant used to indicate that no version is defined- See Also:
-
-
Method Details
-
make
Factory for DatabaseVersion based on major version (minor and micro set to zero) -
make
Factory for DatabaseVersion based on major and minor version (micro set to zero) -
make
Factory for DatabaseVersion based on major, minor and micro -
getDatabaseMajorVersion
int getDatabaseMajorVersion()Obtain access to the database major version, as returned fromDatabaseMetaData.getDatabaseMajorVersion()for the target database.- Returns:
- The database major version, or -9999 to indicate "no version information"
- See Also:
-
getDatabaseMinorVersion
int getDatabaseMinorVersion()Obtain access to the database minor version, as returned fromDatabaseMetaData.getDatabaseMinorVersion()for the target database.- Returns:
- The database minor version, or -9999 to indicate "no version information"
- See Also:
-
getDatabaseMicroVersion
default int getDatabaseMicroVersion()Obtain access to the database minor version, as returned fromDatabaseMetaData.getDatabaseMinorVersion()for the target database.- Returns:
- The database minor version, or -9999 to indicate "no version information"
- See Also:
-
getMajor
default int getMajor()Simpler naming- See Also:
-
getMinor
default int getMinor()Simpler naming- See Also:
-
getMicro
default int getMicro()Simpler naming- See Also:
-
makeCopyOrDefault
Make a simple copy of this version object, unless this version object hasno version information, in which case just return the givendefaultVersion.- Parameters:
defaultVersion- The default version, to be returned if this version object hasno version information.- Returns:
- The copy, or
defaultVersion.
-
makeCopy
Deprecated.In dialect implementations, prefermakeCopyOrDefault(DatabaseVersion)to gracefully default to the minimum supported version.Make a simple copy of this version object -
makeCopy
Deprecated.In dialect implementations, prefermakeCopyOrDefault(DatabaseVersion)to gracefully default to the minimum supported version.Make a copy of this version object, possibly convertingNO_VERSIONto zero -
isSame
Determine if the versions are the same/equal. -
isSame
default boolean isSame(int otherMajor) Determine if this version matches the passed one. -
isSame
default boolean isSame(int otherMajor, int otherMinor) Determine if this version matches the passed one. -
isSame
default boolean isSame(int otherMajor, int otherMinor, int otherMicro) Determine if this version matches the passed one. -
isSameOrAfter
-
isSameOrAfter
-
isSameOrAfter
default boolean isSameOrAfter(int otherMajor) -
isSameOrAfter
default boolean isSameOrAfter(int otherMajor, int otherMinor) -
isSameOrAfter
default boolean isSameOrAfter(int otherMajor, int otherMinor, int otherMicro) -
isAfter
Determine whether this version comes after the passed one -
isAfter
Determine whether this version after the passed one -
isAfter
default boolean isAfter(int major) Determine whether this version after the passed one -
isAfter
default boolean isAfter(int major, int minor) Determine whether this version after the passed one -
isAfter
default boolean isAfter(int otherMajor, int otherMinor, int otherMicro) Determine whether this version after the passed one -
isBefore
Determine whether this version comes before the passed one -
isBefore
default boolean isBefore(int major, int minor) Determine whether this version before the passed one -
isBefore
default boolean isBefore(int major) Determine whether this version before the passed one -
isBefore
Determine whether this version before the passed one -
isBefore
default boolean isBefore(int otherMajor, int otherMinor, int otherMicro) Determine whether this version before the passed one
-
makeCopyOrDefault(DatabaseVersion)to gracefully default to the minimum supported version.