FileDocCategorySizeDatePackage
CollectionSecondPass.javaAPI DocHibernate 3.2.52449Thu Aug 03 02:53:10 BST 2006org.hibernate.cfg

CollectionSecondPass

public abstract class CollectionSecondPass extends Object implements SecondPass
Collection second pass
author
Emmanuel Bernard

Fields Summary
private static Log
log
Mappings
mappings
org.hibernate.mapping.Collection
collection
private Map
localInheritedMetas
Constructors Summary
public CollectionSecondPass(Mappings mappings, org.hibernate.mapping.Collection collection, Map inheritedMetas)


	       
		this.collection = collection;
		this.mappings = mappings;
		this.localInheritedMetas = inheritedMetas;
	
public CollectionSecondPass(Mappings mappings, org.hibernate.mapping.Collection collection)

		this(mappings, collection, Collections.EMPTY_MAP);
	
Methods Summary
private static java.lang.Stringcolumns(org.hibernate.mapping.Value val)

		StringBuffer columns = new StringBuffer();
		Iterator iter = val.getColumnIterator();
		while ( iter.hasNext() ) {
			columns.append( ( (Selectable) iter.next() ).getText() );
			if ( iter.hasNext() ) columns.append( ", " );
		}
		return columns.toString();
	
public voiddoSecondPass(java.util.Map persistentClasses)

		if ( log.isDebugEnabled() )
			log.debug( "Second pass for collection: " + collection.getRole() );

		secondPass( persistentClasses, localInheritedMetas ); // using local since the inheritedMetas at this point is not the correct map since it is always the empty map
		collection.createAllKeys();

		if ( log.isDebugEnabled() ) {
			String msg = "Mapped collection key: " + columns( collection.getKey() );
			if ( collection.isIndexed() )
				msg += ", index: " + columns( ( (IndexedCollection) collection ).getIndex() );
			if ( collection.isOneToMany() ) {
				msg += ", one-to-many: "
					+ ( (OneToMany) collection.getElement() ).getReferencedEntityName();
			}
			else {
				msg += ", element: " + columns( collection.getElement() );
			}
			log.debug( msg );
		}
	
public abstract voidsecondPass(java.util.Map persistentClasses, java.util.Map inheritedMetas)