Package ome.tools.hibernate
Class HibernateUtils
- java.lang.Object
-
- ome.tools.hibernate.HibernateUtils
-
public abstract class HibernateUtils extends java.lang.Object
contains methods for reloadingunloaded
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 userstatic 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 thegroup
of this entity, or null if: (1) the object is null, (2) theDetails
is null, (3) the group is null.static java.lang.Long
nullSafeOwnerId(ome.model.IObject iobject)
returns the id of theowner
of this entity, or null if: (1) the object is null, (2) theDetails
is null, (3) the owner is null.static boolean
onlyPermissionsChanged(ome.model.internal.Details new_d, ome.model.internal.Details old_d)
-
-
-
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 theowner
of this entity, or null if: (1) the object is null, (2) theDetails
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 thegroup
of this entity, or null if: (1) the object is null, (2) theDetails
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 detailsold_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)
-
-