Enum Class HibernateVersion

java.lang.Object
java.lang.Enum<HibernateVersion>
io.hypersistence.optimizer.hibernate.HibernateVersion
All Implemented Interfaces:
Serializable, Comparable<HibernateVersion>, Constable

public enum HibernateVersion extends Enum<HibernateVersion>
The HibernateVersion enum specifies all the supported Hibernate ORM project versions.
Since:
1.0.0
Author:
Vlad Mihalcea
  • Enum Constant Details

  • Method Details

    • values

      public static HibernateVersion[] values()
      Returns an array containing the constants of this enum class, in the order they are declared.
      Returns:
      an array containing the constants of this enum class, in the order they are declared
    • valueOf

      public static HibernateVersion valueOf(String name)
      Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)
      Parameters:
      name - the name of the enum constant to be returned.
      Returns:
      the enum constant with the specified name
      Throws:
      IllegalArgumentException - if this enum class has no constant with the specified name
      NullPointerException - if the argument is null
    • matches

      public abstract boolean matches()
      Determines if the current Hibernate version matches the provided enum value.
      Returns:
      if the current Hibernate version matches the provided enum value
    • getMajorMinorVersion

      public int getMajorMinorVersion()
      Get the associated major and minor Hibernate ORM version.
      Returns:
      the associated major and minor Hibernate ORM version
    • getCurrentVersion

      public static HibernateVersion getCurrentVersion()
      Get the current Hibernate ORM version, as it was detected based on the classes found on the Java classpath.
      Returns:
      the current Hibernate ORM version
    • isCurrentVersionAtLeast

      public static boolean isCurrentVersionAtLeast(HibernateVersion hibernateVersion)
      Check if the current Hibernate version is greater than or equals to the provided version.
      Parameters:
      hibernateVersion - Hibernate version to use as reference
      Returns:
      the current Hibernate version is greater than or equals to the provided version
    • toString

      public String toString()
      Overrides:
      toString in class Enum<HibernateVersion>