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:
DialectResolutionInfo
-
-
Field Summary
Fields Modifier and Type Field Description static int
NO_VERSION
Constant used to indicate that no version is defined
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description int
getDatabaseMajorVersion()
Obtain access to the database major version, as returned fromDatabaseMetaData.getDatabaseMajorVersion()
for the target database.default int
getDatabaseMicroVersion()
Obtain access to the database minor version, as returned fromDatabaseMetaData.getDatabaseMinorVersion()
for the target database.int
getDatabaseMinorVersion()
Obtain access to the database minor version, as returned fromDatabaseMetaData.getDatabaseMinorVersion()
for the target database.default int
getMajor()
Simpler namingdefault int
getMicro()
Simpler namingdefault int
getMinor()
Simpler namingdefault boolean
isAfter(int major)
Determine whether this version after the passed onedefault boolean
isAfter(int major, int minor)
Determine whether this version after the passed onedefault boolean
isAfter(int otherMajor, int otherMinor, int otherMicro)
Determine whether this version after the passed onedefault boolean
isAfter(Integer major, Integer minor)
Determine whether this version after the passed onedefault boolean
isAfter(DatabaseVersion other)
Determine whether this version comes after the passed onedefault boolean
isBefore(int major)
Determine whether this version before the passed onedefault boolean
isBefore(int major, int minor)
Determine whether this version before the passed onedefault boolean
isBefore(int otherMajor, int otherMinor, int otherMicro)
Determine whether this version before the passed onedefault boolean
isBefore(Integer major, Integer minor)
Determine whether this version before the passed onedefault boolean
isBefore(DatabaseVersion other)
Determine whether this version comes before the passed onedefault boolean
isSame(int otherMajor)
Determine if this version matches the passed one.default boolean
isSame(int otherMajor, int otherMinor)
Determine if this version matches the passed one.default boolean
isSame(int otherMajor, int otherMinor, int otherMicro)
Determine if this version matches the passed one.default boolean
isSame(DatabaseVersion other)
Determine if the versions are the same/equal.default boolean
isSameOrAfter(int otherMajor)
default boolean
isSameOrAfter(int otherMajor, int otherMinor)
default boolean
isSameOrAfter(int otherMajor, int otherMinor, int otherMicro)
default boolean
isSameOrAfter(Integer otherMajor, Integer otherMinor)
default boolean
isSameOrAfter(DatabaseVersion other)
static DatabaseVersion
make(Integer major)
Factory for DatabaseVersion based on major version (minor and micro set to zero)static DatabaseVersion
make(Integer major, Integer minor)
Factory for DatabaseVersion based on major and minor version (micro set to zero)static DatabaseVersion
make(Integer major, Integer minor, Integer micro)
Factory for DatabaseVersion based on major, minor and microdefault DatabaseVersion
makeCopy()
Make a simple copy of this version objectdefault DatabaseVersion
makeCopy(boolean noVersionAsZero)
Make a copy of this version object, possibly convertingNO_VERSION
to zero
-
-
-
Field Detail
-
NO_VERSION
static final int NO_VERSION
Constant used to indicate that no version is defined- See Also:
- Constant Field Values
-
-
Method Detail
-
make
static DatabaseVersion make(Integer major)
Factory for DatabaseVersion based on major version (minor and micro set to zero)
-
make
static DatabaseVersion make(Integer major, Integer minor)
Factory for DatabaseVersion based on major and minor version (micro set to zero)
-
make
static DatabaseVersion make(Integer major, Integer minor, Integer micro)
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:
DatabaseMetaData.getDatabaseMajorVersion()
-
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:
DatabaseMetaData.getDatabaseMinorVersion()
-
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:
DatabaseMetaData.getDatabaseMinorVersion()
-
getMajor
default int getMajor()
Simpler naming- See Also:
getDatabaseMajorVersion()
-
getMinor
default int getMinor()
Simpler naming- See Also:
getDatabaseMinorVersion()
-
getMicro
default int getMicro()
Simpler naming- See Also:
getDatabaseMicroVersion()
-
makeCopy
default DatabaseVersion makeCopy()
Make a simple copy of this version object
-
makeCopy
default DatabaseVersion makeCopy(boolean noVersionAsZero)
Make a copy of this version object, possibly convertingNO_VERSION
to zero
-
isSame
default boolean isSame(DatabaseVersion other)
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
default boolean isSameOrAfter(DatabaseVersion other)
-
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
default boolean isAfter(DatabaseVersion other)
Determine whether this version comes after the passed one
-
isAfter
default boolean isAfter(Integer major, Integer minor)
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
default boolean isBefore(DatabaseVersion other)
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
default boolean isBefore(Integer major, Integer minor)
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
-
-