Class HibernateUtils


  • public abstract class HibernateUtils
    extends java.lang.Object
    contains methods for reloading unloaded entities and nulled collections as well as determining the index of certain properties in a dehydrated Hibernate array.
    Since:
    3.0-M3
    See Also:
    wiki:ObjectModel
    • Constructor Summary

      Constructors 
      Constructor Description
      HibernateUtils()  
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      protected static java.util.Collection copy​(java.util.Collection c)  
      protected static java.util.Map copy​(java.util.Map m)  
      static int detailsIndex​(java.lang.String[] propertyNames)  
      static void fixNulledOrFilteredCollections​(ome.model.IObject entity, ome.model.IObject target, org.hibernate.persister.entity.EntityPersister persister, org.hibernate.engine.SessionImplementor source)
      loads collections which have been filtered or nulled by the user
      static ome.model.internal.Details getDetails​(java.lang.Object[] state, java.lang.String[] names)  
      static boolean idEqual​(ome.model.IObject arg1, ome.model.IObject arg2)
      returns true under the following circumstances: both arguments are null, or both arguments are identical (==), or both arguments have the same id value(equals)
      static int index​(java.lang.String str, java.lang.String[] propertyNames)  
      static boolean isUnloaded​(java.lang.Object original)  
      static java.lang.Long nullSafeGroupId​(ome.model.IObject iobject)
      returns the id of the group of this entity, or null if: (1) the object is null, (2) the Details is null, (3) the group is null.
      static java.lang.Long nullSafeOwnerId​(ome.model.IObject iobject)
      returns the id of the owner of this entity, or null if: (1) the object is null, (2) the Details is null, (3) the owner is null.
      static boolean onlyPermissionsChanged​(ome.model.internal.Details new_d, ome.model.internal.Details old_d)  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • HibernateUtils

        public HibernateUtils()
    • Method Detail

      • isUnloaded

        public static boolean isUnloaded​(java.lang.Object original)
      • nullSafeOwnerId

        public static java.lang.Long nullSafeOwnerId​(ome.model.IObject iobject)
        returns the id of the owner of this entity, or null if: (1) the object is null, (2) the Details is null, (3) the owner is null.
        Parameters:
        iobject - Can be null.
        Returns:
        the id or null.
      • nullSafeGroupId

        public static java.lang.Long nullSafeGroupId​(ome.model.IObject iobject)
        returns the id of the group of this entity, or null if: (1) the object is null, (2) the Details is null, (3) the group is null.
        Parameters:
        iobject - Can be null.
        Returns:
        the id or null.
      • fixNulledOrFilteredCollections

        public static void fixNulledOrFilteredCollections​(ome.model.IObject entity,
                                                          ome.model.IObject target,
                                                          org.hibernate.persister.entity.EntityPersister persister,
                                                          org.hibernate.engine.SessionImplementor source)
        loads collections which have been filtered or nulled by the user
      • onlyPermissionsChanged

        public static boolean onlyPermissionsChanged​(ome.model.internal.Details new_d,
                                                     ome.model.internal.Details old_d)
        Parameters:
        new_d - the new details
        old_d - the old details
        Returns:
        if the non-permissions fields are the same
      • idEqual

        public static boolean idEqual​(ome.model.IObject arg1,
                                      ome.model.IObject arg2)
        returns true under the following circumstances:
        • both arguments are null, or
        • both arguments are identical (==), or
        • both arguments have the same id value(equals)
      • getDetails

        public static ome.model.internal.Details getDetails​(java.lang.Object[] state,
                                                            java.lang.String[] names)
      • detailsIndex

        public static int detailsIndex​(java.lang.String[] propertyNames)
      • index

        public static int index​(java.lang.String str,
                                java.lang.String[] propertyNames)
      • copy

        protected static java.util.Map copy​(java.util.Map m)
      • copy

        protected static java.util.Collection copy​(java.util.Collection c)