Package org.hibernate.dialect
Interface DatabaseVersion
-
- All Known Subinterfaces:
DialectResolutionInfo
- All Known Implementing Classes:
DatabaseMetaDataDialectResolutionInfoAdapter,SimpleDatabaseVersion
public interface DatabaseVersionDetails about the underlying database, as understood by a Dialect.- See Also:
DialectResolutionInfo
-
-
Field Summary
Fields Modifier and Type Field Description static intNO_VERSIONConstant 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 intgetDatabaseMajorVersion()Obtain access to the database major version, as returned fromDatabaseMetaData.getDatabaseMajorVersion()for the target database.default intgetDatabaseMicroVersion()Obtain access to the database minor version, as returned fromDatabaseMetaData.getDatabaseMinorVersion()for the target database.intgetDatabaseMinorVersion()Obtain 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 booleanisAfter(Integer major, Integer minor)Determine 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 booleanisBefore(Integer major, Integer minor)Determine 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 DatabaseVersionmake(Integer major)Factory for DatabaseVersion based on major version (minor and micro set to zero)static DatabaseVersionmake(Integer major, Integer minor)Factory for DatabaseVersion based on major and minor version (micro set to zero)static DatabaseVersionmake(Integer major, Integer minor, Integer micro)Factory for DatabaseVersion based on major, minor and microdefault DatabaseVersionmakeCopy()Make a simple copy of this version objectdefault DatabaseVersionmakeCopy(boolean noVersionAsZero)Make a copy of this version object, possibly convertingNO_VERSIONto 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_VERSIONto 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
-
-