Search in sources :

Example 1 with JoinedIterator

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

the class Component method getColumnIterator.

@Override
@SuppressWarnings("unchecked")
public Iterator<Selectable> getColumnIterator() {
    Iterator[] iters = new Iterator[getPropertySpan()];
    Iterator iter = getPropertyIterator();
    int i = 0;
    while (iter.hasNext()) {
        iters[i++] = ((Property) iter.next()).getColumnIterator();
    }
    return new JoinedIterator(iters);
}
Also used : JoinedIterator(org.hibernate.internal.util.collections.JoinedIterator) Iterator(java.util.Iterator) JoinedIterator(org.hibernate.internal.util.collections.JoinedIterator)

Example 2 with JoinedIterator

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

the class PersistentClass method getDeclaredPropertyIterator.

// The following methods are added to support @MappedSuperclass in the metamodel
public Iterator getDeclaredPropertyIterator() {
    ArrayList iterators = new ArrayList();
    iterators.add(declaredProperties.iterator());
    for (int i = 0; i < joins.size(); i++) {
        Join join = (Join) joins.get(i);
        iterators.add(join.getDeclaredPropertyIterator());
    }
    return new JoinedIterator(iterators);
}
Also used : ArrayList(java.util.ArrayList) JoinedIterator(org.hibernate.internal.util.collections.JoinedIterator)

Example 3 with JoinedIterator

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

the class PersistentClass method getSubclassPropertyClosureIterator.

public Iterator getSubclassPropertyClosureIterator() {
    ArrayList iters = new ArrayList();
    iters.add(getPropertyClosureIterator());
    iters.add(subclassProperties.iterator());
    for (int i = 0; i < subclassJoins.size(); i++) {
        Join join = (Join) subclassJoins.get(i);
        iters.add(join.getPropertyIterator());
    }
    return new JoinedIterator(iters);
}
Also used : ArrayList(java.util.ArrayList) JoinedIterator(org.hibernate.internal.util.collections.JoinedIterator)

Example 4 with JoinedIterator

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

the class PersistentClass method getSubclassClosureIterator.

public Iterator getSubclassClosureIterator() {
    ArrayList iters = new ArrayList();
    iters.add(new SingletonIterator(this));
    Iterator iter = getSubclassIterator();
    while (iter.hasNext()) {
        PersistentClass clazz = (PersistentClass) iter.next();
        iters.add(clazz.getSubclassClosureIterator());
    }
    return new JoinedIterator(iters);
}
Also used : SingletonIterator(org.hibernate.internal.util.collections.SingletonIterator) ArrayList(java.util.ArrayList) 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)

Example 5 with JoinedIterator

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

the class PersistentClass method getPropertyIterator.

/**
	 * Build an iterator over the properties defined on this class.  The returned
	 * iterator only accounts for "normal" properties (i.e. non-identifier
	 * properties).
	 * <p/>
	 * Differs from {@link #getUnjoinedPropertyIterator} in that the returned iterator
	 * will include properties defined as part of a join.
	 * <p/>
	 * Differs from {@link #getReferenceablePropertyIterator} in that the properties
	 * defined in superclasses of the mapping inheritance are not included.
	 *
	 * @return An iterator over the "normal" properties.
	 */
public Iterator getPropertyIterator() {
    ArrayList iterators = new ArrayList();
    iterators.add(properties.iterator());
    for (int i = 0; i < joins.size(); i++) {
        Join join = (Join) joins.get(i);
        iterators.add(join.getPropertyIterator());
    }
    return new JoinedIterator(iterators);
}
Also used : ArrayList(java.util.ArrayList) 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