Class HibernateUtils


  • public class HibernateUtils
    extends Object
    Utility class for dealing with Hibernate objects
    Author:
    XIMA MEDIA GmbH
    • Method Detail

      • unproxyList

        public static final <T> List<T> unproxyList​(List<T> objects,
                                                    Class<T> clazz)
        Unproxies any of the given objects that are HibernateProxys and returns all objects
        Type Parameters:
        T - type of the objects
        Parameters:
        objects - to unproxy
        clazz - of the objects
        Returns:
        List of all the objects with all the objects unproxied
      • unproxySet

        public static final <T> Set<T> unproxySet​(Set<T> objects,
                                                  Class<T> clazz)
      • unproxyObject

        public static final <T> T unproxyObject​(T object,
                                                Class<T> clazz)
        Unproxies the object if it is a HibernateProxy and returns the unproxied object
        Type Parameters:
        T - type of the objects
        Parameters:
        object - to unproxy
        clazz - of the object
        Returns:
        unproxied value or the original if the object is no HibernateProxy
      • initialize

        public static final <T> void initialize​(List<T> objects,
                                                Class<T> clazz)
      • initialize

        public static final <T> void initialize​(T object,
                                                Class<T> clazz)
      • initialize

        public static final void initialize​(Object proxy)