Class HibernateUnwrapper


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

      • HibernateUnwrapper

        public HibernateUnwrapper()
    • Method Detail

      • 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)