public static void bindCollectionSecondPass(Element node, Collection collection,
java.util.Map persistentClasses, Mappings mappings, java.util.Map inheritedMetas)
throws MappingException {
if ( collection.isOneToMany() ) {
OneToMany oneToMany = (OneToMany) collection.getElement();
String assocClass = oneToMany.getReferencedEntityName();
PersistentClass persistentClass = (PersistentClass) persistentClasses.get( assocClass );
if ( persistentClass == null ) {
throw new MappingException( "Association references unmapped class: " + assocClass );
}
oneToMany.setAssociatedClass( persistentClass );
collection.setCollectionTable( persistentClass.getTable() );
if ( LOG.isDebugEnabled() ) {
LOG.debugf( "Mapping collection: %s -> %s", collection.getRole(), collection.getCollectionTable().getName() );
}