Class ImplHelper


  • public class ImplHelper
    extends java.lang.Object
    Helper for OpenJPA back-ends.
    Since:
    0.3.0
    Author:
    Abe White
    • Field Detail

      • _unenhancedInstanceMap

        public static final java.util.Map _unenhancedInstanceMap
    • Constructor Detail

      • ImplHelper

        public ImplHelper()
    • Method Detail

      • getUpdateFields

        public static java.util.BitSet getUpdateFields​(OpenJPAStateManager sm)
        Returns the fields of the state that require an update.
        Parameters:
        sm - the state to check
        Returns:
        the BitSet of fields that need update, or null if none
      • close

        public static void close​(java.lang.Object o)
        Close the given resource. The resource can be an extent iterator, query result, large result set relation, or any closeable OpenJPA component.
      • isManagedType

        public static boolean isManagedType​(OpenJPAConfiguration conf,
                                            java.lang.Class type)
        Returns true if the specified class is a type that can be managed by OpenJPA.
        Parameters:
        type - the class to test
        Returns:
        true if the class is manageable.
        Since:
        1.0.0
      • isManageable

        public static boolean isManageable​(java.lang.Object instance)
        Returns true if the specified instance is manageable.
        Parameters:
        instance - the object to check
        Returns:
        true if the instance is a persistent type, false otherwise
      • isAssignable

        public static boolean isAssignable​(java.lang.Class from,
                                           java.lang.Class to)
        Returns true if the referenced "to" class is assignable to the "from" class. This helper method utilizes a cache to help avoid the overhead of the Class.isAssignableFrom() method.
        Parameters:
        from - target class instance to be checked for assignability
        to - second class instance to be checked for assignability
        Returns:
        true if the "to" class is assignable to the "from" class
      • toPersistenceCapable

        public static PersistenceCapable toPersistenceCapable​(java.lang.Object o,
                                                              java.lang.Object ctx)
        Returns:
        the persistence-capable instance responsible for managing o, or null if o is not manageable.
        Since:
        1.0.0
      • getManagedInstance

        public static java.lang.Object getManagedInstance​(java.lang.Object o)
        Returns:
        the user-visible representation of o.
        Since:
        1.0.0