Search in sources :

Example 11 with JoinedIterator

use of org.hibernate.internal.util.collections.JoinedIterator in project hibernate-orm by hibernate.

the class PersistentClass method getSubclassIterator.

/**
	 * Iterate over subclasses in a special 'order', most derived subclasses
	 * first.
	 */
public Iterator getSubclassIterator() {
    Iterator[] iters = new Iterator[subclasses.size() + 1];
    Iterator iter = subclasses.iterator();
    int i = 0;
    while (iter.hasNext()) {
        iters[i++] = ((Subclass) iter.next()).getSubclassIterator();
    }
    iters[i] = subclasses.iterator();
    return new JoinedIterator(iters);
}
Also used : JoinedIterator(org.hibernate.internal.util.collections.JoinedIterator) Iterator(java.util.Iterator) SingletonIterator(org.hibernate.internal.util.collections.SingletonIterator) EmptyIterator(org.hibernate.internal.util.collections.EmptyIterator) JoinedIterator(org.hibernate.internal.util.collections.JoinedIterator)

Aggregations

JoinedIterator (org.hibernate.internal.util.collections.JoinedIterator)11 Iterator (java.util.Iterator)8 ArrayList (java.util.ArrayList)6 HashSet (java.util.HashSet)3 EmptyIterator (org.hibernate.internal.util.collections.EmptyIterator)3 SingletonIterator (org.hibernate.internal.util.collections.SingletonIterator)3 List (java.util.List)2 Set (java.util.Set)2 SortedSet (java.util.SortedSet)2 TreeSet (java.util.TreeSet)2 Session (org.hibernate.Session)2 Test (org.junit.Test)2 LinkedHashSet (java.util.LinkedHashSet)1 Transaction (org.hibernate.Transaction)1 Settings (org.hibernate.cfg.Settings)1 Dialect (org.hibernate.dialect.Dialect)1 Column (org.hibernate.mapping.Column)1 PersistentClass (org.hibernate.mapping.PersistentClass)1 Table (org.hibernate.mapping.Table)1