private static void parseFetchProfile(Element element, Mappings mappings, String containingEntityName) { String profileName = element.attributeValue( "name" ); FetchProfile profile = mappings.findOrCreateFetchProfile( profileName, MetadataSource.HBM ); Iterator itr = element.elementIterator( "fetch" ); while ( itr.hasNext() ) { final Element fetchElement = ( Element ) itr.next(); final String association = fetchElement.attributeValue( "association" ); final String style = fetchElement.attributeValue( "style" ); String entityName = fetchElement.attributeValue( "entity" ); if ( entityName == null ) { entityName = containingEntityName; } if ( entityName == null ) { throw new MappingException( "could not determine entity for fetch-profile fetch [" + profileName + "]:[" + association + "]" ); } profile.addFetch( entityName, association, style ); } }
private static void parseFetchProfile(Element element, Mappings mappings, String containingEntityName) { String profileName = element.attributeValue( "name" ); FetchProfile profile = mappings.findOrCreateFetchProfile( profileName, MetadataSource.HBM ); Iterator itr = element.elementIterator( "fetch" ); while ( itr.hasNext() ) { final Element fetchElement = ( Element ) itr.next(); final String association = fetchElement.attributeValue( "association" ); final String style = fetchElement.attributeValue( "style" ); String entityName = fetchElement.attributeValue( "entity" ); if ( entityName == null ) { entityName = containingEntityName; } if ( entityName == null ) { throw new MappingException( "could not determine entity for fetch-profile fetch [" + profileName + "]:[" + association + "]" ); } profile.addFetch( entityName, association, style ); } }
public void doSecondPass(Map persistentClasses) throws MappingException { org.hibernate.mapping.FetchProfile profile = mappings.findOrCreateFetchProfile( fetchProfileName, MetadataSource.ANNOTATIONS ); if ( MetadataSource.ANNOTATIONS != profile.getSource() ) { return; } PersistentClass clazz = mappings.getClass( fetch.entity().getName() ); // throws MappingException in case the property does not exist clazz.getProperty( fetch.association() ); profile.addFetch( fetch.entity().getName(), fetch.association(), fetch.mode().toString().toLowerCase() ); } }
public void doSecondPass(Map persistentClasses) throws MappingException { org.hibernate.mapping.FetchProfile profile = mappings.findOrCreateFetchProfile( fetchProfileName, MetadataSource.ANNOTATIONS ); if ( MetadataSource.ANNOTATIONS != profile.getSource() ) { return; } PersistentClass clazz = mappings.getClass( fetch.entity().getName() ); // throws MappingException in case the property does not exist clazz.getProperty( fetch.association() ); profile.addFetch( fetch.entity().getName(), fetch.association(), fetch.mode().toString().toLowerCase() ); } }