Class InterfaceContainerPolicy

    • Field Detail

      • containerClass

        protected java.lang.Class containerClass
        The concrete container class.
      • containerClassName

        protected java.lang.String containerClassName
      • cloneMethod

        protected transient java.lang.reflect.Method cloneMethod
        The method which will return a clone of an instance of the containerClass.
    • Constructor Detail

      • InterfaceContainerPolicy

        public InterfaceContainerPolicy()
        INTERNAL: Construct a new policy.
      • InterfaceContainerPolicy

        public InterfaceContainerPolicy​(java.lang.Class containerClass)
        INTERNAL: Construct a new policy for the specified class.
      • InterfaceContainerPolicy

        public InterfaceContainerPolicy​(java.lang.String containerClassName)
        INTERNAL: Construct a new policy for the specified class name.
    • Method Detail

      • equals

        public boolean equals​(java.lang.Object object)
        INTERNAL: Return if the policy is equal to the other. By default if they are the same class, they are considered equal. This is used for query parse caching.
        Overrides:
        equals in class ContainerPolicy
      • cloneFor

        public java.lang.Object cloneFor​(java.lang.Object container)
        INTERNAL: Return a clone of the specified container.
        Overrides:
        cloneFor in class ContainerPolicy
      • convertClassNamesToClasses

        public void convertClassNamesToClasses​(java.lang.ClassLoader classLoader)
        INTERNAL: Convert all the class-name-based settings in this ContainerPolicy to actual class-based settings. This method is used when converting a project that has been built with class names to a project with classes.
        Overrides:
        convertClassNamesToClasses in class ContainerPolicy
        Parameters:
        classLoader -
      • createChangeEvent

        public CollectionChangeEvent createChangeEvent​(java.lang.Object collectionOwner,
                                                       java.lang.String propertyName,
                                                       java.lang.Object collectionChanged,
                                                       java.lang.Object elementChanged,
                                                       int changeType,
                                                       java.lang.Integer index,
                                                       boolean isChangeApplied)
        INTERNAL: Creates a CollectionChangeEvent for the container
        Specified by:
        createChangeEvent in class ContainerPolicy
      • createQueryKeyForMapKey

        public QueryKey createQueryKeyForMapKey()
        INTERNAL: Create a query key that links to the map key InterfaceContainerPolicy does not support maps, so this method will return null subclasses will extend this method.
      • getCloneMethod

        public java.lang.reflect.Method getCloneMethod()
        INTERNAL: Return the 'clone()' Method for the container class. Lazy initialization is used, so we can serialize these things.
      • getCloneMethod

        protected java.lang.reflect.Method getCloneMethod​(java.lang.Class javaClass)
        INTERNAL: Return the 'clone()' Method for the specified class. Return null if the method does not exist anywhere in the hierarchy
      • getContainerClass

        public java.lang.Class getContainerClass()
        INTERNAL: Returns the container class to be used with this policy.
        Overrides:
        getContainerClass in class ContainerPolicy
      • getDirectKeyField

        public DatabaseField getDirectKeyField​(CollectionMapping mapping)
        INTERNAL: Return the DatabaseField that represents the key in a DirectMapMapping. If the keyMapping is not a DirectMapping, this will return null.
      • getInterfaceType

        public abstract java.lang.Class getInterfaceType()
      • invokeCloneMethodOn

        protected java.lang.Object invokeCloneMethodOn​(java.lang.reflect.Method method,
                                                       java.lang.Object container)
        INTERNAL: Invoke the specified clone method on the container, handling the necessary exceptions.
      • isMapKeyAttribute

        public boolean isMapKeyAttribute()
        INTERNAL: Return whether a map key this container policy represents is an attribute By default this method will return false since only subclasses actually represent maps.
      • isValidContainerType

        public boolean isValidContainerType​(java.lang.Class containerType)
        INTERNAL: Validate the container type.
        Overrides:
        isValidContainerType in class ContainerPolicy
      • setCloneMethod

        public void setCloneMethod​(java.lang.reflect.Method cloneMethod)
        INTERNAL: Set the Method that will return a clone of an instance of the containerClass.
      • buildContainerFromVector

        public java.lang.Object buildContainerFromVector​(java.util.Vector vector,
                                                         AbstractSession session)
        INTERNAL: Return a container populated with the contents of the specified Vector.
        Overrides:
        buildContainerFromVector in class ContainerPolicy