Class ArrayType

    • Constructor Detail

      • ArrayType

        public ArrayType​(TypeFactory.TypeScope typeScope,
                         java.lang.String role,
                         java.lang.String propertyRef,
                         java.lang.Class elementClass)
    • Method Detail

      • getElementsIterator

        public java.util.Iterator getElementsIterator​(java.lang.Object collection)
        Not defined for collections of primitive type
        Overrides:
        getElementsIterator in class CollectionType
        Parameters:
        collection - The collection to be iterated
        Returns:
        The iterator.
      • wrap

        public PersistentCollection wrap​(SharedSessionContractImplementor session,
                                         java.lang.Object array)
        Description copied from class: CollectionType
        Wrap the naked collection instance in a wrapper, or instantiate a holder. Callers MUST add the holder to the persistence context!
        Specified by:
        wrap in class CollectionType
        Parameters:
        session - The session from which the request is originating.
        array - The bare collection to be wrapped.
        Returns:
        The wrapped collection.
      • instantiateResult

        public java.lang.Object instantiateResult​(java.lang.Object original)
        Description copied from class: CollectionType
        Instantiate a new "underlying" collection exhibiting the same capacity charactersitcs and the passed "original".
        Overrides:
        instantiateResult in class CollectionType
        Parameters:
        original - The original collection.
        Returns:
        The newly instantiated collection.
      • replaceElements

        public java.lang.Object replaceElements​(java.lang.Object original,
                                                java.lang.Object target,
                                                java.lang.Object owner,
                                                java.util.Map copyCache,
                                                SharedSessionContractImplementor session)
                                         throws HibernateException
        Description copied from class: CollectionType
        Replace the elements of a collection with the elements of another collection.
        Overrides:
        replaceElements in class CollectionType
        Parameters:
        original - The 'source' of the replacement elements (where we copy from)
        target - The target of the replacement elements (where we copy to)
        owner - The owner of the collection being merged
        copyCache - The map of elements already replaced.
        session - The session from which the merge event originated.
        Returns:
        The merged collection.
        Throws:
        HibernateException
      • instantiate

        public java.lang.Object instantiate​(int anticipatedSize)
        Description copied from class: CollectionType
        Instantiate an empty instance of the "underlying" collection (not a wrapper), but with the given anticipated size (i.e. accounting for initial capacity and perhaps load factor).
        Specified by:
        instantiate in class CollectionType
        Parameters:
        anticipatedSize - The anticipated size of the instaniated collection after we are done populating it.
        Returns:
        A newly instantiated collection to be wrapped.
      • indexOf

        public java.lang.Object indexOf​(java.lang.Object array,
                                        java.lang.Object element)
        Overrides:
        indexOf in class CollectionType