HHH-6141 - Develop scheme for ordered processing of MetadataSources sources

This commit is contained in:
Steve Ebersole 2011-04-19 10:00:58 -05:00
parent ddb79d1709
commit 363608a604
3 changed files with 11 additions and 2 deletions

View File

@ -28,4 +28,9 @@ package org.hibernate.metamodel.source;
* @author Steve Ebersole
*/
public interface Metadata {
public static enum ProcessingOrder {
ANNOTATIONS_FIRST,
HBM_FIRST
}
}

View File

@ -90,7 +90,11 @@ public class MetadataSources {
}
public Metadata buildMetadata() {
return new MetadataImpl( this );
return buildMetadata( Metadata.ProcessingOrder.ANNOTATIONS_FIRST );
}
public Metadata buildMetadata(Metadata.ProcessingOrder preferredProcessingOrder) {
return new MetadataImpl( this, preferredProcessingOrder );
}
/**

View File

@ -65,7 +65,7 @@ public class MetadataImpl implements Metadata, MetadataImplementor, Serializable
private Map<String, FetchProfile> fetchProfiles = new HashMap<String, FetchProfile>();
private Map<String, String> imports;
public MetadataImpl(MetadataSources metadataSources) {
public MetadataImpl(MetadataSources metadataSources, ProcessingOrder preferredProcessingOrder) {
this.serviceRegistry = metadataSources.getServiceRegistry();
this.namingStrategy = metadataSources.getNamingStrategy();