Class HibernateUnwrapper

java.lang.Object
com.atlassian.confluence.internal.search.v2.lucene.HibernateUnwrapper

public class HibernateUnwrapper extends Object
Unwraps Hibernate proxies reflectively, without adding a compile-time dependency on Hibernate itself.
Since:
8.0
  • Constructor Details

    • HibernateUnwrapper

      public HibernateUnwrapper()
  • Method Details

    • getUnderlyingClass

      public static Class<?> getUnderlyingClass(Object o)
      Gets the true class of an object, trying to use Hibernate's proxy unwrapping tools if available on the classpath.

      Otherwise simply returns the class of the object passed in if Hibernate not on the classpath.
      Parameters:
      o - The object to examine
      Returns:
      The true class of the object (unwrapping Hibernate proxies etc)